Troubleshooting Jeroen Wijering's FLV player in your HTML
December 30, 2008
ActionScript3 | Flash | JW FLV Player | Troubleshooting | Video and Multimedia | Web Building | XML

There are some errors that come up time and time again when working with Jeroen Wijering's Flash Video Player. Here's how to troubleshoot them. I'll keep adding to the list as time permits. Click the images to see a larger view.


Ads by Google

Posted by ellen at December 30, 2008 10:40 PM


Problem 1: Player does not appear at all. In the example below, the only thing showing up is the link that is supposed to be filled with the player at runtime.


playerNotshowup.jpg


  • Check the error console in Firebug. If you see "swfobject is not defined"

    javascriptError2.jpg

    then it is probably because the code for the swfobject functions cannot be found. This is most likely caused by not including a link to the swfobject script in the head of the HTML page.


    <script type="text/javascript" src="js/swfobject.js"></script>

    Not including the code means that the object and embed tags for the player cannot be written into the HTML document at runtime.


  • Another possible cause is that there is an error in the path to the player SWF file, usually named "player.swf".

    In this case the object embed code will be written into the HTML, but the player file is not where the code expects it to be, so it doesn't display.


    In the example shown below, two players should be showing up in the second row of the table. Firebug is open to show the generated source. ( in other words all the HTML that was written to the page by javascript at runtime. It appears that the code for the player was indeed written to the page, yet still the player does not show up. So this means that swfobject did perform its function, but something went wrong after the code was written to the page.

    badplaylistpath.jpg


  • Problem 2: Player appears but nothing happens when Play button is clicked. Player stays black and progress bar does not advance.

  • A common reason for this is that the playlist is in a different domain than the page that the player SWF is on.

    playlistdomain.jpg

    Jeroen Wijering explains this issue quite well on his site:

      Note that the Flash plugin checks for image and MP3 files relative from the HTML page and for FLV files relative from the SWF file!

      Second, a playlist should always reside on the same server as the SWF file, due to security restrictions of the Flash Player. This can be solved if you own the domain on which the mediafiles reside. You then have to put a crossdomain.xml file in the root webfolder of that server. In this file, you can specifically allow sites to load data. An example is the crossdomain file from Youtube.
  • Another possibility is simply an incorrect path the playlist. In the example below, the player on the left has an error in the playlist path: the path starts with a "/".
    "/media/playlist3.xml" instead of "media/playlist3.xml"
    The player appears but is black - there is no posterframe, since posterframes are specified in the playlist. Nothing happens when the PLAY button is clicked.

    Checking the code in Firebug will reveal that the object code is indeed there on the page. No javascript errors will occur.


    badplaylistpath.jpg


    Player on left has:
    "/media/playlist3.xml"
    Player on right has:
    "media/playlist3.xml"





  • Another possibility is that the playlist's XML is invalid. No javascript error will be displayed.

    Sometimes the last few tags in the playlist file may get overwritten. Try validating your XML in Dreamweaver or whatever you prefer to use.
    In the example below there are several missing closing tags at the bottom:


    <?xml version="1.0" encoding="utf-8"?>

    <playlist version="1" xmlns="http://xspf.org/ns/0/">

    <trackList>

    <track>

    <title>Magnetic Resonance Safety</title>

    <location>02_Presentation</location>

    <type>rtmpt</type>

    <image>media/posterframevid20.jpg</image>

  • Problem 3: Player appears and starts playing but stops after a second. Video is being streamed from Red5 server.

  • Restart the Red5 service on the Red5 server.




  • Ads by Google

    1 Comment

    Thanks,Tutorial is very usefull for me.


    Ads by Google

     RSS   |   Contact Me


    Ads by Google