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

Chunks are not being refreshed with new Manifest response's SegmentTemplates. #6996

Open
baturays opened this issue Jul 7, 2024 · 13 comments
Labels
type: question A question from the community

Comments

@baturays
Copy link

baturays commented Jul 7, 2024

Have you read the Tutorials?

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

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

What version of Shaka Player are you using?
2.5.23

What browser and OS are you using?
MacOs, Firefox

Please ask your question

Hello,

I am currently playing a live channel using DASH and for additional security, I am adding some search parameters to the new manifest requests. As a response to the manifest request, I receive new segments and a new token parameter within the media object. However, while the ts chunks are being downloaded, the token parameter appended to the media chunks from the initial manifest request is still being used.

In short:

  1. I am using Shaka Player to play a live DASH stream.
  2. I add some search parameters (e.g., st, ts, e) to new manifest requests.
  3. The server returns a new manifest with updated st tokens within the SegmentTemplate elements.
    However, Shaka Player continues to use the old st tokens from the initial manifest request when downloading segment chunks.
    How can I ensure that Shaka Player uses the new st tokens for segment chunks after a new manifest is loaded? What would be the best approach to solve this issue?
@baturays baturays added the type: question A question from the community label Jul 7, 2024
@avelad
Copy link
Member

avelad commented Jul 8, 2024

You are using an unsupported and very old version. I'm sure this has been resolved in newer versions, can you try 4.10.2? Thanks!

@avelad avelad added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jul 8, 2024
@baturays
Copy link
Author

Hello, I upgraded the Shaka version to 4.10.2 as you suggested, but the problem is still not fixed. Even though a new MPD request is made, it continues to read the old manifest file.

@avelad
Copy link
Member

avelad commented Jul 10, 2024

Can you send your manifest url to test it?

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jul 10, 2024
@avelad avelad added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jul 10, 2024
@baturays
Copy link
Author

Hello, this manifest URL is closed to the outside due to company policy and cannot be accessed externally.

Maybe if you can provide me with a sample content, I can test it on my end to see if the transition works correctly.

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

avelad commented Jul 10, 2024

We do not have content with these characteristics. Since you can't provide an example to help you, we'd be happy to review your PR in case you want to contribute to fixing this. I'm sorry!

@avelad avelad closed this as completed Jul 10, 2024
@baturays
Copy link
Author

Hello, as you mentioned, I updated the Shaka version and continued testing. After MPD refreshes, it continues to download chunks from the old mode, and after a while, it switches to the new MPD after receiving a 410 error from the existing mode and continues downloading chunks. However, after a while, it encounters issues during these transitions and fails to switch to the new mode. Is there a configuration we can use to force the player to switch to the new MPD after receiving it?

@baturays
Copy link
Author

Hi @avelad , i am waiting for your response. Thanks.

@baturays
Copy link
Author

@shaka-bot reopen

@shaka-bot shaka-bot reopened this Jul 25, 2024
@baturays
Copy link
Author

Here i am sharing my registerRequestFilter function , to update header parameters with new ones .

MTC.registerRequestFilterFunction = (type, request) => {
const requestType = playerMethods.getRequestTypes();
if (type === requestType.MANIFEST) {
request.uris.forEach((uri, index) => {
if (isMpdRequest(uri)) {

            let tokenParams = {};
            try {
                tokenParams = prepareTokenParams();
            } catch (error) {
                console.warn("Token creation error on registerRequestFilter: ", error);
                return;
            }

            const { sample } = tokenParams;
            const urlObj = new URL(uri);
            
            const paramsToDelete = ["sample"];
            paramsToDelete.forEach(param => {
                if (urlObj.searchParams.has(param)) {
                    urlObj.searchParams.delete(param);
                }
                delete request.headers[param];
            });

            request.headers["sample"] =  sample;
            request.uris[index] = urlObj.href;
        }
    });
}

}

I observe that request.uris is growing in size after each call, even if i have only 1 uri in the beginning.

@avelad
Copy link
Member

avelad commented Aug 19, 2024

So I understand that you have solved the problem with your filter. The growth of the uris size is expected if you frequently change the final url of the mpd (including tokens)

@avelad avelad added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Aug 19, 2024
@shaka-bot
Copy link
Collaborator

Closing due to inactivity. If this is still an issue for you or if you have further questions, the OP can ask shaka-bot to reopen it by including @shaka-bot reopen in a comment.

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Aug 26, 2024
@baturays
Copy link
Author

baturays commented Sep 9, 2024

@shaka-bot reopen

@baturays
Copy link
Author

baturays commented Sep 9, 2024

I reopened the topic because I want to ask something. I upgraded my Shaka Player version to 4.10.2. What I want to ask is: In dynamic manifest requests, after each manifest request, shouldn't it continue with the updated data from the manifest (segment templates)? What I see is that even though manifest requests are made, the new segments from the updated manifest are not immediately used. I also noticed that sometimes, when a 410 is received from the server, it automatically switches to one of the next manifests, but this is not stable. I couldn't understand how it decides which manifest to switch to. In short, my question is, after each manifest request, can we ensure that Shaka continues with the latest manifest? Or, based on which tags or properties does Shaka make decisions during these transitions in the response?

@shaka-bot shaka-bot reopened this Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question A question from the community
Projects
None yet
Development

No branches or pull requests

3 participants