Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, playback resumes if you pause then seek if both autoplay and scheduleWhilePaused are true.
This is because after a see, a canplay will fire from the media element once content is in the buffer. Dash.js considers this the same as it does the first at startup and starts playback.
However, removing the startAutoPlay line from the onCanPlay event results in further problems. We use the autoplay property of the media element itself to track whether or not we are actively "trying to play", with the bonus of actually starting playback on a canplay event if that is the case.
I'm sure you'll think the direct access of element.autoplay here isn't great, and I agree and am open to ways to handle this better. I'd like to do it all in the playbackController, but part of the problem is that you can't call play() on the playbackController until it has been initialized, and it isn't initialized until the MPD is loaded etc. I'd be happy to take on board any suggestions to refactor this in a nicer way if it isn't a large piece of work.