lcFlowPlayerPlugin - 0.1.3

A flash player plugin.

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

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.

Third parties

The following libraries are embedded in this plugin:

  • FlowPlayer Open Source (GPL 3) video player for the Web
  • 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