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

Treat empty but idle video state as not loading #141

Closed
wants to merge 1 commit into from
Closed

Treat empty but idle video state as not loading #141

wants to merge 1 commit into from

Conversation

bz2
Copy link

@bz2 bz2 commented Oct 25, 2018

Currently when using the preload=none property on a video as a hint
to avoid loading video contents on page load, the overlay is always
a progress spinner. With this change play is shown instead.

Also add tests for existing UA logic around loading status.

Fixes: #132

Currently when using the preload=none property on a video as a hint
to avoid loading video contents on page load, the overlay is always
a progress spinner. With this change play is shown instead.

Also add tests for existing UA logic around loading status.

Fixes: #132
@@ -122,17 +122,26 @@ DefaultPlayer.propTypes = {
video: PropTypes.object.isRequired
};

function isLoading(readyState, networkState, userAgent) {
if (readyState == 0 && networkState == 1) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use strict equality operator ===

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review!

Yes, this could use === though the eslint config of this project doesn't include the eqeqeq rule stating it must, and in practice callers are using the browser enums not null or other complicating values.

This pull request was closed.
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.

Loading Spinner Display Issue
2 participants