Flash and HTML5 Video

Hi All, Is there a way to play an mp4 video from local assets on both HTML5 and Flash targets. I can get it to work with netstream on both if its a remotely hosted mp4 but I can only get it to work from the assets folder with the flash target if I use getBytes/AppendBytes with an flv. Which doesn’t work with the html target.


I believe there is a plugin for openfl that uses the webm format (not mp4) - I haven’t tried it so I don’t know what the results are, but it does mean converting your video to webm format.

haxelib install openfl-webm

And the project on Github has some instructions on how to use, which may be easier than trying to work around mp4. It is possible, potentially by manually modifying the output HTML file but of course that is annoying. Up to you, of course.

Thanks for the reply. Yeah I noticed the WebM plugin but alas I need it for mobile safari. It’s strange as it works fine when you stream remotely.

You might need an #if #else for Flash and HTML5 for this

Or doesn’t the remote version work for both? In Flash Player, it would depend on the security sandbox, whether it accesses files locally or remotely

Thanks for the reply, yeah it works for both on the remote version just not from the assets. Maybe I should start art a new topic but is it possible to detect a videos end with the html target? None of the flash events fire.

If there’s a way to get it in HTML5, I’m sure there’s a way to wire it back to OpenFL events