lcFlowPlayerPlugin plugin
=========================
The `lcFlowPlayerPlugin` is a symfony plugin that allows users to embed video and audio streams into your webpage.
This plugin is developed by [LetsCod](http://www.letscod.com/ "Your web projects experts : Symfony, PHP, MySQL, PostgreSQL, jQuery").
Third parties
-------------
The following libraries are embedded in this plugin:
* [FlowPlayer](http://www.flowplayer.org/ "FlowPlayer") Open Source (GPL 3) video player for the Web
* [getID3](http://getid3.sourceforge.net/ "GetID3") The php media parser
Server Requirements (for the getID3 )
-------------------------------------
* iconv() support for php
* turn off magic_quotes_runtime
Installation
------------
* Install the plugin
$ symfony plugin:install --stability=beta lcFlowPlayerPlugin
* Publish the plugin assets (css and js):
$ symfony plugin:publish-assets
* Clear you cache
$ symfony cc
Configuring your plugin
-----------------------
* Enable the lcFlowPlayer filter in your application `filters.yml` as follows:
[yml]
# insert your own filters here
lcFlowPlayer:
class: lcFlowPlayerFilter
Video Usage
-----------
* Supported format: __flv__
* Embed a local video under the __web directory__
[php]
$path = "/uploads/flowplayer.flv"; // the path is relative to the web directory
echo load_video($path);
By default, an image is displayed to prevent the auto loading of the video, for a faster page loading,
and the size of the video container is the original flv video dimensions (retreived by the getId3 libraries).
Therefore the `load_video()` function can take an array as a __second optional parameter__ to override
the default settings
* Overriding video options
[php]
$path = "/uploads/flowplayer.flv"; // the path is relative to the web directory
$options = array (
"resize" => "800x600",
"image_relative_path" => "/images/media/default.png",
"image_alt" => "Play my video",
"id" => "videoplayer"
);
echo load_video($path, $options);
* `resize`: resize the video to 800x600 and __keeps the ratio__ (the format shoud be width x height or it won't parse it)
* `image_relative_path`: the relative path to the image displayed before playing the video
* `image_alt`: the `alt` attribute of the `<img>` tag, for w3c strict validation
* `id`: the script generates an id for the `<a>` that loads the video, it can be overriden for a better visual debug.
__!!__ When loading many videos in the same page and overriding the `id` option, make sure that each one is __unique__
* Embed an external video
[php]
$path = "http://e1h13.simplecdn.net/flowplayer/flowplayer.flv";
$options = array ( "resize" => "800x600");
echo load_video($path, $options);
When loading an external video, the `resize` option of the second parameter is required, for the only reason, that
the original width and height of the external flv cannot be grabbed by the getId3 libraries, therefore, it should be
set manually.
As for the other options, they work exactly the same as the example above.
Audio Usage
-----------
* Supported format: __mp3__
* Embed a local audio mp3 under the __web directory__
[php]
$path = "/uploads/eyes.mp3"; // the path is relative to the web directory
echo load_mp3($path);
By default, a mini player is displayed with default width "255px" and default height "30px".
Therefore the `load_mp3()` function can also take an array as a __second optional parameter__ to override
the default settings:
* Overriding audio options
[php]
$path = "/uploads/eyes.mp3"; // the path is relative to the web directory
$options = array (
"width" => "400px",
"height" => "50px",
"id" => "audioplayer"
);
echo load_mp3($path, $options);
* `height`: sets the new height (the value shoud be in __px__)
* `width`: sets the new width (the value shoud be in __px__)
* `id`: the script generates an id for the `<a>` that loads the video, it can be overriden for a better visual debug.
__!!__ When loading many audios in the same page and overriding the `id` option, make sure that each one is __unique__
* Embed an external audio file
[php]
$path = "http://e1h13.simplecdn.net/flowplayer/eyes.mp3";
echo load_mp3($path);
Loading an external audio file is done in the same way as a local one, with the same options
Debugging
---------
In case of errors, errors will be thrown in the __sf_web_debug toolbar__, highlighted in red
I use it
--------
If you do like the plugin, and think it helps the community, do not hesitate to click __I use it__ , so it could be more trusted
and spreaded fast.
Feedback
--------
Feel free to send your feedbacks, bug reports or suggestions to __Elie Andraos at symfony-plugins@letscod.com__
TODO
----
* Implement default image for mp3
* Video converter to support other formats (avi, mpeg, wmv etc ...)
* Integrate content plugin, caption plugin, and playlist of the flowplayer project
* Youtube skin