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

Preload Manager: Configuration and Update Scenarios #8159

Open
AdityaSinghShekhawat opened this issue Feb 25, 2025 · 5 comments
Open

Preload Manager: Configuration and Update Scenarios #8159

AdityaSinghShekhawat opened this issue Feb 25, 2025 · 5 comments
Labels
status: waiting on response Waiting on a response from the reporter(s) of the issue type: question A question from the community

Comments

@AdityaSinghShekhawat
Copy link

Have you read the Tutorials?
Yes

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

If the question is related to FairPlay, have you read the tutorial?
Question is not related to FairPlay.

What version of Shaka Player are you using?
4.11.11

What browser and OS are you using?
All modern browsers like chrome, firefox, safari etc.

Please ask your question
We are creating a reels (verticle videos) kind of platform using single shaka player. We are preloading adjacent videos for smoother experience. Kindly, help me find answer to below question:

  • What all things does preload manager download? Is it segment/s of quality, audio or subtitle or subset of these. This will be helpful in knowing when to trigger preload api for adjacent videos. For e.g.
// Preload data
const previousPreloadManager = await player.preload(url1); // quality -> 720p, audio -> en, subtitle -> en
const currentPreloadManager = await player.preload(url2); // quality -> 720p, audio -> en, subtitle -> en
const nextPreloadManager = await player.preload(url3); // quality -> 720p, audio -> en, subtitle -> en

// Do we need to update previousPreloadManager and nextPreloadManager in following cases ?
// 1. Customer changes quality to 1080p in current video. 
// 2. Customer changes audio to "hi" in current video.
// 3. Customer changes subtitle to "hi" in current video.
@AdityaSinghShekhawat AdityaSinghShekhawat added the type: question A question from the community label Feb 25, 2025
@avelad
Copy link
Member

avelad commented Feb 27, 2025

Currently I don't think we have any API to do what you want, but let @theodab who made this confirm :)

@avelad avelad added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Feb 27, 2025
@AdityaSinghShekhawat
Copy link
Author

@avelad Thanks for the reply. Just to clarify, I want to know what things does preload api downloads? That is, does it download video segments only or does it download audio and subtitles data as well. @theodab can you pls confirm. Thanks in advance. 🙂

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Feb 28, 2025
@avelad
Copy link
Member

avelad commented Feb 28, 2025

I created to improve a bit the preload manager: #8187

It doesn't change how to update (not possible at the moment), but it helps to preload the subtitles and to know which track has been preloaded.

@shaka-bot
Copy link
Collaborator

@AdityaSinghShekhawat Does this answer all your questions? If so, would you please close the issue?

@shaka-bot shaka-bot added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Mar 4, 2025
@joeyparrish
Copy link
Member

@AdityaSinghShekhawat, with @avelad's change, it now preloads audio, video, and text. Previously, it only preloaded audio and video. The goal of preload is to start very quickly by having the first segments cached in memory.


You may disagree, but I don't think it's super important to change the preloaded segments from 720p to 1080p when the currently-playing video changes. And doing something like that may even be harmful to your users in some cases.

If your segments are small, and we're talking about 720p vs 1080p, it won't be very noticeable to the user. For 2s segments, you'll have 2s of data at 720p. And will that be incredibly critical content, or a logo for a TV show? Or fading in from black?

In those 2s, the next segment to be fetched will be based on Shaka's profile of the user's bandwidth. Maybe it's even lower! You could have preloaded 720p segments, but then during playback on a mobile device, find that only 480p is sustainable. You'd really prefer not to waste bandwidth re-downloading that 720p segment at 480p if you're already short on bandwidth.

It's also feasible that during the presentation of a long video, many adaptations are necessary. If you throw away your preloaded segments for future videos every time that happens, you could be wasting a lot.


These are my opinions, and why I would not recommend an API or automatic feature to change the preloaded segments after the fact. Happy to debate it, though, and I've been wrong here many times in the past. 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting on response Waiting on a response from the reporter(s) of the issue type: question A question from the community
Projects
None yet
Development

No branches or pull requests

4 participants