The dmFlowPlayerPlugin allows to read video, audio and flash medias.
It packages a Diem front widget, and extends the £media capabilities.
git clone git://github.com/ornicar/dmFlowPlayerPlugin.git plugins/dmFlowPlayerPlugin
class ProjectConfiguration extends dmProjectConfiguration { public function setup() { parent::setup(); $this->enablePlugins(array( // your enabled plugins 'dmFlowPlayerPlugin' ));
php symfony dm:setup
A new widget appears in the front application "Add" menu:

Drag & Drop it somewhere on the page, then upload a file or Drag & Drop a media from the MEDIAS panel.
You should specify both width and height in pixels. If you let them empty, an optimal size will be calculated based on the widget size.
How the media will be scaled if its original size if different than the widget size.
If checked, the media will be played immediately on page load.
If checked, the player controls will be displayed.
An image to be displayed before the Video/Audio media is played.
As usual, you can upload a file or Drag & drop a media from the right MEDIAS panel.
The image alt attribute. Usefull for accessibility and search engine optimization, as search engines don't index the video content.
You should specify both width and height in pixels. If you let them empty, an optimal size will be calculated based on the widget size.
Here you can freely add configuration to be passed to the flashembed objet.
See available configuration options on the flowplayer website.
The configuration must be in YAML format.
Example of valid configuration:
bgcolor: #000000
wmode: opaque
quality: high
Here you can freely add flashvars to the flash object.
The flashvars must be in YAML format.
Example of valid flashvars:
variable1: value1
array_var: [ val2, val3 ]
The _media template helper is extended and now allows to display video, audio and flash medias.
// display a video using all available options echo _media('myvideo.flv') ->size(300, 200) // resize to 300px width, 200px height ->method('fit') // available methods: fit, scale, half, orig ->control(true) // display the player controls ->autoplay(true) // play the video on page load ->splash( // display a clickable image to launch the video _media('intro.jpg') ->alt('Click to start') );
The splash can be a £media, or just HTML code:
ple
// display a video usgin html splash echo _media('myvideo.flv') ->splash( // display a clickable text to launch the video _tag('div', _tag('h3', 'Our nice video about penguins'). _tag('p', 'Click to start') ) );
// display a flash object all available options echo _media('myflash.swf') ->size(300, 200) // resize to 300px width, 200px height ->flashConfig(array( // configure flash rendering 'bgcolor' => '#000000', 'wmode' => 'opaque', 'quality' => 'high' )) ->flashVars(array( // pass flash vars 'variable1' => 'value1', 'array_var' => array( 'val2', 'val3') ));
See available configuration options on the flowplayer website.
By listening a symfony event (dm_flow_player.filter_options), you can modify options sent to flowplayer:
apps/front/config/frontConfiguration.class.php
require_once(dm::getDir().'/dmFrontPlugin/lib/config/dmFrontApplicationConfiguration.php'); class frontConfiguration extends dmFrontApplicationConfiguration { public function configure() { $this->dispatcher->connect('dm_flow_player.filter_options', array($this, 'listenToFlowPlayerFilterOptionsEvent')); } public function listenToFlowPlayerFilterOptionsEvent(sfEvent $event, array $options) { // modify the options array return $options; } }
The event contains a attributes parameter you can use to access all the dmMediaTag attributes:
$width = $event['attributes']['width'];
If a DmMedia is rendered, you can access its ID:
$mediaId = $event['media_id'];
Open issues
Closed issues
dmFlowPlayerPlugin, created on December 25, 2009 by Thibault D, used by 731 projects
altranoDecember 25, 2009 6:49 PM
Great work
the question is can i get external videos, sounds, etc.?
like from YouTube, Google and someone?
Thanks
Thibault DJanuary 23, 2010 7:20 PM
Nope. This plugin is intended to display medias hosted on your own server.
It's way more configurable than, let's say, a youtube player. And you're not dependant to an external site.
But another plugin to handle external medias should be written, yes.
RonaldApril 21, 2010 3:11 PM
Nice work guys..but i cant get the _media tag to display flash videos on my site. I created a module with the dmMedia class and with a video_id column to bind to my model Videos, but i cant display the flv with _media helper on my template.. please is there a solution for this? or is it a bug with flowplayerplugin?