PhilFlash

Video FLV in PHP Streaming with the Flash Video Player by Jeroen Wijering

Updated - 14 october 2008

Traduire/Translate : Français - Deutsch (by Google)

To view this video you need JavaScript enabled and the latest Adobe Flash Player installed.
Download the free Flash Player now.

Download Flash Player

Obtenir les sources Sources - version 1.35 - Updated - 2 May 2008

FAQ

Obtenir les sources Sample applications without video file - Exemples sans video (238 ko) - Updated 14 October 2008

Obtenir les sources Sample applications with video files - Exemples avec videos (57 774 ko) - FTP Link - Updated 14 October 2008

Another example with captions

Autre exemple : Elephants dreamDemo 2 : click for another example with PHP Streaming and captions

Elephants dream

 

Introduction

In a previous article, we used the FLVPlayback component to display video in PHP Streaming.
But, there are serious bugs with the Flash Player 9.
In certain cases, FLVPlayback with PHP Streaming crashes or freezes the browser (Internet Explorer or Firefox) with the Flash Player 9.
We needed another player for PHP Streaming.
Our choice was made for the Flash Video Player by Jeroen Wijering.

For an introduction on PHP Streaming, consult the FAQ.

Let us recall that the great interest of the PHP Streaming is to seek at any position in a movie (without downloading the whole file).

Flash Video Player by Jeroen Wijering

Flash Video Player by Jeroen Wijering is a video player whose sources files are available.

The Flash Video Player is licensed under a Creative Commons License.
It allows you to use and modify the script for noncommercial purposes.
For commercial use, Jeroen Wijering distributes licenses of the script for 15 euros.
For more informations about licences, see the web site of Jeroen Wijering.

PHP Streaming with Flash Video Player

The Flash Video Player has an option to show video in PHP Streaming (Jeroen uses the term: Http Streaming).
In this case, the variable streamscript must be initialized with a PHP script and metadata must be injected (with FLV MetaData Injector by Burak Kalayci: http://www.buraks.com/flvmdi/).

Unfortunately, the 'Http streaming' option has many bugs.
For example, if you seek at any point in the video and when the video is finished, the player returns to the position of the last seek (and not at the beginning of the video).

Having good experience of PHP Streaming (and many problems encountered with FLVPlayback), we decided to create a special version for PHP Streaming with additional features:

How to use the PHP Streaming extension with Flash Video Player

Here are the steps:

  1. Encode your video
  2. VERY IMPORTANT
    Inject metadata. For this, use the free FLV MetaData Injector by Burak Kalayci
  3. Upload your video on your PHP server.
  4. Upload the 4 following files: phpsflvplayer.swf, flvprovider.php, playerProductInstall.swf et swfobject.js
    These files are available in the samples (scripts directory)
  5. Add the following code in your HTML file (updated in October 2008 for SWFObject 2.1)
    (all the script (with swfobject.js) in the head section and a flashcontent div in the body section):

    <head>
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
    var attributes = {};

    var params = {};
    // for fullscreen
    params.allowfullscreen = "true";

    var flashvars = {};
    // the video file or the playlist file
    flashvars.file = "myvideo.flv";

    // the PHP script (1.5 is a recommended value for PHP Streaming for bufferlength)
    flashvars.streamscript = "flvprovider.php";
    flashvars.bufferlength = "1.5";

    // width and height of the player (h is height of the video + 20 for controlbar)
    // required for IE7
    flashvars.width = "320";
    flashvars.height = "260";
    // width and height of the video
    flashvars.displaywidth = "320";
    flashvars.displayheight = "240";
    flashvars.autostart = "true";
    flashvars.showdigits = "true";

    // for fullscreen
    flashvars.showfsbutton = "true";

    // 9 for Flash Player 9 (for ON2 Codec and FullScreen)
    swfobject.embedSWF("phpsflvplayer.swf", "flashcontent", "320", "260", "9.0.0",                    "playerProductInstall.swf", flashvars, params, attributes);
    </script>
    </head>
    <body>
    <div id="flashcontent">
    </div>
    ...
    </body>

  6. Upload your HTML file.
  7. That's all. Test your video in PHP Streaming with your browser.

Video of the example : Rouler à l'huile

This movie is a video under Creative Commons license: Lipopropulsion from Radhanath Gagnon, Mathieu Poulin, Raphael Lorand and David Chabot.

You can download it in various formats here: http://www.archive.org/details/collectifLipopropulsion

Total Run Time: 7:32.
This video has been encoded with ON2 Flix Pro d'ON2 with the following parameteres (two pass, 420 Kbps) :

FAQ

See the FAQ.

Version and release

History

version 1.35r2 - 14 October 2008

See history

Me connaître  |  Me contacter