Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/VideoPlayer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ const hooks = {
state.playing = false
},
seeked() {
state.playAfterSeek === true && videoPlayerPlugin.play()
state.playAfterSeek &&
videoEl.addEventListener('canplay', () => videoPlayerPlugin.play(), { once: true })
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

@mauro1855 mauro1855 Nov 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

state.playAfterSeek = null
},
abort() {
Expand Down Expand Up @@ -442,7 +443,10 @@ const videoPlayerPlugin = {

export default autoSetupMixin(videoPlayerPlugin, () => {
precision =
(ApplicationInstance && ApplicationInstance.stage && ApplicationInstance.stage.getRenderPrecision()) || precision
(ApplicationInstance &&
ApplicationInstance.stage &&
ApplicationInstance.stage.getRenderPrecision()) ||
precision
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like just linebreaks which has nothing to do with the initial issue, correct?

Copy link
Copy Markdown
Author

@mauro1855 mauro1855 Nov 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems you are correct.


videoEl = setupVideoTag()

Expand Down