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

This is a seekRange() question. #6467

Open
brodiddev opened this issue Apr 23, 2024 · 3 comments
Open

This is a seekRange() question. #6467

brodiddev opened this issue Apr 23, 2024 · 3 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

@brodiddev
Copy link

brodiddev commented Apr 23, 2024

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?

yes

What version of Shaka Player are you using?
4.5.11

What browser and OS are you using?
chrome Window

Please ask your question

I previously asked the above question regarding CMAF HLS live stream time difference reduction.
I've seen the potential to shorten the lag by adjusting the liveSegmentsDelay option, but the buffer runs out quickly. The buffer was checked with the code below.


logBufferedInfo() {
const position = this.videoElement.currentTime;
let bufferedInfo = { total: 0, played: 0, left: 0 };

for (let i = 0; i < this.videoElement.buffered.length; i++) {
	const start = this.videoElement.buffered.start(i);
	const end = this.videoElement.buffered.end(i);
	const duration = end - start;

	if (start <= position && end > position) {
		bufferedInfo.played += Math.max(0, position - start);
		bufferedInfo.left += Math.max(0, end - position);
	} else if (start > position) {
		bufferedInfo.left += duration;
	} else {
		bufferedInfo.played += duration;
	}

	bufferedInfo.total += duration;
}
const leftFormatted = bufferedInfo.left.toFixed(3);

document.getElementById(
	'logBufferedInfoLabel'
).innerHTML = `Buffer (left/played/total): ${leftFormatted}/${bufferedInfo.played.toFixed(
	3
)}/${bufferedInfo.total.toFixed(3)}`;
}

I have a question here.

  1. Will playing the last segment when loading using the player.seekRange().end() API help reduce time lag?

  2. When liveSegmentsDelay is set to less than 1.5, leftBuffer becomes 0.00 when playing for 2 to 3 minutes, resulting in buffering. Are the configure settings below the optimal settings?

  3. Will Shaka Player help reduce lag when #EXT-X-TARGETDURATION:3 is reduced to 2? I would like to know the relationship between the player and the corresponding tag to shorten the time difference.


this.player.configure({
    streaming: {
        bufferingGoal: 30,
        rebufferingGoal: 5,
        lowLatencyMode: true, 
        startAtSegmentBoundary: true,
        retryParameters: {
	        baseDelay: 1000,
	        timeout: 5000, 
	        maxAttempts: 2,
        },
    },
    manifest: {
        hls: {
	        liveSegmentsDelay: 1.5,
        },
        retryParameters: {
	        baseDelay: 1000, 
	        timeout: 5000,
	        maxAttempts: 2, 
        },
    },

@brodiddev brodiddev added the type: question A question from the community label Apr 23, 2024
@avelad
Copy link
Collaborator

avelad commented Apr 23, 2024

Can try with manifest.hls.useSafariBehaviorForLive = false?

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

May I know why you recommended that option to me?
Why disable Safari's way of finding Live Edge?

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

avelad commented May 8, 2024

The way Sfari works is different, it doesn't let you search on a Live stream. In Shaka we have that functionality enabled by default. But if it is disabled we allow seek on a live stream.

@avelad avelad added the status: waiting on response Waiting on a response from the reporter(s) of the issue label May 8, 2024
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

3 participants