Jump to content
Search Community

Search the Community

Showing results for tags 'VideoLoader'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Personal Website


Twitter


CodePen


Company Website


Location


Interests

  1. I am trying to user GS VideoLoader to display Instagram and Facebook videos in my flash based app. The Instagram videos works fine but the Facebook videos does not play. Only difference between these two are the query string parameters. Instagram API gives direct URL of a MP4 file but Facebook API's video URL is having some parameters. Both URL works fine in browser. Code I am using: var vidLoader = new VideoLoader($vidPath, { name:"myVideo", container:this, width:$w, height:$h, scaleMode:"proportionalInside", autoPlay:false, volume:volume, onComplete:completeHandler } ); addChild(vidLoader); Instagram video URL: https://scontent-sea1-1.cdninstagram.com/vp/945f605c15b3be6a5beaf6ee61f28100/5A694BF1/t50.2886-16/26823738_584341088575113_4622617487854733450_n.mp4 Facebook video URL: https://video.xx.fbcdn.net/v/t42.1790-2/22827721_182507558965846_5849474951521763328_n.mp4?efg=eyJybHIiOjMwMCwicmxhIjo5ODgsInZlbmNvZGVfdGFnIjoic3ZlX3NkIn0%3D&rl=300&vabr=100&oh=c12792fc60c28e57fa652eecea879218&oe=5A68879B
  2. Hello Yup thats right its back to the days of Flash for me. Flash and chocolate cookies: I'm using VideoLoader in a service class. Once the video loaded I wan to add the video tot he display list in a different class (It's a robotleg project). Now I guess I could in my service class create a container sprite and in my initialization include it without adding that container to stage and then once the video is loaded I pass that container as payload via my event to > mediator > to my Video view where I add it to stage. Or is there another way? I base this question on the fact that you usually include a container : //create a VideoLoader var video:VideoLoader = new VideoLoader("assets/video.flv", {name:"myVideo", container:this, width:400, height:300, scaleMode:"proportionalInside", bgColor:0x000000, autoPlay:false, volume:0, requireWithRoot:this.root, estimatedBytes:75000}); //start loading video.load(); Snoop, ".S"
  3. Hello. I've been searching for an answer to this problem but to no avail. I'm simply testing the LoaderMax and I haven't customized anything to fit my stage. I only want to load a video (flv file) and see that it plays. import com.greensock.*; import com.greensock.easing.*; import com.greensock.plugins.*; import com.greensock.loading.*; import com.greensock.loading.display.*; import com.greensock.events.LoaderEvent; ... var video:VideoLoader = new VideoLoader("flv/loader.flv", {name:"myVideo", container:this, width:400, height:300, scaleMode:"proportionalInside", bgColor:0x000000, autoPlay:false, volume:0, requireWithRoot:this.root, estimatedBytes:75000}); var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); queue.append( video ); queue.load(); I've imported all of these and used the code correctly as far as I know how to but it gives me the error Error on VideoLoader 'myVideo' (flv/loader.flv): NetStream.Play.StreamNotFound Edit: I have not put the flv in my Library, nor is it on the stage. Is that needed? I would like to load it from a location within the directory: flv/loader.flv
  4. Hi there and thx for support. Before creating a new topic I found this one http://greensock.com/forums/topic/6567-video-stop-between-loop/ but it's not exactly the same problem. I'm loading 4 different flvs (short time each between 1 and 2 minutes) using a LoaderMax that have to repeat indefinitly (until the user stop it of course). After a time videos stop repeating one after the other. They are well rewinded to 1st frame but seem to not be played again. If I wait a very long time (2h repeating) the 4 videos seem to become blocked on 1st frame. I first tried to declare repeat property as -1 like this : m_loader1 = new VideoLoader("flv1.flv", {name:"subCol", container:m_interface.subtileScreen, repeat:-1, width:590, height:350, autoPlay:false, visible:true }); m_loader2 = new VideoLoader("flv2.flv", {name:"subJoie", container:m_interface.subtileScreen, repeat:-1, width:590, height:350, autoPlay:false, visible:true }); m_loader3 = new VideoLoader("flv3.flv", {name:"subSur", container:m_interface.subtileScreen, repeat:-1, width:590, height:350, autoPlay:false, visible:true }); m_loader4 = new VideoLoader("flv4.flv", {name:"subTrist", container:m_interface.subtileScreen, repeat:-1, width:590, height:350, autoPlay:false, visible:true }); m_loader = new LoaderMax({name:"subtile"}); m_loader.append(m_loader1); m_loader.append(m_loader2); m_loader.append(m_loader3); m_loader.append(m_loader4); m_loader.load(); I also tried to comment repeat:-1 and handle myself play and complete events for each video like this : m_loader1.addEventListener(VideoLoader.VIDEO_PLAY, onVideo1Play); m_loader1.addEventListener(VideoLoader.VIDEO_COMPLETE, onVideo1End); private function onVideo1Play(event : LoaderEvent) : void { trace("[log] onVideo1Play " + event.currentTarget.name + " video time " + event.currentTarget.videoTime); } private function onVideo1End(event : LoaderEvent) : void { trace("[log] onVideo1End " + event.currentTarget.name + " video time " + event.currentTarget.videoTime); m_loader1.gotoVideoTime(0, true); } And same behaviour, onVideo1End is called that rewind video to 0s, but video is not played even if forceplay = true. However onVideo1Play is called after onVideo1End. I think I have something wrong... Could you help me please ? Best, laugre
  5. Hi, I have written a very basic class using the VideoLoader for a mobile application in AS3 (not Flex), and it works very well when I run it in the emulator. But, when I run it on the device, it fails with a NetStream.Play.Failed error. I am pretty new to video, any idea what could be wrong. The code, and a log of errors follows. package lib.view.student { import com.greensock.events.LoaderEvent; import com.greensock.loading.VideoLoader; import flash.display.Sprite; import flash.events.Event; import flash.utils.getTimer; public class VideoPlayerGS extends Sprite { private var _sourceURL:String; private var _video:VideoLoader; public function VideoPlayerGS(sourceURL:String) { super(); _sourceURL = sourceURL; trace('VIDEO URL', _sourceURL); addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler); } private function addedToStageHandler(event:Event) : void { _video = new VideoLoader(_sourceURL, {autoPlay: true, container: this, width: stage.fullScreenWidth, height: stage.fullScreenHeight, scaleMode: 'proportionalInside', hAlign: 'center', vAlign: 'center', bgColor: 0x000000, onOpen: onOpenHandler, onInit: onInitHandler, onProgress: onProgressHandler, onComplete: onCompleteHandler, onCancel: onCancelHandler, onError: onErrorHandler, onFail: onFailHandler, onIOError: onIOErrorHandler }); _video.load(); } private function onOpenHandler(event:LoaderEvent) : void { trace('LoaderEvent', event.type, event.text, getTimer()); } private function onInitHandler(event:Event) : void { trace('InitEvent', event.type, getTimer()); } private function onProgressHandler(event:LoaderEvent) : void { //trace('ProgressEvent', event.toString(), getTimer()); } private function onCompleteHandler(event:LoaderEvent) : void { trace('CompleteEvent', event.type, event.text, getTimer()); } private function onCancelHandler(event:LoaderEvent) : void { trace('CancelEvent', event.type, event.text, getTimer()); } private function onErrorHandler(event:LoaderEvent) : void { trace('ErrorEvent', event.type, event.text, getTimer()); } private function onFailHandler(event:LoaderEvent) : void { trace('FailEvent', event.type, event.text, getTimer()); } private function onIOErrorHandler(event:LoaderEvent) : void { trace('IOErrorEvent', event.type, event.text, getTimer()); } } } The console output is as follows: [trace] VIDEO URL http://s3.amazonaws.com/ecs.media.us/Vickie_Weaving_sm.f4v [trace] LoaderEvent open 2514 [trace] InitEvent init 2952 [trace] ---- [trace] Error on VideoLoader 'loader0' (http://s3.amazonaws.com/ecs.media.us/Vickie_Weaving_sm.f4v): NetStream.Play.Failed [trace] ---- [trace] ErrorEvent error VideoLoader 'loader0' (http://s3.amazonaws.com/ecs.media.us/Vickie_Weaving_sm.f4v) > NetStream.Play.Failed 2979 [trace] FailEvent fail VideoLoader 'loader0' (http://s3.amazonaws.com/ecs.media.us/Vickie_Weaving_sm.f4v) > NetStream.Play.Failed 2980 [trace] CancelEvent cancel 2980
  6. Thank you in advance for reading. In my Player, I preLoad videos with two VideoLoader circularly from Flash Media Server. Init code as: videoLoader = new VideoLoader("flv:Y/sample", { autoPlay:true, x:150,y:200,netStream:_ns,container:this,width:200,height:150} ); videoLoader1 = new VideoLoader("flv:Y/bikes", { autoPlay:false, netStream:_ns1,container:this,width:200,height:150} ); The first loader loads a video with autoPlay=true,the second loader loads another video with autoPlay=false. When the first loader play complete, I call the second loader playVideo(). Meanwhile, let the first loader do the followings: videoLoader.unload(); videoLoader.vars.autoPlay = false; videoLoader.url = "mp4:Y/mp4.mp4"; videoLoader.load(); But two problems bother me a lot: 1.After one play circulation, the loaders return videoTime always 0. Do i have to create a new NetStream and pass it to the loader everytime? 2.Playing a .flv video preloaded would only see first few frames ,and then quickly to the end. Playing a .mp4 video preloaded was normal. I debugged into the VideoLoader's source code, _forceTime was 0. The comment says waitForRender,but how can I let the NetStream dispatch RENDER Event? Plz help!
  7. Hey all, I've problem with videoloader when I want to load bunch of video (each video size 2,30 mb and I have 25 videos its total size is 60 mb) I'dont know what problem is. Here is code below. Please take a look at and tell me what I'm doing wrong: package { import com.greensock.TweenMax; import com.greensock.loading.VideoLoader; import com.greensock.loading.LoaderMax; import com.greensock.events.LoaderEvent; import com.greensock.loading.XMLLoader; import com.greensock.loading.SWFLoader; import flash.display.DisplayObject; import flash.display.MovieClip; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; import flash.system.LoaderContext; import videos.QueueVideoLoader; [SWF(frameRate=30, width=1366, height=768)] public class Preloader extends MovieClip { LoaderMax.activate([SWFLoader, XMLLoader, VideoLoader]); private var loadermax:LoaderMax; private var videosArray:Array; private var queue:LoaderMax; private var libAssets:PreloaderClass; private var loaderContext:LoaderContext; public function Preloader() { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; loaderContext = new LoaderContext(); loaderContext.checkPolicyFile = false; LoaderMax.defaultContext = loaderContext; videosArray = []; loadermax = new LoaderMax({name:"mainQueue", auditSize:false , onProgress:progressHandler,onComplete:completeHandler,onError:errorHandler}); loadermax.append(new XMLLoader("assets/xml/data.xml",{ name: "video_xmldata"})); loadermax.append(new SWFLoader("GolKacti.swf", { name:"content_swf" })); loadermax.load(); } private function completeHandler(event:LoaderEvent):void { queue = LoaderMax.getLoader("videoListLoader"); queue.vars = { auditSize:false }; videosArray = queue.getChildren(); queue.load(true); queue.addEventListener(LoaderEvent.PROGRESS, onVideoProgress); QueueVideoLoader.videoData = videosArray; } private function onVideoProgress(event:LoaderEvent):void { if(event.target.progress == 1) addChild(LoaderMax.getContent("content_swf")); } private function progressHandler(event:LoaderEvent):void { trace("progress"); if(Number(event.target.progress)==1) { // addChild(LoaderMax.getContent("content_swf")); } } private function errorHandler(event:LoaderMax):void { trace("hata"); } } }
  8. Hi, I am striking a security error when trying to draw bitmapdata from a videoloader. This might be more a Flashplayer question but would like to know how to fix when using VideoLoader. Any help appreciated! Crossdomain policy file: <cross-domain-policy> <site-control permitted-cross-domain-policies="all"/> <allow-access-from domain="*" secure="false"/> <allow-http-request-headers-from domain="*" headers="*" secure="false"/> </cross-domain-policy> Loader: masterLoader.append( new VideoLoader(aryStringPath, {name:aryStringPath, container:videocontainer.videos, width:VIDEO_HI_WIDTH, height:VIDEO_HI_HEIGHT, autoPlay:false, visible:false, scaleMode:"proportionalOutside", checkPolicyFile:true}) ); Complete: I then wait for the complete event. VideoLoader.VIDEO_COMPLETE Bitmap Draw: I then attempt to draw from the parent container. bmDataLeft.draw(videocontainer, new Matrix(1, 0, 0, 1, 0, 0)); Security Error: SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: www.domain.com/swf.swf cannot access unknown URL. No policy files granted access. at flash.display::BitmapData/draw() at com.packagename::WaterRippler/drawBitmaps() at com.packagename::WaterRippler/setupRipples() at com.packagename::VideoContainer/onVideoComplete() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at com.greensock.loading::VideoLoader/_statusHandler() Things I have tried/checked: - policy file - completely open as above and in the root. Using a dedbugging proxy I can tell it loads correctly on page load. - added checkPolicyFile:true to loader params - video file is an FLV pulling from a static server (not streaming) - there is no DRM on the FLV's, they are produced by ourselves and hosted on our own server If you have any ideas please let me know! Thanks for your help.
  9. Hi guys, I was wondering if is possible use the LoaderMax to load a video, than get this content and send it to a another video player, like the FLV Playback from flash. How can I do that? It's possible? Tnx a lot
  10. Hey there I'm using video loader to load a video. While this is happening, I have some other image covering the screen. I add the video to the stage, I wait until the load is complete, autoplay is false, buffertime is huge. When loading is complete, I start playing and hide the cover image. My problem is that I see a white screen for a few milliseconds before the video appears. onComplete() :void { coverScreen.visible = false; video.playVideo(); } I tried to mitigate this problem by moving the oncomplete code to some cuepoint at the beginning of the video, but the cuepoint needs to be at time > 0.5 seconds before the problem goes away. this is too long. When can I guarantee that the video will be visible? what event should I be listening to? VideoLoader.PLAY doesn't seem to do the trick. thanks.
  11. hi friends! I´m fighting with embed a VideoLoader without using loaderMax into flex. Dou you know any site with an example? video = new VideoLoader(..... this. addChild(video) ¿? Best regards, Jose Ramon Leon Somovilla
  12. Hi there, I'm trying to add cuepoints to a video at runtime to display subtitles. I'm using a loop to get my cuepoints from XML and add them using the addASCuePoint method. But for some reason only the first 2 cuepoints seem to be displaying. Here is my for loop: for (var i:int = 0; i < subtitlesXml.cuePoint.length(); i++) { cuepointStart = subtitlesXml.cuePoint.attribute("substart"); cuepointEnd = subtitlesXml.cuePoint.attribute("subend"); subtitles = subtitlesXml.cuePoint.subtitle; videoLoader.addASCuePoint(cuepointStart, "substart " + i, {id:i}); videoLoader.addASCuePoint(cuepointEnd, "subend"); trace(cuepointStart + " " + cuepointEnd + " " + subtitles); } and here is my cuepoint listener: private function cuePointHandler(e:LoaderEvent):void { trace(e.data.name); if(e.data.name == "substart") { subTextField.text = subtitles[e.data.parameters.id]; } else if(e.data.name == "subend") { subTextField.text = ""; } else if(e.data.name == "break") { fadeOutVideo(); } } And here is my XML: <subtitles> <cuePoint id="0" substart="7.0" subend="11.0"> <subtitle><![CDATA[subtitle 1]></subtitle> </cuePoint> <cuePoint id="1" substart="16.0" subend="21.0"> <subtitle><![CDATA[subtitle 2]]></subtitle> </cuePoint> <cuePoint id="2" substart="22:0" subend="24:0"> <subtitle><![CDATA[subtitle 3]]></subtitle> </cuePoint> <cuePoint id="3" substart="26:0" subend="30:0"> <subtitle><![CDATA[subtitle 4]]></subtitle> </cuePoint> <cuePoint id="4" substart="31:0" subend="35:0"> <subtitle><![CDATA[subtitle 5]]></subtitle> </cuePoint> <cuePoint id="5" substart="36:0" subend="39:0"> <subtitle><![CDATA[subtitle 6]]></subtitle> </cuePoint> Any help would be appreciated. Cheers Gareth
  13. var videoLoaderSettings:VideoLoaderVars = new VideoLoaderVars() .autoPlay(true) .width(500) .height(400); _videoLoader = new VideoLoader( _url, videoLoaderSettings ); _videoLoader .stageVideo = stage.stageVideos[0]; _videoLoader .load(true); Normal video works perfect, but adding the stageVideo object does results in an invisible video, though it plays fine (I can hear the sound, and scrub etc.). Switching to native netconnection/netstream/video code, stageVideo works just fine. Any idea on what I am doing wrong with VideoLoader?
  14. Hi, I am building a Flash piece that contains a lot of video. I have been experimenting with both the Flash FLVPlayback component and the Greensock VideoLoader. I have been trying to simulate a slow internet connection by uploading my flash video to a server. Then I open the Flash video file in my browser and disconnect the ethernet cable from my computer, just as it's starting to play. I wait for the video to get stuck in a buffering state, then I reconnect the ethernet cable. With both the Flash FLVPlayback component and the Greensock VideoLoader - when I do this, the video remains stuck in a buffering state, even though the internet has been reconnected. Is this a bad method for simulating a slow internet connection? I had hoped that the VideoLoader would automatically detect that the internet is available again and continue downloading, but this doesn't seem to happen. Is there a way that I can get the VideoLoader to detect a break in the internet connection, and start downloading and playing again when the internet connection resumes? Any advice would be greatly appreciated. Thanks
  15. Hi, i realise this is way too similar to this thread: http://forums.greensock.com/topic/4683-mp3loader-making-a-perfect-loop/ but since this is about a video, not an audio (and therefore, I don't have the "repeat" property), I thought I'd ask. My idea is to loop a video that I've loaded using VideoLoader, but I want it to be a seamless loop. My first (and obvious) approach was adding a listener for the VIDEO_COMPLETE event on the video, and then play the video again from 0: var video:VideoLoader= LoaderMax.getLoader([videoId]) as VideoLoader; video.addEventListener(VideoLoader.VIDEO_COMPLETE, onVideoComplete); protected function onVideoComplete(event:LoaderEvent):void { var video:VideoLoader= event.target as VideoLoader; video.gotoVideoTime(0); video.playVideo(); } but this doesn't make it seamless, it freezes on the last frame of the video for a second or two, and then starts again. My second approach was adding a listener for the PLAY_PROGRESS event, and when the video reaches a certain sufficient point, start it from 0: var video:VideoLoader= LoaderMax.getLoader([videoId]) as VideoLoader; video.addEventListener(VideoLoader.PLAY_PROGRESS, onVideoComplete); protected function onVideoComplete(event:LoaderEvent):void { var video:VideoLoader= event.target as VideoLoader; if(video.playProgress >= 0.95){ video.gotoVideoTime(0); video.playVideo(); } } this made it better, but the same problem stays, it freezes (now not on the last frame, but on one of the last ones) and then starts all over. Is there a way to have a smooth loop, or another approach to make it smoother than these two I've tried? Thanks!
  16. Hi, I have a simple problem, which I wondered if VideoLoader has a solution to. If not, I can achieve it manually, but thought I'd ask. I've got a simple video which repeats 3 times: vid = new VideoLoader("video.flv", {name:"vid", container:this, repeat:3}); vid.load(); I call it like this: vid.playVideo(); ...but this only works once. The second time I try to play it, it doesn't play. I tried calling it this way instead: vid.gotoVideoTime(0); vid.playVideo(); ...but then it only plays once. Is there any way to maintain the repeat settings?
  17. Hi, First, thanks for the great products. Greensock is the first 3rd-party tweening library I've used, and I love it. I have an AIR application that contains about 25 videos. Every time we play a video, we unload the last video. The problem is the video object is not being garbage-collected after we call unload. It's staying in memory. By the time we've played all 25 of our videos, memory is approaching 1.5 gigabytes and our program crashes. This is how we create the VideoLoader: vloader = new VideoLoader(config.videoAPI+videofs, {name:"video_"+ys+"_"+i, scaleMode:"stretch", load:false, autoPlay:false, smoothing:true, bufferTime: 2}); This is our code to unload it: video.loader.cancel(); video.loader.unload(); video.loader.dispose(true); I imagine all three lines are overkill, but we are trying everything. Could it be an eventListener that is preventing the memory from being freed? Thanks, Bob
  18. I'm playing a video loaded through VideoLoader and looping it when it's complete _videoLoader.addEventListener(VideoLoader.VIDEO_COMPLETE,videoCompleteHandler,false,0,true); private function videoCompleteHandler($event:Event):void { _videoLoader.gotoVideoTime(0,true); } I'm getting a slight pause on looping, which I guess is understandable, but it's not pretty. Any suggestions on how to avoid? I know with an FLVPlayback (I believe) one can load a video into different layers and switch them on and off. Can I do something similar here? Grab two copies of the video from the VideoLoader? Or do I simply need to load the video twice, with two VideoLoaders? Or…… Thanks for any advice!
  19. http://dev.option5.net/CNCT/CNCT13004/video.html I've built a custom video player built on the use of VideoLoader. However, the loader progress isn't working. It appears to be working; the loader bar grows in width based on a LoaderEvent.PROGRESS dispatch. But when I test the actual network usage in Chrome (dev tools), it shows the video is loading long after the loader bar goes to 100%. Any ideas?
  20. There seems to be an issue/bug with cuepoints and gotoVideoCuePoint() function. So there's a movie, with two cue points, 'startLoop' - 'endLoop'... now when the video hits on the 'endLoop' cuepoint we want to go back to 'startLoop'... simple enough! Well, instead of going back to 'startLoop', the video stays at 'endLoop' and the trace function reports backgroundVideo cuepoint name is endLoop in a loop and after a while it goes back to 'startLoop'... Really weird issue! I'm using the latest version of your library. Any thoughts? The video was encoded with Adobe Media Encoder CS6, just in case! protected function _onBackgroundVideoCuePoint(event:LoaderEvent):void { var cue:String = event.data.name; trace('backgroundVideo cuepoint name is', cue); if (cue == 'startLoop') { _backgroundVideo.gotoVideoCuePoint('endLoop', true); return; } if (cue == 'startGame') { // TODO } }
  21. Hello, I found a problem when playing video from videoloader. Often, after the full video playback, the repeat playback video from this videoloader by function gotoVideoTime (0, true) starts playing video from the 2 seconds. For example, ask to see written for this example: https://dl.dropboxusercontent.com/u/8131769/videoTest.zip
  22. Hi, (first of all, sorry I posted a reply instead of creating new topic before, newby) I have a Loadermax with multiple loaders (image, xml, video and selfloader). All them have estimatedBytes and autodispose = false. I also have progress, complete and onError handlers set up. Testing for errors, I get the complete event fired before the onError event...... the onError handler would have a boolean to let the whole thing to start or not. so, why does the onComplete fires before the onError? Thanks Al
  23. Hi Guys, I am loading a few flv's using VideoLoader and LoaderMax queue. My video is 720x406 and I am stretching it to fit in 1000x564. VideoLoader's API says that smooting on videos is turned on by default and I have tried setting it to true as well. Problem is that when I test the sfw in flash, smoothing works but when I run this file in browser or on it own, no smoothing is applied. I have also tried this: intro.rawContent.smoothing = true; Appreciate if anyone can point out what might be happening. Thanks, ak
  24. Hello! We are using this tutorial as a starting point: http://codeknow.com/...ce/videoLoader/ What we have is seven F4V videos that are relatively large (smallest 5.2MB; largest 44.3MB). I am using the XML loader to create the queue and then load it as the tutorial link above demonstrates. The first video in the queue should play when enough of it is buffered in (it's 8.9MB) while the rest of the videos download in the background. I am using MaxConnections = 1. What is happening though is that the first video doesn't show until the entire queue of videos is loaded completely. The audio plays though. Can anyone lend some assistance to me to help troubleshoot this? XML file content: <?xml version="1.0" encoding="iso-8859-1"?> <videoList> <LoaderMax name="videoListLoader" prependURLs="video/" load="true" maxConnections="1" > <VideoLoader url="Intro.f4v" name="videoID0" width="1060" height="620" scaleMode="proportionalInside" centerRegistration="true" alpha="1" autoPlay="true" estimatedBytes="8887418" /> <VideoLoader url="RC.f4v" name="videoID1" width="856" height="530" scaleMode="proportionalInside" centerRegistration="true" alpha="0" autoPlay="false" estimatedBytes="14602065" /> <VideoLoader url="PED.f4v" name="videoID2" width="856" height="530" scaleMode="proportionalInside" centerRegistration="true" alpha="0" autoPlay="false" estimatedBytes="37803458" /> <VideoLoader url="AMT.f4v" name="videoID3" width="856" height="530" scaleMode="proportionalInside" centerRegistration="true" alpha="0" autoPlay="false" estimatedBytes="44307106" /> <VideoLoader url="ECR.f4v" name="videoID4" width="856" height="530" scaleMode="proportionalInside" centerRegistration="true" alpha="0" autoPlay="false" estimatedBytes="22076283" /> <VideoLoader url="REC.f4v" name="videoID5" width="856" height="530" scaleMode="proportionalInside" centerRegistration="true" alpha="0" autoPlay="false" estimatedBytes="27594500" /> <VideoLoader url="Outro.f4v" name="videoID6" width="856" height="530" scaleMode="proportionalInside" centerRegistration="true" alpha="0" autoPlay="false" estimatedBytes="5196856" /> </LoaderMax> </videoList> My Flash is too big to upload but here is the frame 1 script // Import Scripts import flash.net.URLRequest; import flash.display.MovieClip; import flash.events.Event; import flash.events.MouseEvent; import com.greensock.TweenMax; import com.greensock.events.LoaderEvent; import com.greensock.loading.LoaderMax; import com.greensock.loading.XMLLoader; import com.greensock.loading.VideoLoader; import flash.geom.Rectangle; //---- LOADER MAX ----------------------------------------------------------------; //an array containing the VideoLoaders in the order they should be played var _videos:Array; //keeps track of the VideoLoader that is currently playing var _currentVideo:VideoLoader; //If true, the audio has been muted var _silentMode:Boolean = false; //Check if we are in PlayAll Mode (true) var _playAllMode:Boolean = false; MainP(); //txt_progress.text = "0"; function MainP() { LoaderMax.activate([xmlLoader, VideoLoader]); initUI(); var xmlLoader:XMLLoader = new XMLLoader("videos.xml",{name:"videoList",onComplete:xmlHandler}); trace("XML Loader started"); xmlLoader.load(); trace("XML Loader Processing"); } function xmlHandler(event:LoaderEvent):void { trace("XML Complete Handler Started"); var queue:LoaderMax = LoaderMax.getLoader("videoListLoader");//get the LoaderMax named "videoListLoader" which was inside our XML _videos = queue.getChildren();//store the nested VideoLoaders in an array trace("Loading XML..."); queue.load(); //start loading the queue of VideoLoaders (they will load in sequence); trace("XML and videoListLoader loading!"); showVideo(_videos[0]);//show the first video } function initUI():void { //ignore mouse interaction with preloader_mc preloader_mc.mouseEnabled = false; //initially hide the user interface - autoAlpha:0 sets alpha to 0 and visible to false. TweenMax.allTo([preloader_mc], 0, {autoAlpha:0}); } function activateUI():void { btn_play.addEventListener(MouseEvent.CLICK, togglePlayPause); btn_next.addEventListener(MouseEvent.CLICK, nextVideo); btn_back.addEventListener(MouseEvent.CLICK, previousVideo); //loop through various UI elements and set buttonMode to true and mouseChildren to false so that rollovers/outs work smoothly; //var controls:Array = [btn_play]; //var i:int = controls.length; //while (i--) //{ //controls[i].buttonMode = true; //controls[i].mouseChildren = false; //} } //---- MENU BUTTONS ----------------------------------------------------------------; function play0(evt:MouseEvent):void { gotoAndPlay("Regulatory"); _playAllMode = false; selectedVideo(evt,1); } function play1(evt:MouseEvent):void { gotoAndPlay("EmplDev"); _playAllMode = false; selectedVideo(evt,2); } function play2(evt:MouseEvent):void { gotoAndPlay("AdvMgtTools"); _playAllMode = false; selectedVideo(evt,3); } function play3(evt:MouseEvent):void { gotoAndPlay("EmplRecords"); _playAllMode = false; selectedVideo(evt,4); } function play4(evt:MouseEvent):void { gotoAndPlay("Recruiting"); _playAllMode = false; selectedVideo(evt,5); } function play5(evt:MouseEvent):void { rewindAndPause(_currentVideo); _playAllMode = false; gotoAndPlay("MainMenu"); } function gotoViewAll(evt:MouseEvent):void { //rewindAndPause(_currentVideo); //gotoAndPlay("PlayAll","ViewAll"); _playAllMode = true; gotoAndPlay("Regulatory"); selectedVideo(evt,1); } // Button Setups - MENU BAR btn1.addEventListener(MouseEvent.CLICK, play0); btn2.addEventListener(MouseEvent.CLICK, play1); btn3.addEventListener(MouseEvent.CLICK, play2); btn4.addEventListener(MouseEvent.CLICK, play3); btn5.addEventListener(MouseEvent.CLICK, play4); btn6.addEventListener(MouseEvent.CLICK, play5); btn_viewall.addEventListener(MouseEvent.CLICK, gotoViewAll); // Trial Button Link btn_trial.addEventListener(MouseEvent.MOUSE_DOWN, trialButtonHandler); function trialButtonHandler(event:MouseEvent):void { navigateToURL(new URLRequest("https://www.prospera.com/signup/trialsignup.aspx?ActCode=00101817"),"_blank"); } // Contact Button Link btn_contact.addEventListener(MouseEvent.MOUSE_DOWN, contactButtonHandler); function contactButtonHandler(event:MouseEvent):void { navigateToURL(new URLRequest("http://www.prospera.com/"), "_blank"); } // Big SignUp Trial Button btn_signup.addEventListener(MouseEvent.MOUSE_DOWN, signupButtonHandler); function signupButtonHandler(event:MouseEvent):void { navigateToURL(new URLRequest("https://www.prospera.com/signup/trialsignup.aspx?ActCode=00101817"),"_blank"); } // Pricing Button Link btn_pricing.addEventListener(MouseEvent.MOUSE_DOWN, pricingButtonHandler); function pricingButtonHandler(event:MouseEvent):void { // NEED REAL LINK navigateToURL(new URLRequest("https://www.Prospera.com/HelpOutside/info.aspx?view=1"),"_blank"); } // Logo Click Button btn_logoClick.addEventListener(MouseEvent.MOUSE_DOWN, logoButtonHandler); function logoButtonHandler(event:MouseEvent):void { navigateToURL(new URLRequest("http://www.jjkeller.com/"),"_blank"); } //---- LoaderMax Video Controls ------------------------------------------------------------- function showVideo(video:VideoLoader):void { //if the new video is the one that's currently showing, do nothing. if (video == _currentVideo) { return; } //The first time through, the _currentVideo will be null. That's when we need to activate the user interface if (_currentVideo == null) { // NOT USING activateUI();//don't activate the UI until the first video is ready. This avoids errors when _currentVideo is null. } else { //remove the event listeners from the _currentVideo (which is now the old one that will be replaced) _currentVideo.removeEventListener(LoaderEvent.PROGRESS, updateDownloadProgress); if (_videos.indexOf(_currentVideo) == 0) { _currentVideo.addEventListener(VideoLoader.VIDEO_COMPLETE, gotoMainMenu); } else { if (_playAllMode == false) { _currentVideo.removeEventListener(VideoLoader.VIDEO_COMPLETE, gotoClosing); } else { _currentVideo.removeEventListener(VideoLoader.VIDEO_COMPLETE, nextVideo); } } _currentVideo.removeEventListener(VideoLoader.VIDEO_BUFFER_FULL, bufferFullHandler); //If the video is paused, we should togglePlayPause() so that the new video plays and the interface matches.; if (_currentVideo.videoPaused) { togglePlayPause(); } //fade out the preloader and then stop() it. If the new video needs to display the preloader, that's okay because the fade-in tween we create later will overwrite this one. TweenMax.to(preloader_mc, 0.3, {autoAlpha:0, onComplete:preloader_mc.stop}); //fade the current (old) video's alpha out. Remember the VideoLoader's "content" refers to the ContentDisplay Sprite we see on the screen.; TweenMax.to(_currentVideo.content, 0.8, {autoAlpha:0}); //fade the current (old) video's volume down to zero and then pause and rewind the video (it will be invisible by that time).; TweenMax.to(_currentVideo, 0.8, {volume:0, onComplete:rewindAndPause, onCompleteParams:[_currentVideo]}); } //now swap the _currentLoader variable so it refers to the new video. _currentVideo = video; //listen for PROGRESS events so that we can update the loadingBar_mc's scaleX accordingly _currentVideo.addEventListener(LoaderEvent.PROGRESS, updateDownloadProgress); //listen for a VIDEO_COMPLETE event so that we can automatically advance to the next video.; //########################################################################################## if (_videos.indexOf(_currentVideo) == 0) { _currentVideo.addEventListener(VideoLoader.VIDEO_COMPLETE, gotoMainMenu); } else { if (_playAllMode == false) { _currentVideo.addEventListener(VideoLoader.VIDEO_COMPLETE, gotoClosing); } else { _currentVideo.addEventListener(VideoLoader.VIDEO_COMPLETE, nextVideo); } } //########################################################################################## //if the video hasn't fully loaded yet and is still buffering, show the preloader; if (_currentVideo.progress < 1 && _currentVideo.bufferProgress < 1) { //when the buffer fills, we'll fade out the preloader _currentVideo.addEventListener(VideoLoader.VIDEO_BUFFER_FULL, bufferFullHandler); //prioritizing the video ensures that it moves to the top of the LoaderMax gueue and any other loaders that were loading are canceled to maximize bandwidth available for the new video.; _currentVideo.prioritize(true); //play() the preloader and fade its alpha up.; preloader_mc.play(); TweenMax.to(preloader_mc, 0.3, {autoAlpha:1}); } //start playing the video from its beginning _currentVideo.gotoVideoTime(0, true); //always start with the volume at 0, and fade it up to 1 if necessary.; _currentVideo.volume = 0; if (! _silentMode) { TweenMax.to(_currentVideo, 0.8, {volume:1}); } //when we addChild() the VideoLoader's content, it makes it rise to the top of the stacking order videoContainerInset_mc.addChild(_currentVideo.content); //fade the VideoLoader's content alpha in. Remember, the "content" refers to the ContentDisplay Sprite that we see on the stage.; TweenMax.to(_currentVideo.content, 0.8, {autoAlpha:1}); //update the progressBar_mc and loadingBar_mc; updateDownloadProgress(); } function bufferFullHandler(event:LoaderEvent):void { TweenMax.to(preloader_mc, 0.3, {autoAlpha:0, onComplete:preloader_mc.stop}); } function rewindAndPause(video:VideoLoader):void { video.pauseVideo(); //rewind the video so that when we fade it in again later, it's already displaying the first frame and there's no delay skipping to it. ; video.gotoVideoTime(0); } function rewindAndHide(video:VideoLoader):void { video.pauseVideo(); TweenMax.to(_currentVideo.content, 0.8, {autoAlpha:0}); //rewind the video so that when we fade it in again later, it's already displaying the first frame and there's no delay skipping to it. ; video.gotoVideoTime(0); } function nextVideo(event:Event):void { var next1:int = _videos.indexOf(_currentVideo) + 1; if (next1 >= _videos.length) { next1 = 1; rewindAndPause(_currentVideo); gotoAndPlay("MainMenu"); } else { if (next1 <= 6) { showVideo(_videos[next1]); } else { return; } } } function gotoClosing(event:Event):void { gotoAndPlay("Closing"); showVideo(_videos[6]); } function gotoMainMenu(event:Event):void { //rewindAndHide(_currentVideo); _playAllMode = false; gotoAndPlay("MainMenu"); } function previousVideo(event:Event):void { var prev:int = _videos.indexOf(_currentVideo) - 1; if (prev < 1) { prev = _videos.length - 1; } showVideo(_videos[prev]); } function selectedVideo(event:Event,whichVid:Number):void { showVideo(_videos[whichVid]); } //---- PROGRESS AND LOADING BAR FUNCTIONS ------------------------------------------------------------- function updateDownloadProgress(event:LoaderEvent=null):void { //loadingBar_mc.scaleX = _currentVideo.progress; //trace("progress: " + event.target.progress); //loadingBar_mc.scaleX = event.target.progress; //var currentProgress:Number = (int(event.target.progress * 100 )); //txt_progress.text = currentProgress.toString(); } //---- TOGGLE FUNCTIONS ------------------------------------------------------------------------------- function togglePlayPause(event:MouseEvent=null):void { _currentVideo.videoPaused = ! _currentVideo.videoPaused; if (_currentVideo.videoPaused) { //TweenMax.to(btn_play, 0.3, {autoAlpha:1}); btn_play.gotoAndStop("paused"); TweenMax.to(videoContainerInset_mc, 0.3, {blurFilter:{blurX:6, blurY:6}, colorMatrixFilter:{brightness:0.5}}); } else { //TweenMax.to(btn_play, 0.3, {autoAlpha:0}); btn_play.gotoAndStop("playing"); TweenMax.to(videoContainerInset_mc, 0.3, {blurFilter:{blurX:0, blurY:0, remove:true}, colorMatrixFilter:{brightness:1, remove:true}}); } } //---- UTILITY FUNCTIONS ------------------------------------------------------------------------------------- function addListeners(objects:Array, type:String, func:Function):void { var i:int = objects.length; while (i--) { objects[i].addEventListener(type, func); } } function force2Digits(value:Number):String { return (value < 10) ? "0" + String(value) : String(value); } Kindest Regards, Monica
  25. Good day! I have a problem with VideoLoader. Somtetimes video played very fast! Sometimes good, sometimes fast. My flv file duration is 2 seconds... very small and i think that is problem. My constructor: videoLoader = new VideoLoader(filename, {autoPlay:false, container:this, width:size ? size.x : null, height:size ? size.y : null, repeat: -1, bufferTime:4} ); So if set bufferTime to 4 , I have a problem? but if set it to 0.01, its better.. but with new problem: syncronization of videos not work: private function onVideoComplete(e:Event):void { playComplete = true; var synthSymbolsPlayFound:Boolean = false; for (var i:int = 0; i < synthSymbols.length; i++) { var videoLdr:VideoSprite = synthSymbols[i]; if (videoLoader.url == videoLdr.videoLoader.url && !videoLdr.playComplete) { synthSymbolsPlayFound = true; break; } } if (synthSymbolsPlayFound) videoLoader.pauseVideo(); else { for (i = 0; i < synthSymbols.length; i++) { if (videoLoader.url == synthSymbols[i].videoLoader.url) { synthSymbols[i].videoLoader.playVideo(); synthSymbols[i].playComplete = false; } } } } These problems are in the last version VideoLoader. sorry for my bad english
×
×
  • Create New...