= Supported file formats for Flash =
This page lists all single file and playlist types the JW Player for Flash supports.
== Single files ==
Note that the player always tries to recognize a file format by its extension. If no suiteable extension is found, '''the player will presume you want to load a playlist'''! Get around this issue by setting the [wiki:FlashVars type flashvar], e.g. ''type=video''.
* Video in [http://en.wikipedia.org/wiki/Flv FLV] and [http://en.wikipedia.org/wiki/H.264 MP4] format.
* Audio in [http://en.wikipedia.org/wiki/MP3 MP3] and [http://en.wikipedia.org/wiki/Advanced_Audio_Coding AAC] format.
* Images in [http://www.w3.org/Graphics/JPEG/ JPG], [http://en.wikipedia.org/wiki/Gif GIF] and [http://en.wikipedia.org/wiki/Portable_Network_Graphics PNG] format.
* Youtube video through their [http://code.google.com/apis/youtube/ API].
Here's a list with commonly encountered issued:
* Though SWF files also load in the player, it is discouraged to use them. The player cannot read the duration and dimensions of SWF files and cannot control its volume or playback.
* If your MP4 files cannot be seeked before they are completely downloaded, the so-called MOOV atom (which contains the seeking information) is located at the end of your video. Check out [http://renaun.com/blog/2007/08/22/234/ this little application] to parse your videos and fix it.
* If you encounter too fast or too slow playback of MP3 files, it contains variable bitrate encoding or unsupported sample frequencies (eg 48Khz). Please stick to constant bitrate encoding and 44 kHz. The [http://www.apple.com/itunes free iTunes software] has a decent MP3 encoder. Note that the 4.x player actually supports fewer formats than the 3.x player (it seems due to bugs in the [http://www.adobe.com/devnet/actionscript/articles/avm2overview.pdf AVM2]).
* If the progressbar isn't running with your FLV file, or if your video dimensions are wrong, your FLV file doesn't have metadata. Fix this by using the small tool from [http://www.buraks.com/flvmdi/ www.buraks.com/flvmdi/].
* If FLV playback doesn't work on your site which runs off an IIS server, the FLV mimetype isn't added to the server. Please contact your webserver administrator on this (if you're an admin, [http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_19439 here's how to fix it]).
More technical info on the file formats supported by Flash can be found in [http://www.kaourantin.net/2007/08/what-just-happened-to-video-on-web_20.html this blogpost] from Tinic Uro, one of the developers of the Flash plugin.
== Streaming ==
Video and audio can also be played with [http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol RTMP], both on-demand and live (through the [wiki:FlashVars streamer] variable). The following servers can be used:
* [http://www.wowzamedia.com Wowza Media Server].
* [http://www.adobe.com/products/flashmediaserver/ Flash Media Server].
* [http://www.osflash.org/red5 Red5 server].
FLV and MP4 can also be played back as HTTP streaming (again through the [wiki:FlashVars streamer] variable). The following servers and scripts can be used:
* The [http://h264.code-shop.com/trac/wiki H264 streaming module] for Apache, Lighttpd and NginX.
* PHP scripts such as [http://xmoov.com/xmoov-php/ XmooV PHP].
* ASP scripts such as the one at [http://www.flowplayer.org/forum/5/14702 the Flowplayer forum].
Additionally, there's out of the box support for streaming features of some big CDN's:
* FLV and MP4 streaming through the [http://www.bitgravity.com/ Bitgravity CDN] by setting the flashvar ''type=bitgravity''.
* Live and progressive streaming through the [http://www.highwinds.com/ Highwinds CDN] by setting the flashvar ''type=highwinds''.
* FLV and MP4 streaming with the [http://blog.lighttpd.net/articles/2006/03/09/flv-streaming-with-lighttpd Lighttpd webserver] by setting the flashvar ''type=lighttpd''.
* Live streaming through the [http://limelightnetworks.com/ Limelight CDN] by setting the flashvar ''type=fcsubscribe'' and the flashvar ''streamer=YOUR_RTMP_SERVER''.
* FLV seeking through the [http://limelightnetworks.com/ Limelight CDN] by setting the flashvar ''type=flvseek''.
== Playlists ==
The following playlist formats are supported:
* [http://msdn2.microsoft.com/en-us/library/ms910265.aspx ASX] feeds ([//player/testing/files/asx.xml example])
* [http://code.google.com/apis/youtube/2.0/developers_guide_protocol.html#Understanding_Video_Entries ATOM] feeds with [http://search.yahoo.com/mrss Media] extensions ([//player/testing/files/atom.xml example])
* [http://cyber.law.harvard.edu/rss/rss.html RSS] feeds with [http://apple.com/itunes/store/podcaststechspecs.html iTunes] ([//player/testing/files/irss.xml example]) extensions and [http://search.yahoo.com/mrss Media] extensions ([//player/testing/files/mrss.xml example]).
* [http://w3.org/AudioVideo Basic SMIL] feeds ([//player/testing/files/smil.xml example])
* [http://xspf.org/specs XSPF] feeds ([//player/testing/files/xspf.xml example])
Loading playlists (or SWF files, ID3 data, etc) from another webserver is not permitted by the [http://www.adobe.com/devnet/flashplayer/security.html Flash Player security model]. You can circumvent this by placing a [http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html crossdomain.xml file] in the root of the website that contains the media. If you don't have access to the external site, you can use a small proxy ([http://developer.yahoo.com/javascript/samples/proxy/php_proxy_simple.txt example]).
== Format mapping ==
Here is an overview of all the tags of each format the player processes, and the [wiki:FlashVars flashvars] they correspond to:
|| '''Flashvars''' || '''XSPF''' || '''RSS''' || '''itunes:''' || '''media:''' || '''SMIL''' || '''ASX''' || '''ATOM''' ||
|| [wiki:FlashVars#Fileproperties author] || creator || - ||author || credit || - || author || - ||
|| [wiki:FlashVars#Fileproperties date] || - || pubDate || - || - || - || - || published ||
|| [wiki:FlashVars#Fileproperties description] || annotation || description || summary || description || #.alt || abstract || summary ||
|| [wiki:FlashVars#Fileproperties duration] || duration || - || duration || content || #.dur || duration || - ||
|| [wiki:FlashVars#Fileproperties file] || location || enclosure || - || content || #.src || ref || - ||
|| [wiki:FlashVars#Fileproperties link] || info || link || - || - || anchor || moreinfo || link ||
|| [wiki:FlashVars#Fileproperties image] || image || - || - || thumbnail || img || - || - ||
|| [wiki:FlashVars#Fileproperties start] || - || - || - || - || #.begin || starttime || - ||
|| [wiki:FlashVars#Fileproperties streamer] || - || - || - || - || - || - || - ||
|| [wiki:FlashVars#Fileproperties tags] || - || category || keywords || keywords || - || - || - ||
|| [wiki:FlashVars#Fileproperties title] || title || title || - || title || #.title || title || title ||
|| [wiki:FlashVars#Fileproperties type] || - || - || - || - || - || - || - ||
All '''media:''' tags can be embedded in a '''media:group''' element. A '''media:content''' element can also act as a container. Additionally, iTunes and MediaRSS tags can be mixed in one RSS feed. The player will pick the last matching element for each property.
The XSPF format has a '''meta''' tag that can be used to insert content not supported by the format (for example ''20'')
== JWPlayer namespace ==
In order to enable all JW Player file properties for all feed formats, the 4.4 player introduced a '''jwplayer''' namespace. By inserting this into your feed, file properties that are not supported by the feed format itself (such as the '''type''' or '''duration''' in an RSS feed) can be amended without breaking validation. Any of the flashvars listed in the above table can be inserted. Here's an example:
{{{
Example RSS feed with jwplayer extensionsFLV Video
http://www.bigbuckbunny.org/
Big Buck Bunny is a short animated film by the Blender Institute, part of the Blender Foundation.the Peach Open Movie Projectlighttpd34
}}}
Pay attention to the top level tag, which describes the JW Player namespace with the '''xmlns''' attribute. This must be available in order to not break validity.
You can mix '''jwplayer''' elements with both the regular elements of a feed and elements from other extensions (mrss/itunes). If multiple elements match the same property, the elements will be prioritized:
* Elements that are defined by the feed format (e.g. the '''enclosure''' in RSS) get the lowest priority.
* Elements defined by the '''itunes''' namespace rank third.
* Element defined by the '''media''' namespace (e.g. '''media:content''') rank second.
* Elements defined by the '''jwplayer''' extension always gets the highest priority.
This feature allows you to set, for example, a specific video version or streaming '''type''' for the JW Player, while other feed aggregators will pick the default content.