Can't play video

According Showing videos in OpenFl
and HTML5 loading video from Assets directory I tried to play video and without any results. No video, no errors. I try with first sample and target Flash and 2nd sample targeting html5. Any suggestions what is wrong?

Last time I checked (it was openfl 3.6.1) it worked on flash and html5 with .mp4.

well, maybe my video have wrong codec or something like that. Do you have link for any sample video that you sure it work?

I think you can get the famous Big Bunny video on internet. I remember that I used it in my first attempt with video on html5. Try h264 format.

Still have no luck.
Target flash: Cannot embed large file “assets/video/big-buck-bunny_292_480x268.mp4” (>16MB)

target html5: no errors but no video too.

You shouldn’t embed your video in your project. Just set embed=false in your config.xml.

In html5 project, try to compile with -Dcanvas. I think webGL need TextureVideo, the way to handle video is different I think.

With embed=false flag and Flash target I get:
String or Bytes asset “video/big-buck-bunny_292_480x268.mp4” exists, but only asynchronously
with this code:

 Assets.getBytes("video/big-buck-bunny_292_480x268.mp4");
 ns.appendBytes(ba);

When I switch to:

 Assets.loadBytes("video/big-buck-bunny_292_480x268.mp4").onComplete(completeHandler).onError(onLoadError).onProgress(onProgress);

Nothing happens.

That’s not how to play video.
Check this code:

Looks promising, but I don’t see where did you put video source?

Check Line 60.

 ns.play(videoName);

Finally, it works.
On html5 target must be added -Dcanvas flag.

Thanks a lot.

I recently got VideoTexture working for Stage3D, we’ll have to look at standard Video support when using WebGL

That will be really nice.

Video now works on DOM, Canvas, Flash (of course) or WebGL in the latest commit to OpenFL :slight_smile:

1 Like

What does it really means if I’m already able to play video with loudo’s example?

It means it works without -Dcanvas, now WebGL works with video as well

1 Like

Any hope for FLVlike format support? I would love videos with alpha in HTML5.

1 Like

Alpha would be great.

Probably possible on GL

1 Like

Ouch! It looks a bit complex: I should export my frames with alpha, extract alpha channel from each frame, cancel alpha from original frame, attach alpha channel image beneath each corresponding frame and then convert the sequence to a clip? I should create a PS action for this… at least for frames sequence.