Skip navigation
Currently Being Moderated

Javascript API and Player Control

Nov 29, 2010 4:37 PM

Spent hours the last few days digging through the forums, documentation, and WIKI to see if I could find some answers.  Unofrtunately, thus far, the data is sparse.  Can somebody direct me to some documentation on the Javascript API and what events ara available to control the player?  For example, how do I send the player an event to "mute" the volume?  Or, how do I send the player an event to "seek" to a point in time in the video?  Or, how do I "listen" for a point in time in the video and then use javascript to do something else (like play another clip).

 

I have found some very sparse information on the use of JQuery, but, we do not use that (at least, not yet).  Simple javascript through an API is ideal.  Any help would be greatly appreciated.

 
Replies
  • Currently Being Moderated
    Nov 29, 2010 5:34 PM   in reply to MR_FASTH

    Hi,

     

    The JavaScript API in Strobe Media Playback is exploratory. It will likely change in future releases.

     

    The best 'documentation' we have is our samples. You can find the samples in the html-template directory if you download the source zip. You can also check the source code of the live samples: http://osmf.org/dev/1.5gm/

     

    The simplest sample is this one:

    http://osmf.org/dev/1.5gm/hello-world-javascript.html

     

    As you'll see in the source code, you'll need to pass the name to a JavaScript callback function which we'll handle all the player state changes.

     

    For calling a method in the StrobeMediaPlayback embedded player, you need to call one of the MediaPlayer public APIs methods:

     

    player = document.getElementById(playerId);

    player.mute();

    player.seek(100);

     

    Note that play got renamed to play2() - because of some security restrictions in IE.

     

    You can also access the public properties in MediaPlayer, by calling a getter or setter function:

    var state = player.getState();

    player.setVolume(0.5);

     

    In future we'll probably explore more around the approach we currently have used inside the jQuery plug-in, so if you have more time, I'll recommend you take a closer look at that implementation.

     

    Sorry for not documenting this - we'll catch up on this as we get closer to a stable implementation.

     

    -Andrian

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 29, 2010 5:44 PM   in reply to MR_FASTH

    You can also check this slightly outdated wiki page: http://sourceforge.net/adobe/smp/wiki/JavaScript%20API/

     

    Or my presentation for some context around the jQuery plugin: http://experts.na3.acrobat.com/p41481809/

     

    Again, I promise we'll get proper docs up once we get to a stable API.

     

    -Andrian

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 29, 2010 5:59 PM   in reply to MR_FASTH

    Hi,

     

    Only 1.5 has the JavaScript API enabled.

     

    -Andrian

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 29, 2010 7:46 PM   in reply to MR_FASTH

    Hi,

     

    The only difference that might impact the speed at which you migrate to 1.5 is related to the configuration architectural changes. If you didn't add additional configuration settings you should not be impacted.

     

    Otherwise, the other new features are additions on top of the 1.0 codebase.

     

    -Andrian

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 30, 2010 11:31 AM   in reply to MR_FASTH

    Hi MR_FASTH,

     

    In Strobe Media Playback 1.0 we don't expose the JavaScript API at all. You won't be able to interact with the player or register events with the player unless you update your player to the latest, 1.5 version.


    Does this answer your question?

     

    -Andrian

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 13, 2012 5:48 AM   in reply to Andrian Cucu

    I m not able to access this.

    http://sourceforge.net/adobe/smp/wiki/JavaScript%20API/

     

    Can you please help me.

     

    Thanks & Regards

         Vishal Lad

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 13, 2012 5:55 AM   in reply to Vishal Lad
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points