<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Video test</title> <script type="text/javascript" src="http://yui.yahooapis.com/3.1.1/build/yui/yui-min.js"></script> <script type="text/javascript" src="/js/videoplayer/swfobject.js"></script> </head> <body> <div id="videoplayer"></div> <div id="controls"> <input type="button" id="play" value="play"> <input type="button" id="pause" value="pause"> <input type="button" id="stop" value="stop"> </div> <div id="properties"> get: <input type="button" id="getduration" value="duration"> <input type="button" id="gettime" value="time"> <div id="info"></div> </div> <div id="set"> set: <input type="button" id="settime" value="time"> <input type="button" id="setplaytime" value="time and play"> <input type="button" id="load" value="load"> </div> <div id="listeners" style="height:300px; overflow:auto"> listeners: <ul id="state"></ul> </div> <script type="text/javascript"> YUI({ modules: { "video-player": { fullpath:"/js/videoplayer/videoplayer.js" } } }).use("node","event","widget","video-player",function(Y) { var video = { flash: [ "http://content3f.omroep.nl/255fe3abbaea31fe9f92e491287ded08/4c6e44a8/nos/content/broadcast/2010/08/20/laatstejournaalflash_2010-08-20_10_00_02.flv", "http://content1c.omroep.nl/2f359eea10d174263cc2979239f26ce7/4baa173c/nos/content/broadcast/2010/03/24/laatstejournaalflash_2010-03-24_14_00_01.flv" ], silverlight: [ "http://cgi.omroep.nl/cgi-bin/streams?/tv/kro/boerzoektvrouw/bb.20061112.asf", "http://cgi.omroep.nl/cgi-bin/streams?/tv/kro/boerzoektvrouw/bb.20061008.asf" ] }; src = video.flash; var videoPlayer = new Y.mazzle.VideoPlayer({ src:src[0], filepath:"/js/videoplayer/", width:320, height:240 }); videoPlayer.render('#videoplayer'); Y.one('#play').on("click", function(e) { videoPlayer.play(); }); Y.one('#pause').on("click", function(e) { videoPlayer.pause(); }); Y.one('#stop').on("click", function(e) { videoPlayer.stop(); }); Y.one('#gettime').on("click", function(e) { Y.one("#info").set("innerHTML", videoPlayer.getTime()); }); Y.one('#getduration').on("click", function(e) { Y.one("#info").set("innerHTML", videoPlayer.getDuration()); }); Y.one('#settime').on("click", function(e) { videoPlayer.setTime(10); }); Y.one('#setplaytime').on("click", function(e) { videoPlayer.setTime(10, true); }); Y.one('#load').on("click", function(e) { videoPlayer.loadVideo(src[1]); }); videoPlayer.on("stateChanged", function(e) { Y.one('#state').prepend('<li>state:'+e.newstate+'</li>'); }); }); </script> </body> </html>