-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Return the native Promise from play() #3907
Return the native Promise from play() #3907
Conversation
|
return native play value if possible when play is called
this.tech_.one('loadstart', function() { | ||
this.play(); | ||
}); | ||
return this.techGet_('play'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, this is an interesting case for the techget/techcall dichotomy. play
is still technically a setter, which is why techcall
is used, but we want its return value. I wonder if we need to get rid the the difference. This is particularly important because of how middleware work. We're bubbling techCall
s from the player to the tech and techGet
s from the tech to the player.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think that we should get rid of the difference
} | ||
|
||
return this; | ||
this.tech_.one('loadstart', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's a source but it's of an unknown type, this throws as this.tech_
is undefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should I just wrap the loadstart listener in an if (this.tech_)
check then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.ready()
@mister-ben Could you take another look at this? I think the issue you brought up was addressed. |
Sure, will get a chance to look properly next week. |
so on chrome 62 where native videoTag.play() returns promise this should return promise right? i am asking becouse it does not return anything |
Video.js 6 will, yes. Video.js 5 will not. |
Description
Return a Promise from
play()
originally this was a PR off of #3860 (https://github.com/BrandonOCasey/video.js/pull/4). This has been changed to be standalone.Requirements Checklist