webosose / build-webos

webOS OSE build layer
670 stars 126 forks source link

Loading multiple videos with MediaSource API #9

Open alexpogosyan opened 6 years ago

alexpogosyan commented 6 years ago

When trying to load a webpage with more then one MediaSources, browser window goes black and there's following error message in debugger console:

Uncaught InvalidStateError: Failed to execute 'endOfStream' on 'MediaSource': The MediaSource's readyState is not 'open'.

Same page works fine in desktop chrome.

I'm attaching minimal example, it tries to load and play two videos using MediaSource API.

simplest-html.zip

xxx0202xxx commented 6 years ago

There is limitation to support multi-instance about MSE in webOS OSE 1.0. I expect it will support in webOS OSE 1.5.

rabzu commented 6 years ago

Any idea when 1.5 is coming out?

xxx0202xxx commented 6 years ago

I'm consider to implement about multi-instance feature.

alexpogosyan commented 6 years ago

Actually it doesn't have to be multiple instances. Here's another example where two videos load and play strictly one after another. On device it starts playing for a few minutes and then device either restarts or it freezes. In case of freeze debugger connection is lost so there's no way to read console errors. Any ideas what could be causing this?

media.zip

alexpogosyan commented 6 years ago

Checked out latest version, compiled it and ran it on Raspberry Pi 3 b+. Unfortunately nothing changed, behaves exactly the same as in my previous comment.

xxx0202xxx commented 6 years ago

About supporting multi-instance, MSE playback include adaptive streaming feature as a default in MSE playback case. Unfortunately, the max resource is one FHD instance on Raspberry Pi 3. To support adaptive streaming in MSE playback, we allocate FHD resource. So it's impossible now. Wait a some time. The OSE 1.6 will be released. We will support uri playback with hw acceleration. And it also include multi-instance feature.

rabzu commented 5 years ago

@xxx0202xxx any news on OSE 1.6?

xxx0202xxx commented 5 years ago

We changed the media stack on OSE 1.6 from DirectMedia based on OMX to a g-media-pipeline based on GStreamer . It's meaningful changes in our media stack. And you can play media contents as a uri without MSE api. Also multi-instance feature was added in media stack. But You can't use media multi-instance feature in MSE case. Because hardware resource was allocated as a max to support adaptive streaming feature in MSE case.

rabzu commented 5 years ago

@xxx0202xxx Any update on this?

xxx0202xxx commented 5 years ago

If you want to use the multi-instance in the MSE case, please set the small size of video frame before video source setting. Media framework just decide the limitation from video frame source size. So you can use the multi-instance in the MSE case.

But RPi can reliably support one instance for MSE in adaptive streaming. (The limitation of RPi is one FHD video.)