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

fix firefox bug in videoautoplay, ensure check happens after a tick #1150

Merged
merged 1 commit into from
Dec 11, 2013

Conversation

patrickkettner
Copy link
Member

fixes #1095

few things done here.

  1. Removed incorrect notes section (must have copied it from the animation test - thats embarrassing)
  2. firefox was erring out because it requires removeEventListener to be called with the listener function
  3. delay the actual listener attachment for a tick. this fixes the inaccurate test results for me everywhere. seems like there wasn't enough breathing room in some situations between adding the element, and the listeners firing
  4. firefox triggers a playing event when the time is === 0, so I added an optional argument that sets the test to true if it is called from the playing event listener.

@kristerkari
Copy link
Contributor

This PR fixes my problem with Firefox - #1095

However, when I run the autoplay test I can sometimes see the video flash before the page is loaded.

This can be fixed for example by setting visibility to hidden elemStyle.visibility = 'hidden';.

@patrickkettner
Copy link
Member Author

ah, that would be a great idea. I'll append it to this since it is a bit of a catchall bug.

@kristerkari
Copy link
Contributor

I can see the video flashing on Chrome too :) But at least this PR makes the test always return correct result on newest Chrome/FF.

patrickkettner added a commit that referenced this pull request Dec 11, 2013
fix firefox bug in videoautoplay, ensure check happens after a tick
@patrickkettner patrickkettner merged commit 703a359 into Modernizr:master Dec 11, 2013
@patrickkettner patrickkettner deleted the moar-vidoe-fixes branch December 11, 2013 02:21
patrickkettner added a commit to patrickkettner/Modernizr that referenced this pull request Feb 22, 2015
fix firefox bug in videoautoplay, ensure check happens after a tick
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.

HTML5 Video autoplay test does not give reliable results
2 participants