adobe - Strobe Media Playback (OSMF) events -
does know if strobe media playback (osmf) has events like:
streaming ended streaming started streaming errorin order access via javascript?
i have tried no joy.
<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>strobe media playback</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> <script type="text/javascript"> // create strobemediaplayback configuration // http://mediapm.edgesuite.net/strobe/content/test/afaerystale_sylviaapostol_640_500_short.flv // http://osmf.org/dev/1.6-sprint-2/hello-world-jquery-plugin.html# var parameters = { src: "http://stream.flowplayer.org/bauhaus/624x260.mp4" , autoplay: true , controlbarautohide: false , javascriptcallbackfunction: "onjavascriptbridgecreated" }; // embed player swf: swfobject.embedswf ( "strobemediaplayback.swf" , "strobemediaplayback" , 640 , 480 , "10.1.0" , {} , parameters , { allowfullscreen: "true"} , { name: "strobemediaplayback" } ); function completefunc(time, playerid) { //var player = document.getelementbyid(playerid); alert("!!!"); } function oncurrenttimechange(time, playerid) { document.getelementbyid("currenttime").innerhtml = time; } function ondurationchange(time, playerid) { document.getelementbyid("duration").innerhtml = time; } var player = null; function onjavascriptbridgecreated(playerid) { if (player == null) { player = document.getelementbyid(playerid); // add together event listeners update player.addeventlistener("currenttimechange", "oncurrenttimechange"); player.addeventlistener("durationchange", "ondurationchange"); player.addeventlistener("complete", "completefunc"); // pause/resume playback when click play/pause link document.getelementbyid("play-pause").onclick = function(){ var state = player.getstate(); if (state == "ready" || state == "paused") { player.play2(); } else if (state == "playing") { player.pause(); } homecoming false; }; } } </script> </head> <body> <div> <div> <span id="currenttime" /> ... </span> : <span id="duration" /> ... </span> </div> <a href="#" id="play-pause">play/pause</div> </div> <div id="strobemediaplayback"> <p>alternative content</p> </div> </body> </html>
thanks!
p.s. can see here can utilize state variable observe end of video. in end of video goes "paused". can utilize in manner?
update:
i found onjavascriptbridgecreated method doesn't triggering. same happens examples of smp.
any clue?
there is.
function changevidsrc(url, posterurl, id, width, height, autoplay) { var flashvars = { src: url, autoplay: autoplay, controlbarautohide: true, poster: posterurl, skin: 'skinpath', //i needed skin, remove if not needed javascriptcallbackfunction: "onjavascriptbridgecreated" }; var parameters = { allowfullscreen: "true"}; var attributes = { name: id }; // embed player swf: swfobject.embedswf ('/swfs/strobemediaplayback.swf', id, width, height, "10.1.0", '', flashvars, parameters, attributes ); }
some of import details: 1. couldn't allow debug firebug correctly. can't understand behaviour. 2. passing name
in attributes
object of import ff. otherwise callback triggers, no events handled advise set global var player
, handler functions on top.
events adobe osmf strobe-media-playback
No comments:
Post a Comment