Changeset 1070
- Timestamp:
- 05/25/10 19:18:02 (3 years ago)
- Location:
- trunk/fl5/doc
- Files:
-
- 9 added
- 3 edited
-
developers/buildingplugins.rst (modified) (2 diffs)
-
developers/pluginapi.rst (modified) (1 diff)
-
publishers/fmsdvr.rst (added)
-
publishers/images/fmsdvr (added)
-
publishers/images/fmsdvr/FMSDVR_1.png (added)
-
publishers/images/fmsdvr/FMSDVR_2.png (added)
-
publishers/images/fmsdvr/FMSDVR_3.png (added)
-
publishers/images/fmsdvr/FMSDVR_4.png (added)
-
publishers/images/fmsdvr/FMSDVR_5.png (added)
-
publishers/options.rst (modified) (5 diffs)
-
publishers/releasenotes.rst (added)
-
publishers/startup.rst (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/fl5/doc/developers/buildingplugins.rst
r1069 r1070 13 13 14 14 15 .. code-block:: javascript15 .. code-block:: html 16 16 17 17 <script type="text/javascript"> … … 178 178 Basic configuration parameters for a specific plugin can be loaded through the same flashvars mechanism the player uses itself. Variables for a specific plugin must be prepended with the name of the plugin and a dot. So if your plugin is called *delicious*, your variable names must start with the *delicious.* string. Example: 179 179 180 .. code-block:: javascript180 .. code-block:: html 181 181 182 182 <script type="text/javascript"> -
trunk/fl5/doc/developers/pluginapi.rst
r1069 r1070 1 1 .. _pluginapi: 2 2 3 Plugin API 4 ========== 3 ======================= 4 Actionscript Plugin API 5 ======================= 5 6 6 This is about the plugin API 7 JW Player 5 supports a flexible API for :ref:`plugins <buildingplugins>`, that can be written in `actionscript <http://en.wikipedia.org/wiki/ActionScript>`_. It is possible to read the config/playlist variables of the player, call player functions, and listen for :ref:`Flash Events <pluginevents>`. 8 9 Version 5 also supports a :ref:`JavaScript API <javascriptapi>`, and it can load `Version 4 plugins <http://developer.longtailvideo.com/trac/wiki/Player4Api>`_ as well. 10 11 Initialization 12 ============== 13 14 All plugins have to define a function called *initPlugin(player, config)*. This function will be called by the player when it is :ref:`initialized <startup>` . A reference to the `Player <http://developer.longtailvideo.com/trac/browser/trunk/fl5/src/com/longtailvideo/jwplayer/player/IPlayer.as>`_ is passed to this function, so the plugin can instantly read the config/playlist, call player functions and assign event listeners. A `PluginConfig <http://developer.longtailvideo.com/trac/browser/trunk/fl5/src/com/longtailvideo/jwplayer/plugin/PluginConfig.as>`_ object, which contains plugin-specific configuration parameters, is passed in as an argument to *initPlugin* as well. 15 16 Plugins also need to implement a *resize(width, height)* function and an *id* getter. Here is an example of a valid (but empty) plugin: 17 18 .. code-block:: actionscript 19 20 import com.longtailvideo.jwplayer.player.IPlayer; 21 import com.longtailvideo.jwplayer.plugins.PluginConfig; 22 23 public class MyPlugin extends Sprite implements IPlugin { 24 25 private static var myID:String = "myplugin"; 26 27 private var api:IPlayer; 28 private var config:PluginConfig; 29 30 public function initPlugin(player:IPlayer, conf:PluginConfig):void { 31 this.api = player; 32 this.config = conf; 33 } 34 35 public function get id():String { 36 return myID; 37 } 38 39 public function resize(width:Number, height:Number):void { 40 // Implement resizing if necessary 41 } 42 } 43 44 45 Reading variables 46 ================= 47 48 There are three variable calls you can make through the player API: 49 50 * **config** returns a `PlayerConfig <http://developer.longtailvideo.com/trac/browser/trunk/fl5/src/com/longtailvideo/jwplayer/model/PlayerConfig.as>`_ object with all of the :ref:`settings <options>` loaded into the player. 51 * **playlist** returns a `Playlist <http://developer.longtailvideo.com/trac/browser/trunk/fl5/src/com/longtailvideo/jwplayer/model/Playlist.as>`_ object containing all of its `PlaylistItems <http://developer.longtailvideo.com/trac/browser/trunk/fl5/src/com/longtailvideo/jwplayer/model/PlaylistItem.as>`_. For a single file, the list will have only one entry. 52 * **config.pluginConfig(name)** returns a `PluginConfig <http://developer.longtailvideo.com/trac/browser/trunk/fl5/src/com/longtailvideo/jwplayer/plugins/PluginConfig.as>`_ object with all the flashvars for a particular plugin (for example the included *controlbar* or the externally loaded *yousearch*). Additionally, every plugin config will contain an *x*, *y*, *width*,*height* and *visible* variable that pertain to its positioning. 53 54 Here are three calls to the player which illustrate reading variables from the player API 55 56 .. code-block:: actionscript 57 58 // See what the repeat flashvar was configured to 59 var repeat:String = player.config.repeat 60 // The title of the second playlist item 61 var title:String = player.playlist.getItemAt(1).title; 62 // The current width of the controlbar 63 var barWidth:Number = player.pluginConfig('controlbar')['width']; 64 65 66 Player commands 67 =============== 68 69 The ActionScript API exposes the following player commands: 70 71 * fullscreen(state:Boolean) 72 * load(item:*) 73 * mute(state:Boolean) 74 * pause() 75 * play() 76 * playlistItem(i:Number) 77 * playlistNext() 78 * playlistPrev() 79 * redraw() 80 * seek(pos:Number) 81 * stop() 82 * volume(vol:Number) 83 84 Here are some examples of how to call these functions: 85 86 .. code-block:: actionscript 87 88 // Mute the player 89 player.mute(true); 90 // Load a new video into the player 91 player.load("http://www.mysite.com/mycoolvideo.mp4"); 92 93 94 Setting listeners 95 ================= 96 97 Any of the events described in the :ref:`Player Events <pluginevents>` page can be listened for using the Flash Event model. To listen for a player event, simply call the *addEventListener()* function on the player API. 98 99 An example: 100 101 .. code-block:: actionscript 102 103 import com.longtailvideo.jwplayer.events.*; 104 105 private function muteTracker(evt:MediaEvent) { 106 trace('the new mute state is: '+evt.mute); 107 } 108 109 player.addEventListener(MediaEvent.JWPLAYER_MEDIA_MUTE, muteTracker); 110 111 112 And an example removal call: 113 114 .. code-block:: actionscript 115 116 player.removeEventListener(MediaEvent.JWPLAYER_MEDIA_MUTE, muteTracker); 117 118 .. note:: Your plugin will need to include the `com.longtailvideo.jwplayer.events package <http://developer.longtailvideo.com/trac/browser/trunk/fl5/src/com/longtailvideo/jwplayer/events/>`_ in order to avoid compilation errors. 119 120 121 Player Controls 122 =============== 123 124 The player contains several built-in user controls, which have their own APIs. For example: 125 126 * The **controlbar** offers an *addButton()* call, used to insert a custom button in the controlbar. 127 * The **dock** offers an *addButton()* call, used to insert a custom button in the dock. 128 129 Here's example code that tries to insert a button in the dock and then in the controlbar: 130 131 .. code-block:: actionscript 132 133 var api:IPlayer; 134 var icon:DisplayObject; 135 136 function clickHandler(evt:MouseEvent):void { 137 trace('Demo button clicked!'); 138 } 139 140 function initPlugin(player:IPlayer, conf:PluginConfig):void { 141 api = player; 142 if(api.config.dock) { 143 api.controls.dock.addButton(icon, "Click here", clickHandler); 144 } else { 145 api.controls.controlbar.addButton(icon, "Click here", clickHandler); 146 } 147 } -
trunk/fl5/doc/publishers/options.rst
r1069 r1070 16 16 17 17 So if, fore example, your *file* flashvar is at the location *getplaylist.php?id=123&type=flv*, you must set the file flashvar to *getplaylist.php%3Fid%3D123%26type%3Dflv*. 18 19 .. _options-playlist: 18 20 19 21 Playlist properties … … 47 49 In addition to these default **providers**, the player has specific support for certain streaming servers or CDNs. A full list of mediafile types can be found on the :ref:`supported filetypes <mediaformats>` page. 48 50 51 .. _options-layout: 52 49 53 Layout 50 54 ====== … … 52 56 These flashvars control the look and layout of the player. 53 57 54 * **backcolor** (*undefined*): background color of the controlbar and playlist. This is white with the default skin.55 58 * **controlbar** (*bottom*): position of the controlbar. Can be set to *bottom*, *over* and *none*. 56 59 * **dock** (*false*): set this to *true* to show the dock with large buttons in the top right of the player. Available since 4.5. 57 * **frontcolor** (*undefined*): color of all icons and texts in the controlbar and playlist.58 60 * **height** (*400*): height of the display in pixels. 59 61 * **icons** (*true*): set this to *false* to hide the play button and buffering icon in the middle of the video. Available since 4.2. 60 * **lightcolor** (*undefined*): color of an icon or text when you rollover it with the mouse.61 62 * **logo.file** (*undefined*): location of an external jpg, png or gif image which replaces the watermark image (**Licensed players only**) 62 63 * **logo.link** (*undefined*): link to direct to when the watermark image is clicked on (**Licensed players only**) … … 66 67 * **playlistsize** (*180*): when *below* this refers to the height, when *right* this refers to the width of the playlist. 67 68 * **skin** (*undefined*): location of a [wiki:Player5Skinning skin file] containing the player graphics. The [/browser SVN repository] contains [browser:skins a couple of example skins]. 68 * **screencolor** (*undefined*): background color of the display69 69 * **width** (*280*): width of the display in pixels. 70 70 71 The four color flashvars must be entered using hexadecimal values, as is common for [http://en.wikipedia.org/wiki/Web_colors#Hex_triplet web colors] (e.g. *FFCC00* for bright yellow). They are not supported by [wiki:Player5Skinning bitmap skins]. 71 .. _options-colors: 72 73 Colors 74 ====== 75 76 These flashvars are available when using 4.x (SWF) skins. They will be deprecated once SWF skinning support is dropped in a future release. 77 78 * **backcolor** (*undefined*): background color of the controlbar and playlist. This is white with the default skin. 79 * **frontcolor** (*undefined*): color of all icons and texts in the controlbar and playlist. 80 * **lightcolor** (*undefined*): color of an icon or text when you rollover it with the mouse. 81 * **screencolor** (*undefined*): background color of the display 82 83 The four color flashvars must be entered using hexadecimal values, as is common for [http://en.wikipedia.org/wiki/Web_colors#Hex_triplet web colors] (e.g. *FFCC00* for bright yellow). 84 85 .. _options-behavior: 72 86 73 87 Behavior … … 100 114 * **id** (*undefined*): This flashvar is necessary for javascript interaction on linux platforms.. It should be set to the id of the player's DOM element. 101 115 102 The former flashvars, **client**, **id** and **version** are sent as parameters with every [wiki:Player5Events event the player broadcasts]. 116 .. _options-config-xml: 103 117 104 118 Config XML
Note: See TracChangeset
for help on using the changeset viewer.
