sfVideoPlugin - 1.1.1

Provides easy interface for flash video player to embed in symfony projects.

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source | Show as Markdown

sfVideoPlugin

The sfVideoPlugin is a symfony plugin providing easy interface for flash video player to embed in symfony projects.

Installation

Install the plugin via the subversion repository:

$ svn co http://svn.symfony-project.com/plugins/sfVideoPlugin/trunk plugins/sfVideoPlugin

from the project root directory or by using the command:

$ ./symfony plugin:install sfVideoPlugin

Right after the installation of the plugin, you should update plugin assets:

$ ./symfony plugin:publish-assets

so that the default JS and CSS files of the plugin are accessible. Everything is done properly now.

Usage

Go to the config directory of the plugin and uncomment all lines in the routing.yml file.

Enable the sfVideo module in your application's config/settings.yml enabled_modules section:

enabled_modules: [sfVideo ]( ...,)

Run the following URL in your browser:

http://your-site/video

You may choose from 3 example flv files to display. An example of linking flv file is shown in sfVideo/templates/indexSuccess.php.

Video templates

The plugin is provided with a ready-to-use partial template:

include_partial('sfVideo/video', array('file' => '01.flv'));

Each flv file is fetched from web/sfVideoPlugin/flv directory.

Multi-video

You can display as many players as you want on one page if you set different player parameter for each of them. Just define an array of players in action code:

$this->players = array(
  array('file' => '01.flv', 'player' => 'player01'),
  array('file' => '02.flv', 'player' => 'player02'),
  array('file' => '03.flv', 'player' => 'player03'),
);

JS script managing flowplayer replaces HTML tags with flash players and each tag has to have a unique id parameter (player01, player02, player03 above). Temlate code should be similar to:

foreach($players as $p)
  include_partial('sfVideo/video', $p);

The plugin is provided with multi-video action example. Run the following URL in your browser:

http://your-site/multi-video

Widget

You may use a video widget (sfVideoWidget class) inside your form, e.g. in an upload form.

$form->setOption('url', '/sfVideoPlugin/flv/01.flv');

Configuration

The file config/app.yml contains basic flowplayer configuration:

width: 520px
height: 320px
autoplay: true
autobuffering: true

Example configuration reading:

sfConfig::get('app_video_autoplay')

Online demo

http://symfony.rox.pl/video

http://symfony.rox.pl/multi-video

Documentation

The offcial documentation of the flowplayer can be found here.

Credits

Example flv files have been downloaded from college(http://www.mediacollege.com/adobe/flash/video/tutorial/example-flv.html)