build-webos icon indicating copy to clipboard operation
build-webos copied to clipboard

Loading multiple videos with MediaSource API

Open alexpogosyan opened this issue 6 years ago • 10 comments

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

alexpogosyan avatar Jun 12 '18 06:06 alexpogosyan

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

xxx0202xxx avatar Jun 25 '18 04:06 xxx0202xxx

Any idea when 1.5 is coming out?

rabzu avatar Jun 25 '18 08:06 rabzu

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

xxx0202xxx avatar Jun 25 '18 11:06 xxx0202xxx

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 avatar Jun 25 '18 14:06 alexpogosyan

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.

alexpogosyan avatar Sep 07 '18 09:09 alexpogosyan

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.

xxx0202xxx avatar Sep 08 '18 03:09 xxx0202xxx

@xxx0202xxx any news on OSE 1.6?

rabzu avatar Nov 17 '18 11:11 rabzu

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.

xxx0202xxx avatar Nov 21 '18 01:11 xxx0202xxx

@xxx0202xxx Any update on this?

rabzu avatar Jan 21 '19 14:01 rabzu

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.)

xxx0202xxx avatar Jan 22 '19 08:01 xxx0202xxx