[[PlayerToc(flash)]] = JW Player: Supported Formats = This page lists all mediafile, streaming and playlist types the JW Player supports. == Single Files == Note that the player always tries to recognize a file format by its extension. If no suitable 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] and audio in [http://en.wikipedia.org/wiki/Advanced_Audio_Coding AAC] (''type=video''). * Sounds in [http://en.wikipedia.org/wiki/MP3 MP3] (''type=sound''). * 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] (''type=image''). 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 you cannot seek within an MP4 file be before it is completely downloaded, the cause of this problem is that 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 progress bar isn't running with your FLV file, or if your video dimensions are wrong, this means that your FLV file doesn't have metadata. Fix this by using the small tool from [http://www.buraks.com/flvmdi/ www.buraks.com/flvmdi/]. 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. == Youtube Videos == The player includes native support for playing back Youtube videos (''type=youtube''). Set this up by assigning the '''file''' flashvar to the URL of the Youtube video you want to play (e.g. ''http://www.youtube.com/watch?v=WuQnd3d9IuA''). The player uses the official [http://code.google.com/apis/youtube/ Youtube API] for this functionality. This API is accessed through the separate '''yt.swf''' file, which is included in the player download. In order for Youtube videos to play, '''you must place the yt.swf file in the same folder as you place player.swf on your webserver'''. Unfortunately, there's no way yet to playback higher quality Youtube videos through the API. == Livestream.com == As of version 4.6, the player includes native support for streaming through the [http://www.livestream.com Livestream.com] service. This is set up by setting the '''file''' flashvar to the name of your Livestream.com channel, the '''type''' flashvar to ''livestream'' and the '''livestream.devkey''' flashvar to an API key from Livestream.com that is valid for your domain. API keys can be generated in the Livestream.com management section. For more info, see [http://www.livestream.com/platform/player/3rdparty/jwplayer this page at Livestream.com]. == HTTP Streaming == Both FLV and MP4 video can be played back with so-called HTTP pseudostreaming servers. These servers allow video viewers to skip to nondownloaded parts of a video. HTTP streaming can be enabled by setting the flashvar ''type=http'' in the player. Here's a few examples of such streaming servers: * The [http://h264.code-shop.com/trac/wiki H264 streaming module] for Apache, Lighttpd, IIS and NginX. * The [http://blog.lighttpd.net/articles/2006/03/09/flv-streaming-with-lighttpd mod_flv_streaming module] for Lighttpd. * PHP/ASP scripts such as [http://xmoov.com/xmoov-php/ XmooV PHP]. * Content delivery networks such as [http://www.bitgravity.com Bitgravity], [http://www.edgecast.com Edgecast] or [http://www.llnw.com Limelight]. Next to the ''type=http'' flashvar, two flashvars are available to configure HTTP streaming: * By default, the querystring parameter to provide the start position to the server is called '''start'''. (e.g. ''http://server.com/video.flv?start=3489512''). As of version 4.6, this parameter can be configured with the flashvar '''http.startparam'''. For example, the Edgecast CDN uses ''ec_seek'', Bitgravity uses ''starttime'' and Limelight uses ''fs'' as pseudostreaming start parameter. As of 4.7, this parameter can also be parsed as a playlist variable, to allow a playlist with videos from different streaming services. * If you use a PHP/ASP/* script for pseudostreaming, you must provide the location of that script with the '''streamer''' flashvar. Instead of directly calling the file with start parameter, the player will then call the script, with both file and start as parameters (e.g. (e.g. ''http://server.com/streamscript.php?file=video.flv&start=3489512''). == RTMP Streaming == FLV and MP4 video and MP3 and AAC audio can also be streamed with [http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol RTMP Servers], using the ''type=rtmp'' flashvar. In addition to this, RTMP live streams can be played in the player. The following RTMP servers are supported: * [http://www.wowzamedia.com Wowza Media Server] * [http://www.adobe.com/products/flashmediaserver/ Flash Media Server] * [http://www.osflash.org/red5 Red5 server] In addition to the ''file'' and the ''type=rtmp'' flashvar, RTMP streams usually need a third flashvar '''streamer''', which gives the player the location of the RTMP server (e.g. ''streamer=rtmp://edge.sercer.com/application''). The player will figure out by itself if it needs to strip the ''.flv'' extension off the file, or if it needs to prepend a ''mp4:'' or ''mp3:'' string to load the file. In 4.6, this behaviour can be skipped by setting the ''rtmp.prepend=false'' flashvar. Most frequently used RTMP functionality (such as 302 redirects, the '''getstreamlength''' call and Wowza's '''secureToken''') is built into the player. In addition to this, the player supports loadbalancing with XML files. This is used by e.g. the [http://www.highwinds.com/ Highwinds] and [http://www.vdo-x.net VDO-X] CDNs. Instead of loading the video, the RTMP model presumes that the '''file''' flashvar is actually an intermediate SMIL file, which is then loaded and parsed to retrieve the actual RTMP '''streamer''' and '''file'''. In version 4.6 of the player, turn this on by adding the flashvar ''rtmp.loadbalance=true''. As of 4.7, this parameter can also be parsed as a playlist variable, to allow a playlist with videos from different streaming services. Here's an example of such a SMIL file, in case you're interested in building this into your own CDN: {{{ }}} A special RTMP case is the live broadcast through the Akamai or Limelight networks. These CDNs use a stream subscription mechanism for load balancing. This is supported by the player, by setting the '''rtmp.subscribe''' flashvar to ''true''. The regular ''file'' and ''streamer'' flashvars are still needed. As of 4.7, this parameter can also be parsed as a playlist variable, to allow a playlist with videos from different streaming services. == XML Playlists == First, note that playlist XML files are subject to the [wiki:FlashSecurity Crossdomain security restrictions] of Flash. This means that a videoplayer on one domain cannot load a playlist from another domain. It can be fixed by placing a [wiki:FlashSecurity crossdomain.xml] file at the server the captions are loaded from. That said, 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://xspf.org/specs XSPF] feeds ([//player/testing/files/xspf.xml example]) 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:''' || '''ASX''' || '''ATOM''' || || [wiki:FlashVars#Fileproperties author] || creator || - ||author || credit || author || - || || [wiki:FlashVars#Fileproperties date] || - || pubDate || - || - || - || published || || [wiki:FlashVars#Fileproperties description] || annotation || description || summary || description || abstract || summary || || [wiki:FlashVars#Fileproperties duration] || duration || - || duration || content || duration || - || || [wiki:FlashVars#Fileproperties file] || location || enclosure || - || content || ref || - || || [wiki:FlashVars#Fileproperties link] || info || link || - || - || moreinfo || link || || [wiki:FlashVars#Fileproperties image] || image || - || - || thumbnail || - || - || || [wiki:FlashVars#Fileproperties start] || - || - || - || - || starttime || - || || [wiki:FlashVars#Fileproperties streamer] || - || - || - || - || - || - || || [wiki:FlashVars#Fileproperties tags] || - || category || keywords || keywords || - || - || || [wiki:FlashVars#Fileproperties 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. == Bitrate Switching == The 4.6 player introduced a mechanism for [FlashOverview#BitrateSwitching bitrate switching], which can be used to optimize the quality of your video stream for each visitor. Bitrate switching is enabled by loading various quality levels of your video through an XML playlist. The levels must be in a '''media:content''' element that has a ''bitrate'', ''url'' and ''width'' defined. Here is an example of such a feed: {{{ Progressive download http://www.bigbuckbunny.org/ Big Buck Bunny is a short animated film by the Blender Institute. }}} Leveraging the '''media:content''' elements for stream switching ensures that this feed is also compatible with other RSS readers and media players (such as pre 4.6 JW Players). It is recommended to order the streams by quality, the best one at the beginning. Most players will pick this one. The '''media:group''' element here is optional, but organizes the feed a little. == 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 extensions FLV 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 Project http 34 }}} 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.