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

playRangeEnd config not working in v4.3.0 #4787

Closed
hiren3897 opened this issue Dec 5, 2022 · 5 comments
Closed

playRangeEnd config not working in v4.3.0 #4787

hiren3897 opened this issue Dec 5, 2022 · 5 comments
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@hiren3897
Copy link

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

What version of Shaka Player are you using?
4.3.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?
demo app

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

What browser and OS are you using?
Chrome, Firefox, Safari

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

What are the manifest and license server URIs?

https://bhaktimarga-vod-p-cdn.hexaglobe.net/vod/20221129193754/playlist.m3u8

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

playRangeStart: 30,
playRangeEnd: 160,

What did you do?

I tried to play an HLS VOD stream with a playRangeStart and playRangeEnd settings.

What did you expect to happen?
To have a presentation timeline according to the play range settings.

What actually happened?

The configuration for setting the playRangeStart and playRangeEnd works perfectly in shaka-player v4.2.x
I clearly have the seekRange of what I am configuring in playRangeStart and playRangeEnd with a timeline.

But since we want to migrate to v4.3.x which has an important feature Lazy-loading of the playlist.
The playRangeStart works as expected but the playRangeEnd is not working as expected, it gives the end duration of the playlist and not according to the playRangeEnd configuration.

also, the presentation timeline has the end range as the playlist's last segment references the whole duration.

The difference from 4.2.x to 4.3.x
In v4.2.x, we have a function parseManifest_

minDuration = Math.min(minDuration, streamInfo.maxTimestamp);

on line 647, I have the correct minDuration as my playRangeEnd

But on v4.3.x since it has been moved to new function called getMinDuration_

https://github.com/shaka-project/shaka-player/blob/v4.3.x/lib/hls/hls_parser.js#L1779

for the first time, I have a log of minDuration same as my playRangeEnd when called in finalizeStreams_

const minDuration = this.getMinDuration_();

then again it is called in determineDuration_ where the minDuration is changed to the last Segment end duration.

this.presentationTimeline_.setDuration(this.getMinDuration_());

In parseManifest_, first the finalizeStreams_ is called then determineDuration_ is called where the playRangeEnd is ignored.

this.finalizeStreams_(streamInfos);

Can you please look into this bug, and let me know where I can make changes to fix.

Thanks

@hiren3897 hiren3897 added the type: bug Something isn't working correctly label Dec 5, 2022
@hiren3897 hiren3897 changed the title playRangeEnd config not working in 4.3 playRangeEnd config not working in v4.3.0 Dec 5, 2022
@github-actions github-actions bot added this to the v4.4 milestone Dec 5, 2022
@hiren3897
Copy link
Author

hiren3897 commented Dec 5, 2022

In the function finalizeStreams_ we are not getting the playRangeEnd as minDuration

streamInfo.stream.segmentIndex.fit(/* periodStart= */ 0, minDuration);

console-log

@hiren3897
Copy link
Author

@avelad @theodab could you please help me to resolve this?

@hiren3897
Copy link
Author

There are many changes from v4.2.x to v4.3.x to debug this issue

In v4.2.x
After we streamInfo.stream.segmentIndex.fit(/* periodStart= */ 0, minDuration); hls_parser.js:L723

we notify the segments to the presentation timeline according to the variants?

    // Now that the content has been fit, notify segments.
    this.segmentsToNotifyByStream_ = [];
    const streamsToNotify = [];
    for (const variant of variants) {
      for (const stream of [variant.video, variant.audio]) {
        if (stream) {
          streamsToNotify.push(stream);
        }
      }
    }
    await Promise.all(streamsToNotify.map(async (stream) => {
      await stream.createSegmentIndex();
    }));
    for (const stream of streamsToNotify) {
      this.segmentsToNotifyByStream_.push(stream.segmentIndex.references);
    }

In v4.3.x it has been modified since we notify the whole stream segment references

this.notifySegmentsForStreams_(streamInfos.map((s) => s.stream));

 notifySegmentsForStreams_(streams) {
    const references = [];
    for (const stream of streams) {
      if (!stream.segmentIndex) {
        // The stream was closed since the list of streams was built.
        continue;
      }
      stream.segmentIndex.forEachTopLevelReference((reference) => {
        references.push(reference);
      });
    }
    this.presentationTimeline_.notifySegments(references);
  }

maybe this could be the issue or maybe when we createSegments !!

At last we have to notify the segments || references only according to the playRangeEnd to the presentation timeline no?

@hiren3897
Copy link
Author

hiren3897 commented Dec 7, 2022

@joeyparrish it was fixed before with your modification but since 4.3.x with Lazy loading, I am facing the same problem
#4068 (#4068)

Also one strange behavior, I observed when I change the resolution then the "playRangeEnd" takes place then when the video is about to end then the playRangeEnd appears in the UI

if I test it with v4.2.x it works perfectly!!

Can you please help me to resolve this

Thanks in advanced

@hiren3897
Copy link
Author

hiren3897 commented Dec 9, 2022

@joeyparrish Did you get time to look at and suggest me something for this issue?

@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Feb 10, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

1 participant