Changeset 1344


Ignore:
Timestamp:
09/29/10 18:33:09 (3 years ago)
Author:
pablo
Message:

Updates to the documentation

Location:
trunk/fl5/doc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/fl5/doc/publishers/embedding.rst

    r1342 r1344  
    179179        <video class="jwplayer" src="/uploads/video.mp4" poster="/uploads/image.jpg"></video> 
    180180 
    181 That's it!  As long as you have everything in the right place, the <video> tag will be replaced on your page by the JW Player. 
     181That's it!  As long as you have everything in the right place, all <video> tags on your page whose class is **jwplayer** will be replaced on your page by the JW Player. 
    182182 
    183183 
     
    446446    </script> 
    447447 
    448 See the :ref:`API reference <api>` for a full overview of all events and their properties. 
     448See the :ref:`API reference <javascriptapi>` for a full overview of all events and their properties. 
    449449 
    450450.. _embed_players: 
  • trunk/fl5/doc/publishers/javascriptapi.rst

    r1342 r1344  
    1212--------------- 
    1313 
    14 To get a sense of the possibilities, here's a quick example that showcases how to control the player from the page: 
     14First, you'll need to upload the API library (*jwplayer.js*) to your web server.  We recommend putting it, along with *player.swf*, in a folder called **jwplayer** in the root of your site.  Once it's on your web server, add this bit of code to your HTML pages, in the *<head>* of your page: 
     15 
     16.. code-block:: html 
     17 
     18        <head> 
     19                <script type="text/javascript" src="/jwplayer/jwplayer.js"></script> 
     20        </head> 
     21 
     22To get a sense of the possibilities of what you can do with the API, here's a quick example that showcases how to control the player from the page: 
    1523 
    1624.. code-block:: html 
     
    2028    <script type="text/javascript"> 
    2129        jwplayer("container").setup({ 
    22             flashplayer: "/jwplayer/jwplayer.swf", 
     30            flashplayer: "/jwplayer/player.swf", 
    2331            file: "/uploads/video.mp4", 
    2432            height: 270, 
     
    4048    <script type="text/javascript"> 
    4149        jwplayer("container").setup({ 
    42             flashplayer: "/jwplayer/jwplayer.swf", 
     50            flashplayer: "/jwplayer/player.swf", 
    4351            file: "/uploads/video.mp4", 
    4452            height: 270, 
     
    6169* Listen to events from a player. 
    6270 
     71Embedding with SWFObject 
     72++++++++++++++++++++++++ 
     73 
     74If you embed the player using SWFObject, rather than the built-in *setup()* function, you can still use the JavaScript API, although you'll need to wait for Flash to be loaded on the page before interacting with the API.  SWFObject 2.2 includes a callback function (in this example, named **flashLoaded**) which is executed when SWFObject has finished embedding Flash into the page.  Make sure you wait until this function is called before making any calls to the API. 
     75 
     76Here's a simple example of using the `SWFObject callback <http://code.google.com/p/swfobject/wiki/api>`_: 
     77 
     78.. code-block:: javascript 
     79 
     80        var flashvars = { file:"/videos/video.mp4" }; 
     81        var params = { allowfullscreen:"true", allowscriptaccess:"always" }; 
     82        var attributes = { id:"player", name:"player" }; 
     83         
     84        swfobject.embedSWF("/jwplayer/player.swf", "container", 320, 240, "9.0.115", "false",  
     85            flashvars, params, attributes, flashLoaded); 
     86 
     87        function flashLoaded(e) { 
     88                // e.ref is a reference to the Flash object.  We'll pass it to jwplayer() so the API knows where the player is. 
     89          
     90            // Add event listeners 
     91            jwplayer(e.ref).onReady(function() { alert("Player is ready"); }); 
     92            jwplayer(e.ref).onPlay(function() { alert("Player is playing"); }); 
     93 
     94            // Interact with the player 
     95            jwplayer(e.ref).play(); 
     96        } 
     97 
     98Embedding with an <object> or <embed> tag 
     99+++++++++++++++++++++++++++++++++++++++++ 
     100 
     101If you embed the player directly using an *<object>* or *<embed>* tag, simply pass your tag's id to the API when referencing the player: 
     102 
     103.. code-block:: html 
     104 
     105        <embed 
     106          id="player" 
     107          name="player" 
     108          src="/jwplayer/player.swf" 
     109          width="320" 
     110          height="240" 
     111          allowscriptaccess="always" 
     112          allowfullscreen="true" 
     113          flashvars="file=/videos/video.mp4" 
     114        /> 
     115         
     116        <script type="text/javascript"> 
     117            jwplayer("player").onReady(function() { alert("Player is ready"); }); 
     118            jwplayer("player").onPlay(function() { alert("Player is playing"); }); 
     119            jwplayer("player").play(); 
     120        </script> 
    63121 
    64122Selecting 
     
    75133Only when you have multiple players on a page, you need to be more specific on which player you want to interact with. In that case, there are three ways to select a player: 
    76134 
    77 * With the *id* of the element you :ref:`instantiated <embed>` the player over: 
     135* With the *id* of the element you :ref:`instantiated <embedding>` the player over: 
    78136     
    79137    .. code-block:: javascript 
     
    280338    ); 
    281339 
    282 Note that our :ref:`official embed method <embed>` contains a shortcut for assigning event listeners, directly in the embed code: 
     340Note that our :ref:`official embed method <embedding>` contains a shortcut for assigning event listeners, directly in the embed code: 
    283341 
    284342.. code-block:: html 
     
    288346    <script type="text/javascript"> 
    289347        jwplayer("container").setup({ 
    290             flashplayer: "/jwplayer/jwplayer.swf", 
     348            flashplayer: "/jwplayer/player.swf", 
    291349            file: "/uploads/video.mp4", 
    292350            height: 270, 
  • trunk/fl5/doc/publishers/releasenotes.rst

    r1343 r1344  
    88=========== 
    99 
    10 Build 1257 
     10Build 1341 
    1111---------- 
    1212 
     
    1414++++++++++++ 
    1515 
    16 * Included framedrop handling for both HTTP and RTMP streaming, allowing switches in case of insufficient client resources (e.g. a netbook attempting to play an HD stream. 
     16* Included framedrop handling for both HTTP and RTMP streaming, allowing switches in case of insufficient client resources (e.g. a netbook attempting to play an HD stream.) 
    1717* Automatic fallback to Tunneled RTMP / RTMPe (in case regular RTMP is blocked). 
    1818* RTMP dynamic streaming can now be setup together with loadbalancing (using a SMIL XML file). 
     
    3131* Fixed a bug that caused the duration textfield of a playlistitem would not be placed to the right. 
    3232* Fixed a bug that caused PNG skin playlists not to show the item.png on rollout if there was no itemActive. 
     33* Fixed a bug that prevented the thumbnail image to be displayed while playing audio-only RTMP streams or AAC files 
     34* Fixed a bug that interfered with URL-encoded URIs 
     35* Fixed audio file handling for live mp3 streams and other servers without content-length headers 
     36* Fixed a bug in event ordering for the JavaScript API 
     37* Fixed an issue preventing the controlbar buffer indicator from being displayed until after buffering was complete 
     38* Fixed an intermittent issue with YouTube videos being cut off before the video is complete 
     39 
     40A full changelog of Flash player updates can be found `here <http://developer.longtailvideo.com/trac/query?status=assigned&status=closed&status=new&status=reopened&group=type&order=type&col=id&col=summary&milestone=Flash+5.3&resolution=fixed>`_ 
     41 
    3342 
    3443HTML5 Beta Player Integration 
Note: See TracChangeset for help on using the changeset viewer.