Hls.js: Pause is called by itself on media error, why?

Created on 21 Mar 2017  路  5Comments  路  Source: video-dev/hls.js

The video.pause() method seems to be called by hls.js by itself. The reason is that I have very choppy video, but it should be my decision to pause, not the libraries.

This is a problem because it makes it difficult to detect if a user paused or it was hls.js .

Here is some console output.

"video event: error"

1111111 "hlsError" Object {type: "mediaError", details: "bufferAppendingError", fatal: false}
Tv.js?v=1288330584:1070 1111111 "hlsFragBuffered" Object {stats: Object, frag: Fragment, id: "main"}
Tv.js?v=1288330584:1070 1111111 "hlsStreamStateTransition" Object {previousState: "PARSED", nextState: "IDLE"}
Tv.js?v=1288330584:1070 1111111 "hlsFragLoading" Object {frag: Fragment}
Tv.js?v=1288330584:1070 1111111 "hlsStreamStateTransition" Object {previousState: "IDLE", nextState: "FRAG_LOADING"}
Tv.js?v=1288330584:1070 1111111 "hlsBufferAppended" Object {parent: "main", pending: 0}
1999204574:1 Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().

I know for sure that I didn't call pause anywhere, because if I did, then a value would be updated.

Most helpful comment

I don't think it's our job to help you figure out how to fix the bugs and errors more than to report their existence.

Your vision of collaborative work is quite disturbing especially for an open-source project. Anyway, the only thing we expect, it's a clear and detailed issue to help you and find the proper fix that will be profitable to all our users.

All 5 comments

pause() in only invoked when the media is already in paused state during a currentLevel=x instruction. I think the issue is somewhere else.

Please, follow the issue template first in order to ease identifying problems. It allows to get much more info.

pause() is not invoked, but a video element pause event is triggered, and the video is playing when this occurs, so pause is definitely not invoked by us. difficult to provide a sample that will show the error, since it will only occur at certain stallbacks and after the hlsError event happens.

Maybe it's this that causing it: hlsStreamStateTransition { previousState:IDLE }

To get around this we now ignore pause events for devices other ios.

Without any sample code or platform/browser info to reproduce, it's hard to help you out...

@dighan You see this lines of code?

                              if (!this.immediateSwitch) {
                    this.immediateSwitch = true;
                    var media = this.media,
                        previouslyPaused = void 0;
                    if (media) {
                        previouslyPaused = media.paused;
                        media.pause();
                    } else {
                        // don't restart playback after instant level switch in case media not attached
                        previouslyPaused = true;
                    }
                    this.previouslyPaused = previouslyPaused;
                }

it calls media.pause() without checking the state of the player.
That's the only occurence where I can see pause being called.

I don't think it's our job to help you figure out how to fix the bugs and errors more than to report their existence.

I don't think it's our job to help you figure out how to fix the bugs and errors more than to report their existence.

Your vision of collaborative work is quite disturbing especially for an open-source project. Anyway, the only thing we expect, it's a clear and detailed issue to help you and find the proper fix that will be profitable to all our users.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nickcartery picture nickcartery  路  4Comments

jlacivita picture jlacivita  路  3Comments

osamay picture osamay  路  4Comments

GeorgySerga picture GeorgySerga  路  3Comments

mmmmoj picture mmmmoj  路  3Comments