actionscript 3 - FLV Playback AS3 Playlist Sequence -
help me please need as3 flvplayback component sequentially play 1 play list xml , repeated indefinitely, until moment got code, lets choose video want play not go next automatically stops...
i appreciate prompt help, greetings ecuador
as3 code:
var vlist:xml = new xml(); var xml_url:string = "vids.xml"; var vlisturl:urlrequest = new urlrequest(xml_url); var myloader:urlloader = new urlloader(vlisturl); myloader.addeventlistener(event.complete, xmlloaded); function xmlloaded(evtobj:event) { vlist = xml(myloader.data); (var i=0; i<vlist.vid.length(); i++) { vid_select.additem({label:vlist.vid[i].@desc, data:vlist.vid[i].@url}); } vlist.ignorewhitespace = true; vid.play(vid_select.getitemat(0).data); vid_select.selectedindex = 0; } var vidlist:object = new object(); function changehandler(event:event):void { vid.play(vid_select.getitemat(vid_select.selectedindex).data); } vid_select.addeventlistener(event.change, changehandler);
var vlist:xml = new xml(); var xml_url:string = "vids.xml"; var vlisturl:urlrequest = new urlrequest(xml_url); var myloader:urlloader = new urlloader(vlisturl); var currentvideo:int = 0; myloader.addeventlistener(event.complete, xmlloaded); function xmlloaded(evtobj:event) { vlist = xml(myloader.data); (var i=0; i<vlist.vid.length(); i++) { vid_select.additem({label:vlist.vid[i].@desc, data:vlist.vid[i].@url}); } vlist.ignorewhitespace = true; playvideo() } var vidlist:object = new object(); function videofinished(e:videoevent):void{ vid.removeeventlistener(videoevent.complete,videofinished); currentvideo++ playvideo() } function playvideo(){ vid.play(vid_select.getitemat(currentvideo % vlist.vid.length()).data); vid_select.selectedindex = currentvideo % vlist.vid.length(); vid.addeventlistener(videoevent.complete,videofinished); } function changehandler(event:event):void { currentvideo = vid_select.selectedindex; playvideo(); } vid_select.addeventlistener(event.change, changehandler);
Comments
Post a Comment