Skip to main content
Known Participant
August 9, 2013
Question

Video Event Completed Problem

  • August 9, 2013
  • 1 reply
  • 1150 views

CS6 Flash Player (IE: 11,8,800,94 installed) and (Chrome: 11,8,800,97 installed)

Just started happening where my fl.video.VideoEvent.COMPLETE is not working. It is proving to be inconsistent. Sometimes it works and sometimes not. I've tried a number of ways and still having problems. Some of the videos I am using are older and I've recompiled them with CS6 Encoder... that helped a little. Replaced the FLVPlayback component from 2.1 to 2.5... that helped a little. Rearranged my Listener in the code... that helped a little.

I'm thinking there has been something happen to the Flash Player and am wandering if anyone else has been having this experience? This has been going on for two weeks now.

Some of these courses I've been experiencing are older ones. I've updated the fla to CS6, made all the events for video as fl.video.VideoEvent.COMPLETE. Used the import fl.video.VideoEvent.

SAMPLE: Just this morning changed the function from (e:fl.video.VideoEvent) to (e:Event), this sometimes helps as well.

OnscreenVideo.source = MovieClip(root).mediaFolder + "FS_BLY_aii_14c.flv";

OnscreenVideo.addEventListener(fl.video.VideoEvent.READY, VidReady14c);

OnscreenVideo.addEventListener(fl.video.VideoEvent.COMPLETE, VideoStopped14c);

function VideoStopped14c(e:Event):void{

trace("VideoStopped14c: ", OnscreenVideo.source);

OnscreenVideo.removeEventListener(fl.video.VideoEvent.COMPLETE, VideoStopped14c);

OnscreenVideo.removeEventListener(fl.video.MetadataEvent.CUE_POINT, cpCuePoint14c);

OnscreenVideo.visible = false;

 

}//end function VideoStopped14c

THANKS for your time!!!!

This topic has been closed for replies.

1 reply

sinious
Legend
August 9, 2013

I've experienced this a lot back in AS2 days but not as much AS3. Back in the AS2 days I tried as hard as possible to make the end of the video end on a whole second, e.g. 1m 22s 0f (f=frame). Sometimes if it ended at like 1m 22s 13f (13 frames into 1min 22 seconds) it would have issues detecting it's complete. If it HAD to end outside a whole second then manually adding in a cuepoint or keyframe usually fixed it.

Again though, haven't seen this in AS3 nor using Sorenson Squeeze which always makes sure the end frame is keyframed. If it becomes a really common issue and you have tons of assets you really don't want to recompress to a modern format then consider just running a timer alongside the video checking the duration against the playhead time. If the timer notices the playhead is at the duration it can be a fallback helper. Just have it spawn an event itself and handle as needed.

Known Participant
August 9, 2013

Some of my titles were built in AS2 and the move to AS3 was challenging and caused me to rebuild\rethink allot of code. This is a new problem that has popped up in the last two weeks with the install of a new Flash Player. I run a debug flash player, IE and the normal flash player, chrome and both are having the same problem. This title was built in an older version of flash and brough up to the newer version. Made a new title and copied the library and the frames. This has helped in the past.

It seems everything I try helps but doesn't fix all. This is so boggling to me because I have no errors just doesn't fire the event! I may have to revert to the time event to check the end of the video but that has CPU usage and I'm not sure about using it allot. There are allot of videos in my course. If that is what it will take then I'mm all for it. lol

THANKS!!!!!

sinious
Legend
August 9, 2013

The CPU impact is tiny. Use a Timer:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/Timer.html

It's only checking memory-speed properties at a slow interval. It's nothing like the overhead of an onEnterFrame function.

Tell the timer to fire off once every half second, second or even 2 seconds. Remember, this is only a backup incase the event fails to fire. If the event fires then stop the timer. Once you go to play another video, restart the timer. In the rare event no COMPLETE event fires and the timer figures out the video stuck at the end, 1~2 seconds of end-of-video time is fine and the timer will clean up the mess and stop itself.