-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Do not autoplay if there is no source #2971
Conversation
We probably should make sure that when a source is then added it'll get autoplayed. Does this happen in your testing? We may or may not want to have a similar check inside of |
setSrc() in the Flash tech does check for autoplay and calls play(). The HTML tech just lets the video element deal with it. I've checked and after I call src() the video does automatically play. |
@gkatsev wondering if you have any more comments on this one. |
LGTM. |
The problem with this seems to be that if I have specified |
|
Apologies (And thanks for the heads up). We are supplying multiple sources, and even when only serving the mp4 content we don't see the e.g. of video element: Not working <video class="vjs-tech" preload="auto" aria-hidden="true">
<source src="https://example.com/example.mp4" type="video/mp4">
</video> Working <video class="vjs-tech" preload="auto" aria-hidden="true" src="https://example.com/example.mp4">
<source src="https://example.com/example.mp4" type="video/mp4">
</video> |
Can you open a separate issue for this? Thanks. |
Also, if you can include a working test case on a site like jsfiddle, that would be best. |
Okay - after quite a bit of digging, it appears it has to do with the fact that, if a page is loaded, we have a This then doesn't run the So either this PR should include: if ((this.src() || this.currentSrc()) && this.tag && this.options_.autoplay && this.paused()) {
//...
} Or the Here is an example where autoplay won't work when we have |
Created an issue here #3071 |
This PR prevents the player from calling play() with autoplay and no source. In Firefox this would fire a 'play' event (See http://jsbin.com/vubugev/edit?html,console,output). For some reason this doesn't happen in Chrome.