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

Pause is called by itself on media error, why? #1050

Closed
momomo opened this issue Mar 21, 2017 · 5 comments
Closed

Pause is called by itself on media error, why? #1050

momomo opened this issue Mar 21, 2017 · 5 comments

Comments

@momomo
Copy link

momomo commented Mar 21, 2017

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.

@dighan
Copy link
Member

dighan commented Mar 22, 2017

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.

@momomo
Copy link
Author

momomo commented Mar 22, 2017

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.

@dighan
Copy link
Member

dighan commented Mar 23, 2017

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

@dighan dighan closed this as completed Mar 24, 2017
@momomo
Copy link
Author

momomo commented Mar 24, 2017

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

@dighan
Copy link
Member

dighan commented Mar 24, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants