Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

External video will NOT loop

New Here ,
Aug 03, 2018 Aug 03, 2018

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.

TOPICS
ActionScript
608
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 03, 2018 Aug 03, 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.v

...
Translate
Community Expert ,
Aug 03, 2018 Aug 03, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 03, 2018 Aug 03, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 03, 2018 Aug 03, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 03, 2018 Aug 03, 2018

Yes Colin thats what I meant (CC).

Ok, I did discover a bit of a hack... loading another DUPLICATE .mp4 in place of the first one does play. So, I set a variable and alternate between loading either of the two duplicate videos... this actually works! Crazy tho that Adobe makes this so difficult. SMH

import fl.video.*;

var videoSelect:Number = 1;

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

video_player.seek(0);

if (videoSelect == 1){

video_player.play("SOU_LobbyAnim_02.mp4");

videoSelect = 2;

} else {

video_player.play("SOU_LobbyAnim_01.mp4");

videoSelect = 1;

}

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 03, 2018 Aug 03, 2018

It's funny because the SWF loads the video normally here even when I run from outside of Animate.

And if creating a duplicate works for you, it may has something to do with file permissions. You should check this out.

Anyway, it's good that it is working now!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 03, 2018 Aug 03, 2018
LATEST

I'm not sure what you mean by permissions... do you mean for the video files? I open the Get Info window on them and they are set to read & write for me (I am the only user and created these files).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines