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

The timelineregionenter event is not being fired in certain scenarios #6711

Closed
littlespex opened this issue May 30, 2024 · 0 comments · Fixed by #6713 or #6724
Closed

The timelineregionenter event is not being fired in certain scenarios #6711

littlespex opened this issue May 30, 2024 · 0 comments · Fixed by #6713 or #6724
Assignees
Labels
priority: P1 Big impact or workaround impractical; resolve before feature release type: bug Something isn't working correctly
Milestone

Comments

@littlespex
Copy link
Collaborator

littlespex commented May 30, 2024

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

What version of Shaka Player are you using?

=4.6.0

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?
Both

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

What browser and OS are you using?

  • Chrome Version 125.0.6422.113 (Official Build) (arm64)
  • Safari Version 17.5 (19618.2.12.11.6)
  • macOS 14.5 (23F79)

For embedded devices (smart TVs, etc.), what model and firmware version are you using?
Also occurs in all embedded devices we've tests

What are the manifest and license server URIs?
Needs a DASH manifest with an <EventStream /> element containing an <Event /> element that has a presentationTime attribute with a value less than 1 second (event.presentationTime / eventStream.timeScale). We are using a sample DAI asset which can be retrieved using the following (this call must be made manually using the DAI API, the DAI SDK does not return manifests with EventStream):

const response = await fetch('https://dai.google.com/ondemand/v1/dash/content/2559737/vid/tos-dash/stream', { method: 'POST' });
const { stream_manifest } = await response.json();

Using this code, a manifest is returned with the following event stream:

<EventStream schemeIdUri="urn:google:dai:2018" timescale="1000">
  <Event presentationTime="100" duration="0" id="0" messageData="google_5906414793205691084" />
  <Event presentationTime="2502" duration="0" id="1" messageData="google_0540800886940427838" />
  <Event presentationTime="4755" duration="0" id="2" messageData="google_0893162168814866347" />
  <Event presentationTime="7507" duration="0" id="3" messageData="google_8684821900996302324" />
  <Event presentationTime="9010" duration="0" id="4" messageData="google_7181487548099206630" />
</EventStream>

What configuration are you using? What is the output of player.getConfiguration()?
Default configuration. The setup code we are using is:

const video = document.querySelector('video');
const response = await fetch('https://dai.google.com/ondemand/v1/dash/content/2559737/vid/tos-dash/stream', { method: 'POST' });
const { stream_manifest } = await response.json();
const player = new shaka.Player();
player.addEventListener('timelineregionenter', (event) => console.log(event.detail.startTime));
player.attach(video);
player.load(stream_manifest);

What did you do?

  • This issue is more easily reproduced on low powered devices, or with network constraints. We are throttling Chrome to: Download: 3000, Upload: 200, Latency: 100
  • Add a listener for the timelineregionenter event before loading the manifest.
  • Start playback

What did you expect to happen?
A timelineregionenter event is dispatched for every <Event /> element in the manifest.

What actually happened?
The first timelineregionenter event does not fire.

Are you planning send a PR to fix it?
Maybe. We aren't sure of the best path forward. Using git bisect we tracked the issue to commit 4425dca2836d4820e7d1b7315d52b67b465cc8ec. Before this commit, the call to createPlayheadObserversForMSE_ in player.js was passed NaN for the startTimeOfLoad argument. After this commit, the argument comes through as Date.now() / 1000. This results in the RegionObserver missing the first event. The trouble we are having is that this change seems to make the following line of code irrelevant, because startTimeOfLoad is now always greater than 0:

const startsPastZero = this.isLive() || startTimeOfLoad > 0;

We don't have a comprehensive understanding of startTimeOfLoad and why it's being used in VOD scenarios. Is it safe to simply alter this line to only check for this.isLive()? Perhaps use the startTime value passed to load() instead of startTimeOfLoad?

@littlespex littlespex added the type: bug Something isn't working correctly label May 30, 2024
@shaka-bot shaka-bot added this to the v4.10 milestone May 30, 2024
littlespex added a commit to cbsinteractive/shaka-player that referenced this issue May 30, 2024
@avelad avelad added the priority: P1 Big impact or workaround impractical; resolve before feature release label May 31, 2024
tykus160 pushed a commit to sky-hugolima/shaka-player-contrib that referenced this issue Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: P1 Big impact or workaround impractical; resolve before feature release type: bug Something isn't working correctly
3 participants