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

Apply the IOS headphone disconnect patch only after successful playback #6354

Closed
wants to merge 7 commits into from

Conversation

klipstein
Copy link

Description

Since using the version which includes #6199 we saw issues when using videojs in combination with videojs+ima. Because Google IMA uses the same video-tag on iOS to display video ads it happens that a suspend event is occurring when video sources get switched (in my case a preroll in a muted autoplay scenario). And calling pause() in this switching phase could lead to a state within IMA that the player gets stalled.

A fix could either be to enable / disable this headphone-disconnect patch or this pull request, which only does stalled/suspend checks after a video-source was played for at least 1s.

Requirements Checklist

  • Bug fixed
  • Reviewed by Two Core Contributors

@welcome
Copy link

welcome bot commented Dec 12, 2019

💖 Thanks for opening this pull request! 💖

Things that will help get your PR across the finish line:

  • Run npm run lint -- --errors locally to catch formatting errors earlier.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

src/js/tech/html5.js Outdated Show resolved Hide resolved
Copy link
Member

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

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

Another small comment but this looks good to me. I'd have to test it. Also, I'm looking into #6330 which seems to stem from the original implementation of this but if things need to change I'll try to base it off of this PR assuming things look good.

src/js/tech/html5.js Outdated Show resolved Hide resolved
@gkatsev
Copy link
Member

gkatsev commented Dec 20, 2019

also, I wonder if the issue is also just #6330, though, the changes here are good.

Copy link
Author

@klipstein klipstein left a comment

Choose a reason for hiding this comment

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

@gkatsev I strongly believe that #6330 describes a similar problem. The only thing that concerns me though, is, that stalled / suspend could happen within a timeframe of 14s, as reported in #6330. Maybe the iOS headphone disconnect is in general too intrusive and not robust enough yet.

In case this pull doesn't solve #6330 I would suggest to disable this iOS headphone disconnect check and introduce a new config option where this can be enabled. Or alternatively finding a better way how this disconnect could be identified in a more robust fashion. What do you think?

@gkatsev
Copy link
Member

gkatsev commented Dec 20, 2019

Yeah, I'm looking into that one. It's definitely possible that we may want to revert that change. Though, I'm thinking that maybe the change we may want to pause if we don't continue playback. Unfortunately, locally, when unplugging headphones I'm not getting any events but I see that Video.js is in a playing state.

@klipstein
Copy link
Author

@gkatsev reverting would also fix my initial problem. Feel free to close my pull in case you revert the previous change.

@gkatsev
Copy link
Member

gkatsev commented Dec 20, 2019

yeah, I would recommend sticking with Video.js 7.6.6 for now. If we end up keeping the change I'm definitely going to merge this in because it's a nice improvement but it looks more and more like we may want to revert that change.

@gkatsev
Copy link
Member

gkatsev commented Dec 23, 2019

I think we're going to revert the change and be done with it. Really appreciate the PR, though. Thanks!

@gkatsev gkatsev closed this Dec 23, 2019
@gkatsev
Copy link
Member

gkatsev commented Dec 24, 2019

7.7.4 is released with the reverted change.

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

Successfully merging this pull request may close these issues.

None yet

3 participants