PHP LABO

JW FLV Media Player PHP Class > Basic

Basic

  1. include of JWFLVmediaplayerClass.php
  2. Set FLV & JPG files
  3. Set div name
  4. Set Width & Hight
  5. Call player

Single embed code(example-01)

Get the Flash Player to see this player.

PHP code(example-01)

include_once 'class/JWFLVmediaplayerClass.php';
$playFile  = 'cyndi.flv';
$playImage = 'cyndi.jpg';
$mplayer = new JWFLVmediaplayer();
$mplayer->setDivName('container');
$mplayer->setWidth('320');
$mplayer->setHeight('262');
$mplayer->setFile($playFile);
$mplayer->setImage($playImage);
echo $mplayer->GetPlayer();

Output HTML code(example-01)

<div id="container">
<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
  var s1 = new SWFObject("mediaplayer.swf","mediaplayer","320","262","7");
  s1.addParam("allowfullscreen","true");
  s1.addParam("allowscriptaccess","always");
  s1.addParam("wmode","opaque");
  s1.addVariable("shuffle","");
  s1.addVariable("image","cyndi.jpg");
  s1.addVariable("file","cyndi.flv");
  s1.addVariable("width","320");
  s1.addVariable("height","262");
  s1.write("container");
</script>

You do not need to write javascript when you use JW FLV Media Player PHP Class.
When I let one page display it more than 2, I become convenient.
Next Move set div name is 'container2' and other FLV file & Image file.

Single embed other movie (example-02)

Get the Flash Player to see this player.

PHP code(example-02)

$playFile  = 'Cyndi_Wang-Ai_Ni.flv';
$playImage = 'Cyndi_Wang-Ai_Ni.jpg';
$mplayer->setDivName('container2');
$mplayer->setFile($playFile);
$mplayer->setImage($playImage);
echo $mplayer->GetPlayer();