fix(youtube): add allowSeekAhead parameter to seekTo command #1722
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related:
Closes: #1714
Description:
Fix YouTube Provider Seek Issues by adding
allowSeekAheadparameterThis PR fixes a critical issue in the YouTube provider where seeking operations (especially
currentTime = 0) would cause the player to get stuck in a "waiting" state or throwUncaught TypeError: K.Wp.o1 is not a functionerrors.Root Cause:
The YouTube iframe API's
seekTo()method requires two parameters:seekTo(seconds, allowSeekAhead). Passing the first parameter, causing YouTube to reject seeks to unbuffered content and leading to corrupted internal state.Here the YouTube documentation.
Changes Made:
setCurrentTime()method to passallowSeekAhead: trueseekTo#remote()method to handleseekTospecially without double-wrapping argumentsKey Fix:
This ensures YouTube receives
player.seekTo(time, true);with the correct parameters, allowing seeks to any position regardless of buffer state.Ready?
Yes - This PR is ready for review. The fix has been tested and resolves the YouTube seeking issues.
Anything Else?