Skip to content

🐛 Fix percentage-played when loadedmetadata fires before listener is added#22872

Merged
cvializ merged 4 commits intoampproject:masterfrom
cvializ:fix/video-percentage
Jun 17, 2019
Merged

🐛 Fix percentage-played when loadedmetadata fires before listener is added#22872
cvializ merged 4 commits intoampproject:masterfrom
cvializ:fix/video-percentage

Conversation

@cvializ
Copy link
Copy Markdown
Contributor

@cvializ cvializ commented Jun 17, 2019

Fixes #22701

@alanorozco do you think this will work or are there any concerns with this approach?

// If the video has already emitted LOADEDMETADATA, the event below
// will never fire, so we check if it's already available here.
if (this.hasDuration_()) {
this.calculate_(this.triggerId_);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we don't need to listen for LOADEDMETADATA in this case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh good point, I'll try that

Copy link
Copy Markdown
Member

@alanorozco alanorozco left a comment

Choose a reason for hiding this comment

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

LGTM. Just one question.

@cvializ cvializ merged commit 4494ff2 into ampproject:master Jun 17, 2019
@cvializ cvializ deleted the fix/video-percentage branch June 17, 2019 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

video-percentage-played doesn't trigger

4 participants