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

getPlayheadTimeAsDate() differs from program time (X-EXT-PROGRAM-DATE-TIME) #5939

Closed
bbert opened this issue Nov 27, 2023 · 5 comments · Fixed by #6059 or #6371
Closed

getPlayheadTimeAsDate() differs from program time (X-EXT-PROGRAM-DATE-TIME) #5939

bbert opened this issue Nov 27, 2023 · 5 comments · Fixed by #6059 or #6371
Assignees
Labels
component: HLS The issue involves Apple's HLS manifest format priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@bbert
Copy link

bbert commented Nov 27, 2023

Have you read the FAQ and checked for duplicate open issues?
Yes

If the problem is related to FairPlay, have you read the tutorial?

Yes

What version of Shaka Player are you using?

4.6.2

Can you reproduce the issue with our latest release version?
Yes

Can you reproduce the issue with the latest code from main?
Yes

Are you using the demo app or your own custom app?
demo app

If custom app, can you reproduce the issue using our demo app?

What browser and OS are you using?
Chrome/Windows

For embedded devices (smart TVs, etc.), what model and firmware version are you using?

What are the manifest and license server URIs?

Sent by email

What configuration are you using? What is the output of player.getConfiguration()?

Default

What did you do?

  1. Load the live manifest
  2. Pause afters some time after playback has started
  3. Open the console and call the getPlayheadTimeAsDate() API method

document.querySelector('video').ui.player_.getPlayheadTimeAsDate()

What did you expect to happen?

The playlist contains the X-EXT-PROGRAM-DATE-TIME tag, and the live content's video displays a timecode synchronized with the X-EXT-PROGRAM-DATE-TIME tag.

The getPlayheadTimeAsDate() should return the same time value as the one displayed on the video.

What actually happened?

The getPlayheadTimeAsDate() returns a value that differs by a few seconds from the real time value displayed on the video, 13 seconds in the following snapshot.

image

As a comparison, here is a snaphost of hls.js (Windows/Chrome):

image

image

And a snapshot of AVPlayer on iOS:

Screenshot 2023-11-27 at 16 03 01

Maybe the problem is related to the issue #4330

@bbert bbert added the type: bug Something isn't working correctly label Nov 27, 2023
@avelad
Copy link
Member

avelad commented Nov 27, 2023

@bbert are you interested on send a PR to fix it? Thanks! (see: https://github.com/shaka-project/shaka-player/blob/main/lib/player.js#L4417)

@shaka-bot shaka-bot added this to the v5.0 milestone Nov 27, 2023
@bbert
Copy link
Author

bbert commented Nov 27, 2023

@avelad I'm not aware enough of source code to try to fix it without introducing any regression.

I had a look but don't understand this part of code:

this.presentationStartTime_ =

#X-EXT-PROGRAM-DATE-TIME seems not be considered to compute timeline presentationStartTime_ used by getPlayheadTimeAsDate().

@avelad avelad added the priority: P2 Smaller impact or easy workaround label Nov 28, 2023
@avelad avelad modified the milestones: v4.7, v5.0 Dec 4, 2023
@avelad
Copy link
Member

avelad commented Jan 9, 2024

@bbert Can you check if #6059 resolves your issue? Thanks!

@avelad avelad added the component: HLS The issue involves Apple's HLS manifest format label Jan 9, 2024
@bbert
Copy link
Author

bbert commented Jan 9, 2024

Hi @avelad, I confirm PR #6059 resolves the issue.
Thanks!

@joeyparrish
Copy link
Member

We are reverting the fix, which caused additional issues.

avelad pushed a commit that referenced this issue Apr 8, 2024
joeyparrish pushed a commit that referenced this issue May 7, 2024
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Jun 1, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Jun 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: HLS The issue involves Apple's HLS manifest format priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
5 participants