Skip to main content
pauls32907036
Participating Frequently
August 3, 2018
Answered

External video will NOT loop

  • August 3, 2018
  • 1 reply
  • 711 views

I am frustrated by this problem and cannot understand why the code that works for others does not work for me.

import fl.video.*;

video_player.addEventListener(fl.video.VideoEvent.COMPLETE, completeF);

function completeF(e: fl.video.VideoEvent): void {

     video_player.seek(0);

     video_player.play("SOU_LobbyAnim_01.mp4");

}

video_player.play("SOU_LobbyAnim_01.mp4");

stop();

The video plays once and then freezes. I have read one thread where the video file format was the issue (H264 .mov rather than H264 .mp4) and I would like to think this might be the issue here... but I am fairly certain my file is the latter. I do not even know how to encode an H264 .mov

I am using Animate CC and Flash Player 26.

My source file is here.

Video file here.

I have run out of searches and am hoping someone can make a suggestion as to how to solve this issue.

This topic has been closed for replies.
Correct answer JoãoCésar17023019

Hi.

I think the video format and/or codec is causing the issue. The only way I got this working was encoding the video as FLV and the code I used is this:

AS3 code:

import fl.video.VideoEvent;

var path:String = "SOU_LobbyAnim_01.flv";

function completeF(e:fl.video.VideoEvent):void

{

     e.currentTarget.seek(0.000);

     e.currentTarget.removeEventListener(fl.video.VideoEvent.COMPLETE, completeF);

     playVideo();

}

function playVideo():void

{

     video_player.play();

     video_player.addEventListener(fl.video.VideoEvent.COMPLETE, completeF);

}

video_player.source = path;

playVideo();

FLA download:

animate_cc_as3_video_loop.zip - Google Drive

I hope this helps.

Regards,

JC

1 reply

JoãoCésar17023019
Community Expert
JoãoCésar17023019Community ExpertCorrect answer
Community Expert
August 3, 2018

Hi.

I think the video format and/or codec is causing the issue. The only way I got this working was encoding the video as FLV and the code I used is this:

AS3 code:

import fl.video.VideoEvent;

var path:String = "SOU_LobbyAnim_01.flv";

function completeF(e:fl.video.VideoEvent):void

{

     e.currentTarget.seek(0.000);

     e.currentTarget.removeEventListener(fl.video.VideoEvent.COMPLETE, completeF);

     playVideo();

}

function playVideo():void

{

     video_player.play();

     video_player.addEventListener(fl.video.VideoEvent.COMPLETE, completeF);

}

video_player.source = path;

playVideo();

FLA download:

animate_cc_as3_video_loop.zip - Google Drive

I hope this helps.

Regards,

JC

pauls32907036
Participating Frequently
August 3, 2018

Thanks JC. I downloaded your files.

Ok, so I was hoping to avoid using an FLV because that is a depricated file format... in fact I don't even have the ability to encode FLVs and I have the entire Adobe Creative Suite.

I also just notied that if I test in Animate it works, but when I open JUST the .swf it does not play the video AT ALL.

Colin Holgate
Inspiring
August 3, 2018

The last Creative Suite was CS6, and Adobe Media Encoder CS6 can make FLV. If you mean that you have all of Creative Cloud, you can go to the CC menu and Animate, and choose the Other Versions option from the drop down menu on the right. Installing Flash Pro CS6 will also install Adobe Media Encoder CS6, and then you can make FLV again.

The SWF not playing the video may be security related issue. If you put the files on a server, does it then work?