Flash Video - Simple object tag (static publishing)

See a demo exercise Watch a demo

Wouldn't it be nice if you could play video in your exercises, and in most, if not all browsers? Here's a really multi functional and highly customizable player. The code is xHTML1.1 valid and tested on WinXP SP2, Win7 in:

  • IE6, IE7, IE8, IE9
  • Firefox 1.5+
  • Opera 8.52+
  • SeaMonkey 1.0.4+
  • Netscape 7.7+
  • Chrome 10+

Player name: JW FLV Player | Author: Jeroen Wijering | Download: http://www.jeroenwijering.com

Single Flash Video (FLV) file

Get the Flash Player to see this movie.

The code

<object type="application/x-shockwave-flash" width="300" height="245" 
    data="flvplayer.swf?file=my_movie_file.flv&amp;autostart=false">
   <param name="movie" value="flvplayer.swf?file=my_movie_file.flv&amp;autostart=false" />
   <param name="flashvars" value="file=my_movie_file.flv" />
   <param name="wmode" value="transparent" />
</object>

Mind that! Mind that!

If you copy-paste the code above,
1: make sure it has no carriage returns. When you put the code into a JMatch exercise, or another one where the flash object code is placed in the Javascript code, mind that it must run as a single line! Otherwise the Javascript code of the exercise in which it is inserted gets broken and you see nothing! And don't complain I have not warned you because I do now!

2: note the sample code &autostart. Certain characters must be escaped, i.e., & becomes & a m p ;

3: you may have seen autoStart somewhere, but not in this tutorial's sample code - it must be autostart - all in lowercase! camelCase makes your pages NOT xHTML1.1 valid.

4: you will have changed my_movie_file.flv with the name of your file; and you'll have uploaded all the necessary files along with the exercise.

Only the basic functionalities have been used here. In addition to a single Flash video file, JW FLV Player supports playback of HD254, MP4; RTMP streams with a wide range of flashvars (settings) for tweaking both behaviour and appearance and an extensive, documented javascript/actionscript API. There are the accessibility examples for captions and Arab language. See the online setup wizard to customize your players, and also the full list of extras: Playlist and captioning example XML (RSS, XSPF and ATOM playlists - with advertisement possibilities) and other advanced functionalities.

JW FLV Player with an XML playlist and the SWFObject v1.5 javascript!

Mind that!SWFObject 2.0 has been released and is now hosted on code.google.com. Please consider the new v2 instead of v1.5.

Read Using SWFObject 2 and a playlist.xml for FLV

Discuss

Tweets Collection