New issue
Advanced search Search tips

Issue 883303 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

HTMLMediaElement passes currentTime() to CueTimeline::UpdateActiveCues instead of currentPlaybackPosition()

Reported by mdob...@vewd.com, Sep 12

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36

Example URL:

Steps to reproduce the problem:
This can happen when running video starting at time = x > 0 and containing data cues
1. On HTMLMediaElement::SetReadyState(kHaveMetadata) the officialPlaybackPosition is not updated and therefore CueTimeline::UpdateActiveCues(currentTime()) is called with time 0 (currentTime() <- OfficialPlaybackPosition())
2. If there is a data cue active at time 0 (but not x) at this point it will be placed on active cues list (TextTrack::activeCues()) and can be incorrectly displayed for a while.
3. Finally, on HTMLMediaElement::SetReadyState(kHaveCurrentData) the official playback position will be updated to x and therefore the activeCues will be updated to the "proper" list with UpdateActiveCues.

What is the expected behavior?
On HTMLMediaElement::SetReadyState(kHaveMetadata) the CueTimeline::UpdateActiveCues should be updated with the "real" current playback position (x) instead of 0.

What went wrong?
According to: https://www.w3.org/TR/html51/semantics-embedded-content.html#playing-the-media-resource which is referenced in CueTimeline::UpdateActiveCues, the active cues should be updated according to current playback position (currentPlaybackPosition()). But instead currentTime() is passed to UpdateActiveCues(). And please note that currentTime() is not updated yet when kHaveMetadata arrives. Suggested change is attached.

Did this work before? N/A 

Is it a problem with Flash or HTML5? HTML5

Does this work in other browsers? N/A

Chrome version: 67.0.3396.62  Channel: n/a
OS Version: 
Flash Version: 

Contents of chrome://gpu: 

This problem may not be visible when the playback is started from time=0.
 
kHaveMetadata.diff
1.6 KB Download
Cc: dalecur...@chromium.org mlamouri@chromium.org
Components: -Internals>Media Blink>Media>Track
Seems fine to me, can you submit the diff as a chromium cl?

https://www.chromium.org/developers/contributing-code#TOC-Uploading-a-change-for-review

+mlamouri
Labels: Needs-Milestone

Comment 4 Deleted

One more thought about this problem.
Even when currentPlaybackPosition is used when kHaveCurrentData arrives, I think we still may end up with invalid time (web_media_player_ -> CurrentTime() may not be set up yet).

To be more specific: CueTimeline::UpdateActiveCues is called by HTMLMediaElement::SetReadyState for all states (the cues are updated only for states != HTMLMediaElement::kHaveNothing though). On the other hand, according to "4.7.14.7. Ready states"(https://www.w3.org/TR/html51/semantics-embedded-content.html#media-timeline) the  time marches on steps should only be called for HAVE_ENOUGH_DATA state. So I wonder what is the reason we call it every time we call HTMLMediaElement::SetReadyState.
Suggested alternative change according to the last comment.
883303_patch2.diff
772 bytes Download
Status: Started (was: Unconfirmed)
It seems that this updated change wasn't uploaded into the codereview tool. Could you do this?
Status: Available (was: Started)
This issue has been marked as started, but has no owner. Making available.

Sign in to add a comment