FLV Playback and Seekbar on different native windows in one Air application
hello everyone. i'm trying make simple video playback air application utilizes initial native window house transport control seekbar on it. once application launches, creates second (new) window on second screen , places flvplayback instance on new window. works want except 1 thing. when seekbar , flvplayback instance not located on same window stage, seekbar handle sticks mouse when trying scrub through video.
i've added both transport control , flvplayback instance original native window children , have added both of them new window children , works fine. it's when separated , located on different stages seekbar acts up. when on same stage, can click on point on seekbar , video jumps spot , continues play , can scrub seekbar, video updates scrub, , when release mouse, seekbar handle stays released mouse. when on separate stages, seekbar handle continues follow mouse movement without releasing it. video updates seekbar handle moved due sticking mouse, if release mouse, handle still moving mouse , video still being scrubbed. said, works great except , have reached limit time spent on issue. have insight this?
here's code project. first air application, coding learning, please kind.
import fl.video.*; import flash.display.*; import flash.desktop.*; import flash.events.*; import fl.video.metadataevent; import flash.geom.*; import flash.ui.mouse; import flash.text.*; /**************************************\ global setup \**************************************/ var flvcontrol:flvplayback; var masterwindow = stage.nativewindow; var screen1:screen = screen.screens[0]; var screen2:screen = screen.screens[1]; /**************************************\ master window setup \**************************************/ this.loaderinfo.addeventlistener(event.complete,maximize); transcontrol.playpausebutt2.addeventlistener(mouseevent.click, playbutton); if (screen.screens.length > 1){ createvideobkg(); createvideoplayer(); } /**************************************\ general functions \**************************************/ //maximize initial screen function maximize(e:event) { masterwindow.x = screen1.bounds.left masterwindow.maximize(); masterwindow.stage.scalemode = stagescalemode.exact_fit; } //hide mouse behind video window on roll-over function mouserollover(e:mouseevent):void { mouse.hide() } function mouserollout(e:mouseevent):void { mouse.show() } //play-pause button control function playbutton(event:mouseevent):void { if(transcontrol.playpausebutt2.currentframe==1 ){ transcontrol.playpausebutt2.gotoandplay(2); flvcontrol.play(); } else { transcontrol.playpausebutt2.gotoandplay(1); flvcontrol.pause(); } } /* function closewindow(e:mouseevent):void { nativeapplication.nativeapplication.openedwindows[2].close(); } */ /**************************************\ video bkg setup \**************************************/ function createvideobkg(e:event = null):void{ var newoptions:nativewindowinitoptions = new nativewindowinitoptions(); newoptions.type = nativewindowtype.lightweight; newoptions.systemchrome = nativewindowsystemchrome.none; newoptions.transparent = true; var videobkg:nativewindow = new nativewindow(newoptions); if (screen.screens.length > 1){ videobkg.x = screen2.bounds.left; } videobkg.maximize(); chromesetup(videobkg); videobkg.activate(); } //video bkg chrome setup function chromesetup(currentwindow):void { var vidbkg = new video_bkg(); vidbkg.name = "video_bkg2"; vidbkg.addeventlistener(mouseevent.roll_over, mouserollover); vidbkg.addeventlistener(mouseevent.roll_out, mouserollout); currentwindow.stage.addchild(vidbkg); } /**************************************\ video player setup \**************************************/ function createvideoplayer(e:event = null):void{ var newoptions:nativewindowinitoptions = new nativewindowinitoptions(); newoptions.type = nativewindowtype.lightweight; newoptions.systemchrome = nativewindowsystemchrome.none; newoptions.transparent = true; var videoplayer:nativewindow = new nativewindow(newoptions); if (screen.screens.length > 1){ videoplayer.x = screen2.bounds.left; videoplayer.y = screen2.bounds.top; videoplayer.width = screen2.bounds.width; videoplayer.height = screen2.bounds.height; videoplayer.stage.scalemode = stagescalemode.no_scale; } videoplayer.alwaysinfront = true; var dvr = new dvr_player(); dvr.name = "dvr"; dvr.x = 0; dvr.y = 0; dvr.addeventlistener(mouseevent.roll_over, mouserollover); dvr.addeventlistener(mouseevent.roll_out, mouserollout); videoplayer.stage.addchild(dvr); flvcontrol = dvr.display2; flvcontrol.width = 1280; flvcontrol.height = 720; flvcontrol.skin = null; flvcontrol.autoplay=false; flvcontrol.islive=false; flvcontrol.fullscreentakeover = false; flvcontrol.align = videoalign.center; flvcontrol.scalemode = videoscalemode.no_scale; flvcontrol.source = "olympics.f4v"; flvcontrol.seekbar = transcontrol.seekbarcontainer2.seeker; videoplayer.activate(); }
does have ideas this?
More discussions in ActionScript 3
adobe
Comments
Post a Comment