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

VideoJS 7 fails to return the native play promise #5218

Closed
KevinBrogan opened this issue May 29, 2018 · 3 comments
Closed

VideoJS 7 fails to return the native play promise #5218

KevinBrogan opened this issue May 29, 2018 · 3 comments

Comments

@KevinBrogan
Copy link
Contributor

KevinBrogan commented May 29, 2018

Description

VideoJS 7 fails to return the native play promise.

Steps to reproduce

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Video Player</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/video.js/7.0.3/video-js.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/video.js/7.0.3/video.min.js"></script>
<style>
.video-js
{
	width: 320px;
	height: 180px;
}
</style>
</head>
<body>
<video controls id="vid" class="video-js">
	<source src="//mirrors.standaloneinstaller.com/video-sample/dolbycanyon.mp4">
</video>
<script>
	videojs(vid,{},function(){console.log(this.play())});
</script>
</body>
</html>

Results

Expected

console will log the play() promise on both success and failure, on platforms that natively return it

Actual

console logs undefined

Additional Information

versions

videojs

7

browsers

all, tested on chrome

OSes

all

plugins

none

@mister-ben
Copy link
Contributor

The problem is calling play() between ready and loadstart. In this case, that play() returns nothing and play is attempted again on loadstart.

https://github.com/videojs/video.js/blob/v7.0.3/src/js/player.js#L1906

@gkatsev
Copy link
Member

gkatsev commented Jun 6, 2018

We've also started work to try and make sure that a promise is always returned, if Promises are available to us #5227

@gkatsev
Copy link
Member

gkatsev commented Jun 20, 2018

Actually, going to close this specific issue in favor of #3927

@gkatsev gkatsev closed this as completed Jun 20, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants