Copy link to clipboard
Copied
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.
I have run out of searches and am hoping someone can make a suggestion as to how to solve this issue.
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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;
}
}
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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).