-
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 a Promise From play() when possible #3927
Comments
This was actually a question at the meetup yesterday: would we support a polyfill or creating our own promise. So, that's a vote in this direction, I'd say. |
Yup, I don't want to write our own promise implementation :) |
Sorry, I meant we'd return a Promise as @brandonocasey is suggesting - not "create our own". Poor phrasing. 😆 |
Is there any update on this? |
@shikkaba in Video.js v6, we already are returning a Promise from |
@gkatsev Thank you for the reply. I'm just wondering because in Chrome I'm seeing the following: |
@gkatsev videojs 7 does not return the native promise result from play() |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Actually, re-opening this one for the follow-up work for IE11 and browsers that don't return a |
@gkatsev Any update on this? 🙂 We have some issues with play() not being resolved on Smart TVs (LG, Tizen) and older browsers (IE 11). Not awaiting Promise is, in some cases, causing other errors, like:
Example stack trace from one of our errors: This is not happening if we |
So, looks like this issue should be closed. At some point we did add promise support for older browsers. However, you must either provide videojs with a promise polyfill or include a promise polyfill globally on those platforms. @Puritanic can I ask you to open a new issue with more info filled out in the issue template? Like video.js versions and preferably a reduced test case. |
Description
There is currently a PR (#3907) that returns the native value of play to the user. In some cases (such a newer version of Chrome) this will be a Promise.
I think that we should try to always return a Promise if the browser supports them or a Promise library is provided (
window.Promise || this.options_.Promise
). This means that we will return the native Promise fromplay()
if it is returned and return a "psuedo-native" Promise ifplay()
does not return a Promise.We will also have to be mindful of browsers that don't support promises at all and the specification for Promises from play.
The text was updated successfully, but these errors were encountered: