Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
whsecurity

video stop between loop

Recommended Posts

Hello and thanks for this great library.

 

I have a little problem with the video repeat function of videoloader. I load multiple video and I had set repeat:-1. The video loops to infinity but between the loops I have a freeze time about 2 seconds.

 

This is the code I use:

 

import com.greensock.events.LoaderEvent;

import com.greensock.loading.VideoLoader;

import com.greensock.loading.LoaderMax;

 

//path to video folder

var livPath:String = "http://www.xxxxxxxx.com/path/";

 

//

//--video loader and movement

//

 

var residentsArray:Array=["babybousoulaei1.flv", "babybousoulaeiaristera.flv", "babybousoulaeidown.flv", "babyplayanapoda.flv", "babysitdown1.flv", "babysitdown2.flv", "babysitdown3.flv", "clowndance.flv", "clowndance2.flv", "giatrosKarotsiAristera.flv"];

 

LoaderMax.activate([VideoLoader]);

 

var residentsQueue:LoaderMax = LoaderMax.parse(residentsArray, {name:"residentsQueueLoader", onProgress:rProgressHandler, onComplete:rCompleteHandler, onError:rErrorHandler}, {width:"60", height:"60", centerregistration:"true", repeat:-1, scaleMode:"none", autoPlay:false});

residentsQueue.prependURLs(livPath);

residentsQueue.load();

 

function rCompleteHandler(event:LoaderEvent):void

{

var babybousoulaei1V:VideoLoader = LoaderMax.getLoader(livPath+"babybousoulaei1.flv");

addChild(babybousoulaei1V.content);

babybousoulaei1V.playVideo();

 

var babybousoulaeiaristeraV:VideoLoader = LoaderMax.getLoader(livPath+"babybousoulaeiaristera.flv");

addChild(babybousoulaeiaristeraV.content);

babybousoulaeiaristeraV.playVideo();

babybousoulaeiaristeraV.content.x = 60;

 

var babybousoulaeidownV:VideoLoader = LoaderMax.getLoader(livPath+"babybousoulaeidown.flv");

addChild(babybousoulaeidownV.content);

babybousoulaeidownV.playVideo();

babybousoulaeidownV.content.x = 120;

 

var babyplayanapodaV:VideoLoader = LoaderMax.getLoader(livPath+"babyplayanapoda.flv");

addChild(babyplayanapodaV.content);

babyplayanapodaV.playVideo();

babyplayanapodaV.content.x = 180;

 

}

 

function rErrorHandler(event:LoaderEvent):void

{

trace("error occured with " + event.target + ": " + event.text);

}

 

function rProgressHandler(event:LoaderEvent):void

{

trace("progress: " + event.target.progress);

}

 

Any Ideas?

 

I had tried both with gsap 12 and Tweening platform 11.

 

Thanks in advance for your time!

Link to post
Share on other sites

I'm not sure what could cause such a long delay, but I did discover yet another bug in the Flash Player (after FP11) that caused a flicker if you try to call a NetStream's seek() method on the same frame as when it finishes playback. Waiting 1 frame solved it in my tests. I've attached a revised version of VideoLoader that implements that workaround internally. Would you mind trying it out to see if it resolves the issue for you?

VideoLoader.zip

Link to post
Share on other sites

It sure resolves the issue but not completely. At the end of the video there is a small-tiny gap. Unfortunelly the videos are people movement in a big scale project so I can't play dices with the video playback. I will give a try to starling framework about the movement.

 

I had tried a few things and the problem occures only on FP10 and FP11 (not on FP9). Also I reencode the videos and had tried a few approaches but witn no conclusion.

 

After a little google search I found a few people with the same problem. So I think the problem occures from flash player and not anything else. :(

 

Thanks for the help and time spent.

Link to post
Share on other sites

I'd be happy to take a look at a very simple example FLA that demonstrates the problem. Just upload that and the video file so that I can publish on my end and see what's going on.

 

The new VideoLoader is in the public downloads now.

Link to post
Share on other sites

After a little push this is the best I can get with videoloader (Very good result indeed!):

 

videoloader.zip

 

Keep in mind that there will be about 40 - 50 videos playing at the same time

 

This is the starling approach:

 

starling.zip

 

but I can't use it because I can't set wmode=direct. I have html code above the swf and until now I didn't found any way to archive this.

 

I don't know the forum rules so if you want tell me if I can post the url of the site or sent it to you with a email

 

Thanks for your time and this great library (greensock:Tweenmax, loaderMax, BlitMask ...)

Link to post
Share on other sites

Thanks for posting the files. So were you saying that things are resolved now or are you still having any trouble? You're welcome to post a link here or PM me or e-mail me.

Link to post
Share on other sites

Still the video seems to freeze for a little bit of time. But I will come back in a few days when we have loaded all videos on the swf.

Link to post
Share on other sites

Hi,

 

My company is using Greensock 11 AS3 in a large project under a corporate membership. I'm experiencing similar issues with looping video in an Adobe AIR for Android app. I'm using VideoLoader to attach h.264 video to a StageVideo instance. I also find a significant lag when looping a clip using repeat: -1. I downloaded the latest public download of GS11 and also the patched version of VideoLoader included in this post. The updated code had no noticeable effect.

 

I notice this code didn't seem to make it into the latest release. Is there any more I can do to improve this issue?

 

Also running this test app on multiple systems on both Android and in a SWF on Windows it will eventually hang if left to loop infinitely. I also wanted to confirm with you that there isn't a built in ceiling or limit on "infinite" looping before I do additional debugging.

 

Thanks!

Link to post
Share on other sites

No, there is no built-in ceiling on the infinite loop. It should be able to go forever (at least as far as VideoLoader is concerned).

 

The latest version does have the fix in place, but it wasn't identical to the file posted here because we found another issue that was introduced with that one. So the most recent one has the best attempts at working around Adobe's bug. If you're still having trouble, please post a very simple FLA and video file that we can publish on our end to see the big lag. We'd be happy to take a peek.

Link to post
Share on other sites

The latest version does have the fix in place, but it wasn't identical to the file posted here because we found another issue that was introduced with that one. So the most recent one has the best attempts at working around Adobe's bug.

 

Thanks for the quick response. In our simple test movie (swf) running in Flash Standalone Player 11.4, the temporary fix to videoloader in this post did fix the looping issue, but the latest full download of Greensock 11 doesn't fix it--still a pause and white flash when looping using StageVideo.

 

You mentioned working around another issue or side effect. Could you expand on that? I'm wondering if there's a way we could get the fix, but avoid other consequences.

 

I could email you the full test project and video file I'm using. Attached is the document class. This is the only code in the project aside from movie monitor, which I'm using to view the frame rate and other performance stats.

StageVideoTestMovie.zip

Link to post
Share on other sites

Yes, please send me/us the full set of files so that we can publish on our and and see exactly what's happening. That'll help us compare things and diagnose the issue. Thanks!

Link to post
Share on other sites

I'm including the rest of the project, but the video is too large. I deleted it from the zip file. Let me know if you make anything of it. I'll send the video if you message me your email address.

 

Thanks.

 

StageVideoTestMovie.zip

Link to post
Share on other sites

Actually, it looks like that file (minus a trace()) was indeed posted a few months back in the v12 download zips. I realize that may have been a little confusing because there hasn't been an official announcement that v12 is out of beta yet, but I would definitely encourage you to start using all the v12 stuff; the only thing holding back the "official" launch are some JavaScript-related changes and enhancements. The loading package is pretty much identical in v12 as it was in v11. I did just go ahead and drop the VideoLoader.as file into the v11 zips too. Again, sorry about any confusion there.

Link to post
Share on other sites

Hi, I'm having similar issue using a cuePoint as looptime, it means i set an ASCuePoint in a certain point and i use it to loop in that point.

Result: I'm having a quick freeze,and it has different duration everytime, let's say I need a way to loop properly :)

Link to post
Share on other sites

Hi mitchBCAA,

 

Welcome to the GreenSock forums.

 

Similar to the users ahead of you on this thread, we need to request a simple set of files that we can see so that we can help troubleshoot the issue.

We don't need your full production files but please include a small sample video with your files, everything we need to quickly compile and test the results. 

 

Thanks

Link to post
Share on other sites

Hi, the project is kinda messy, anyway is playing a simple loop now with repeat -1 .

What i would like to achieve is a short video in loop or better to manage properly cuepoint to loop a portion of video programmatically.

 

 

Sorry for mess in code, what im using is just createVideo function.

 

 

http://www.bcaa.it/appoggio/LoopTest.rar

Link to post
Share on other sites

Hi mitch,

 

Can you replicate the issue on desktop? I noticed your file was set up for Air for Android.

Also I opened both your swf and html page before trying to compile and there were errors and nothing seemed to work. 

Please provide an example that we can publish on desktop without errors. 

 

I can only assume that the slight delay you are experiencing when seeking to a cuepoint is related to something related to your device hardware or something in AIR

Link to post
Share on other sites

Hi, if you open the .fla in flash u can easily play the file and you will notice that freeze happens on desktop esecution as well, it mean is not hardware related, cos hardware is the latest one.

I can tell you that freeze frame is longer in tablet then in desktop, but anyway, my question is  : does anybody had success looping correctly a video ? and if yes, how ? :)

Link to post
Share on other sites

hmm, i went back to your files and tried exporting for Air Desktop and regular Flash Player. 

Got rid of errors, but video wasn't loading or displaying. I didn't have time to hunt through all the code.

 

I opened your LOPPOLO.mp4 in QuickTime player and as I scrubbed the video,  I noticed that you have a number of totally black frames at the end of the video. Please be sure this doesn't account for the delay you were experiencing

 

Anyway, I think its best just to give you a basic demo using an .f4v (recommended for AS cuepoints)

 

Here is an online preview: http://greensock.com/temp/cuepoint-loop.html

 

I don't see any lag when it loops back to the 3-second time.

 

CS6 fla, swf, and video files attached.

 

 

 

 

cue-point-loop-cs6.zip

Link to post
Share on other sites

Hi, thank you for support indeed, I will look at example within some hours.

From my experience, and hope it can helps other people as well, You cannot use f4v into android, it will not be rendered, that's why i used mp4 and i set cue point with videoloader methods; plus maybe there is some particular settings to be done with keyframing in export video, as i know more i will share.

 

Thank you again and perfect choice for video example ;)

  • Like 1
Link to post
Share on other sites

What i can say  is that if video Size is full HD in AIR video doesnt loop regularly...really dunno how to come out of this.

 

For some reason i discovered a video mp4,flv,f4v on AIr for android never reach the end, that's why cant loop properly, there is a mismatch in timecode.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×