PlayingVideo sample still not working!

Updated to the latest version of OpenFL and then used openfl create PlayingVideo to make sample folder. Did a build html5 for each video type, mp4, webm and ogv in macOS and …

Firefox: played the mp4 fine with audio, webm and ogv didn’t display anything
Safari: showed the first frame of mp4, no video or sound, webm and ogv didn’t display anything
Chrome: didn’t display anything

Help!!! Really need to be able to play a video!

We didn’t do a release of openfl-samples by accident, but I’ve just helped release an update now.

We had to make a patch to PlayingVideo, as more browsers are not playing video unless it occurs as the result of a user action, so the PlayingVideo sample should consistently require a click or tap before playing a video

Try updating your “openfl-samples” library, then openfl create PlayingVideo again before testing

How do I update my open-fl-samples library?

PlayingVideo requires a click on what specifically?

Would dispatching a MouseEvent.CLICK to the video object work?

Run haxelib update or just haxelib update openfl-samples, or check out the sources here:

I discovered that you can create everything needed to display the video after a user event like clicking a button. I made my own VideoSprite class that will load and play a video inside the sprite. The sprite can be sized and positioned as desired.

I do have a couple of issues:

If I pass an invalid path to, netStream_onAsyncError doesn’t catch it. How do I catch this error?

I wanted to load a video and stop at the first frame. I was able to detect when the video started and tried using the seek method to advance to particular point in the video. The seek method doesn’t seem to do anything.

Take a look at the source for

It might be possible that some minor improvements will be needed to support what you’re looking to do, as the behavior of browsers tends to change a bit over time and require additional testing to get perfect :slight_smile:

1 Like

Still trying to figure out how to catch this error.