Waited for canplay event before playing after seek#7
Waited for canplay event before playing after seek#7
Conversation
| (ApplicationInstance && | ||
| ApplicationInstance.stage && | ||
| ApplicationInstance.stage.getRenderPrecision()) || | ||
| precision |
There was a problem hiding this comment.
This looks like just linebreaks which has nothing to do with the initial issue, correct?
| seeked() { | ||
| state.playAfterSeek === true && videoPlayerPlugin.play() | ||
| state.playAfterSeek && | ||
| videoEl.addEventListener('canplay', () => videoPlayerPlugin.play(), { once: true }) |
There was a problem hiding this comment.
Are we sure all browsers actually fire the correct 'canplay' event?
Don't we need some fallback? like firing play immediately, but also on canplay?
There was a problem hiding this comment.
Looks like the support is very good: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canplay_event#browser_compatibility
There was a problem hiding this comment.
The original SDK code replaced in this PR doesn't really work as expected (as indicated in #5) according to some tests I did in the past. This fix solved the issue, but I didn't test it exhaustively. I would suggest double-checking this in some STBs.
robbertvancaem
left a comment
There was a problem hiding this comment.
Looks good to me 👍 @Thomvl I'm waiting for your approval before merging it
PR to address #5
This solution doesn't work in Safari, but the previous code also didn't work there, so nothing lost.
I checked a couple of STBs and confirmed this addresses the issue of not resuming playback after seek.