Can't play video


#1

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?


#2

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


#3

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


#4

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.


#5

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.


#6

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.


#7

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.


#8

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


#9

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


#10

Check Line 60.

 ns.play(videoName);

#11

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

Thanks a lot.


#12

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


#13

That will be really nice.


#14

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


#15

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


#16

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


#17

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


#18

Alpha would be great.


#19

Probably possible on GL


#20

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.