function get_additional_enclosure_arributes($item)
 {
     $return = array();
     $valid_formats = reason_get_valid_formats_for_podcasting();
     if ($item->get_value('mime_type')) {
         $return[] = 'type="' . $item->get_value('mime_type') . '"';
     } elseif (array_key_exists($item->get_value('media_format'), $valid_formats)) {
         $return[] = 'type="' . $valid_formats[$item->get_value('media_format')] . '"';
     } else {
         $url = $item->get_value('url');
         if (!empty($url)) {
             $ext = strtolower(substr($url, -4));
             if ($ext == '.mp4') {
                 $return[] = 'type="' . $valid_formats['MP4'] . '"';
             }
         }
     }
     return $return;
 }
Example #2
0
	function get_additional_enclosure_arributes( $item )
	{
		$return = array();
		$valid_formats = reason_get_valid_formats_for_podcasting();
		if($item->get_value('mime_type'))
		{
			$return[] = 'type="'.$item->get_value('mime_type').'"';
		}
		elseif(array_key_exists($item->get_value('media_format'), $valid_formats))
		{
			$return[] = 'type="'.$valid_formats[$item->get_value('media_format')].'"';
		}
		else // this is a hack because .mp4s should be included even if the media_format field is "invalid".
		{
			$url = $item->get_value('url');
			if (!empty($url))
			{
				$ext = strtolower(substr($url, -4));
				if ($ext == '.mp4') $return[] = 'type="'.$valid_formats['MP4'].'"';
			}
		}
		return $return;
	}