Hi All,
I have recreated the FLVPlayer using SWFObject and the latest version of FLV Media Player. It isn’t complete yet, but I figure it might help some of you.
The get it to work grab the JW FLV Media player from here:
http://www.jeroenwijering.com/?item=JW_FLV_Media_Player
I uploaded it to: assets/snippets/mediaplayer
Create a folder in assets called "video" and put your flv or mov files there (these are customizable btw)
Then install the following snippet in the modx manager
<?php
/*
FlvMediaPlayer by Bruce Moyle
Based on FlashPlayer snippet by Mark & Bugaev and Matt Hobbs and using Flash Media Player
http://www.jeroenwijering.com/?item=JW_FLV_Media_Player
USAGE
------------------------------------
[[FlvMediaPlayer?&file=f`ilename.flv` &width=`width` &height=`height` &image=`preview.jpg` &controls=`true` &autoplay=`true` &fullscreen=`true` &id=`clip1` &class=`css-class`]]
OPTIONS
------------------------------------
&file = File name (MP3, H264, SWF, JPG, PNG, GIF supported - XML playlists coming soon)
&path = use a different path or url for the file location. ie &path="http://www.video.org"
&width = width in pixels
&height = height in pixels
&image = preview image (if you don't want an image for an mp3, then leave out)
&controls = `true` or `false` - default is true
&autoplay = `true` or `false`
&fullscreen = `true` or `false` - Allows the use of fullscreen button
&class = the div tag class for css formating
&overstretch = `true` , `fit`, `false` or leave out to keep original aspect ratio and size.
&id = name of the current clip handler
Note about &id
- This parameter is important if you wish to host separate instances of the player on the same page.
- Set the &id to a unique name for each instance.
- It isn't necessary if there is only one instance on each page.
PATHS
------------------------------------
*/
// $videoPath is the default directory to find your videos
// This can be overwritten using &path option
$videoPath="/assets/video";
// $playerPath is where FLV Media Player is installed
// Default should be /assets/snippets/mediaplayer
$playerPath="/assets/snippets/mediaplayer";
/*
DEFAULT SETTINGS
------------------------------------
*/
$width_default = "320";
$height_default = "240";
$controls_default = "true";
$autoplay_default = "false";
$fullscreen = "true";
/*
THE CODE
------------------------------------
*/
// CHECK INPUTS
if (empty($width)) { $width=$width_default; }
if (empty($height)) { $height=$height_default; }
if (empty($controls)) { $controls=$controls_default; }
if (empty($autoplay)) { $autoPlay=$autoplay_default; }
if (empty($id)) { $id = "player"; }
if (!empty($path)) { $videoPath = $path; }
if (empty($overstretch)) { $overstretch = "false"; }
// SETUP CONTROLS
if ($controls == "true") { $height = $height + 20; }
// CREATE SCRIPT
$output = '
<script type="text/javascript" src="'.$playerPath.'/swfobject.js"></script>
<div id="'.$id.'" class="'.$class.'">
<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.
</div>
<script type="text/javascript">
var s1 = new SWFObject("'.$playerPath.'/mediaplayer.swf","mediaplayer","'.$width.'","'.$height.'","7");
s1.addParam("allowfullscreen","'.$fullscreen.'");
s1.addVariable("width","'.$width.'");
s1.addVariable("height","'.$height.'");
s1.addVariable("file","'.$videoPath.'/'.$file.'");
s1.addVariable("image","'.$videoPath.'/'.$image.'");
s1.addVariable("overstretch","'.$overstretch.'");
s1.write("'.$id.'");
</script>
';
return $output;
?>
Have fun!... the next things to do are to get xml playlist working properly and detect audio files.