fix: post seeking notification before initiating AVPlayer seek operation #476
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.
Description of the Changes
Moved the 'seeking' notification to precede the initiation of the AVPlayer seek operation. This change aims to mitigate potential edge cases where the 'seeking' operation could be erroneously called after the 'seeked' notification, ensuring a more accurate sequence of event notifications.
In our release builds, we found a problem where sometimes the 'seeked' event happens before the 'seeking' event. This happens right after we set up the player and try to move to a 'continue watching' position. We couldn't see this issue when we were debugging, but looking closer at the Play-Kit code, we think the issue might be because of the order we send out notifications. This update fixes that by making sure we send the 'seeking' notification before we start the seek. This should stop the 'seeked' event from showing up too early.
Also question about in case failed, are you expecting to do
seeked
event or some new eventseekFailed
CheckLists