Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MediaSource attached to element. Waiting on open... #115

Closed
jammed343 opened this issue Sep 15, 2016 · 7 comments
Closed

MediaSource attached to element. Waiting on open... #115

jammed343 opened this issue Sep 15, 2016 · 7 comments

Comments

@jammed343
Copy link

jammed343 commented Sep 15, 2016

When I run this to try to play a video stream (no audio) it doesn't work properly (videojs-contrib-dash - v2.5.1 ):

[18] [dash.js 2.3.0] MediaPlayer has been initialized 
dash.js:2783 [21] EME detected on this user agent! (ProtectionModel_21Jan2015) 
dash.js:2783 [30] Playback Initialized 
dash.js:2783 [618] Parsing complete: ( xml2json: 8.97ms, objectiron: 6.19ms, total: 0.0152s) 
dash.js:2783 [622] Manifest has been refreshed at Fri Sep 16 2016 00:19:17 GMT+1000 (AEST)[1473949157.635]  
dash.js:2783 [639] SegmentTimeline detected using calculated Live Edge Time 
dash.js:2783 [1370] Local time:      Fri Sep 16 2016 00:19:18 GMT+1000 (AEST) 
dash.js:2783 [1370] Server time:     Fri Sep 16 2016 00:19:18 GMT+1000 (AEST) 
dash.js:2783 [1371] Difference (ms): -383 
dash.js:2783 [1377] MediaSource attached to element.  Waiting on open... 

And even when pressing play the screen is black.
I noticed that this worked on older versions of videojs and videojs-contrib-dash but now it doesn't.

Steps to reproduce

Create test dash stream with gstreamer videotestsrc
Using nginx built with https://github.com/sergey-dryabzhinsky/nginx-rtmp-module to create dash stream.
Dash stream plays successfully on bitmovin.

mpd file:

<?xml version="1.0"?>
<MPD
    type="dynamic"
    xmlns="urn:mpeg:dash:schema:mpd:2011"
    availabilityStartTime="2016-09-15T23:54:36+10:00"
    publishTime="2016-09-15T23:54:36+10:00"
    minimumUpdatePeriod="PT20S"
    minBufferTime="PT20S"
    timeShiftBufferDepth="P0Y00M00DT0H00M20.13S"
    suggestedPresentationDelay="PT40S"
    profiles="urn:hbbtv:dash:profile:isoff-live:2012,urn:mpeg:dash:profile:isoff-live:2011"
    xmlns:xsi="http://www.w3.org/2011/XMLSchema-instance"
    xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">
  <UTCTiming schemeIdUri="urn:mpeg:dash:utc:http-head:2014"
       value="http://vm2.dashif.org/dash/time.txt" />  <Period start="PT0S" id="dash">
    <AdaptationSet
        id="1"
        segmentAlignment="true"
        maxWidth="640"
        maxHeight="480"
        maxFrameRate="30">
      <Representation
          id="live_H264"
          mimeType="video/mp4"
          codecs="avc1.640028"
          width="640"
          height="480"
          frameRate="30"
          sar="1:1"
          startWithSAP="1"
          bandwidth="0">
        <SegmentTemplate
            presentationTimeOffset="0"
            timescale="1000"
            media="live-$Time$.m4v"
            initialization="live-init.m4v">
          <SegmentTimeline>
             <S t="1839890" d="20132"/>
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
    </AdaptationSet>
  </Period>
</MPD>
@AlexThomas90210
Copy link

Same problem here, Stuck on
MediaSource attached to element. Waiting on open...
in the console.
I noticed that its only if its the first time a file is being loaded into the browser, with a page refresh the content plays, if I clear the history on the browser it will again stay on "Waiting to open".
If open one mpd, get stuck, so refresh the page and it plays, then go to a new mpd it will also get stuck.

Any info on this?

@halibegic
Copy link

+1

@forbesjo
Copy link
Contributor

@mykyypl
Copy link

mykyypl commented Nov 19, 2016

Working only Videojs 5.9, when add Videojs 5.13 random show in console:
Firefox:
[88] MediaSource is open! InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable [93] Native video element event: ratechange: Specified “type” attribute of “application/dash+xml” is not supported. Load of media resource https://../.../../dash.mpd failed. All candidate resources failed to load. Media load paused. InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable Cannot play media. No decoders for requested formats: application/dash+xml, application/dash+xml
Chrome:
[18] [dash.js 2.3.0] MediaPlayer has been initialized dash.js:2783 [21] EME detected on this user agent! (ProtectionModel_21Jan2015) dash.js:2783 [30] Playback Initialized dash.js:2783 [618] Parsing complete: ( xml2json: 8.97ms, objectiron: 6.19ms, total: 0.0152s) dash.js:2783 [622] Manifest has been refreshed at Fri Sep 16 2016 00:19:17 GMT+1000 (AEST)[1473949157.635] dash.js:2783 [639] SegmentTimeline detected using calculated Live Edge Time dash.js:2783 [1370] Local time: Fri Sep 16 2016 00:19:18 GMT+1000 (AEST) dash.js:2783 [1370] Server time: Fri Sep 16 2016 00:19:18 GMT+1000 (AEST) dash.js:2783 [1371] Difference (ms): -383 dash.js:2783 [1377] MediaSource attached to element. Waiting on open...

The error is random. After adding a new Videojs need to refresh the page several times to observe the error. At the Library 5.9 every time it correctly.

@ruslandinov
Copy link

The reason of this bug is the source handler being disposed.
Starting from version 5.10, video.js disposes source handler, if more than one loadstart event is fired per one value of currentSource_ variable of Tech class, see more here https://github.com/videojs/video.js/blame/master/src/js/tech/tech.js#L892. And that's exactly the case with source handlers that uses MSE.
So, I'm sure that this issue has same reason as this one #120.
I don't understand the reason, which forced video.js guys to monitor consequent loadstart events, but it breaks source handlers. :/

@taliptako
Copy link

taliptako commented Jan 13, 2017

Same problem here you can reproduce from this url https://detayhosting.com/player3/
On the first load video not playing but after refresh its playing. So when i press ctrl + f5 with chrome its not playing but just with f5 after the first load its working.You can check the logs from url but i'm also sharing here.
[11] [dash.js 2.4.0] MediaPlayer has been initialized Debug.js:108[15] EME detected on this user agent! (ProtectionModel_21Jan2015) Debug.js:108[21] Playback Initialized Debug.js:108 [822] Parsing complete: ( xml2json: 10.5ms, objectiron: 1.63ms, total: 0.0122s) Debug.js:108 [848] MediaSource attached to element. Waiting on open... Debug.js:108 [849] Manifest has been refreshed at Sat Jan 14 2017 01:23:09 GMT+0300 (+03)[1484346189.625]

@forbesjo
Copy link
Contributor

forbesjo commented Mar 2, 2017

This is a video.js issue (videojs/video.js#3428) as a workaround please use player.src(source) to load your source instead of a source element

@forbesjo forbesjo closed this as completed Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants