Repository navigation
[MPE][Wasm] Seeking bar can seek only once - #12541
Merged
Merged
Conversation
rafael-rosa-knowcode
marked this pull request as ready for review
June 5, 2023 19:27
Xiaoy312
reviewed
Jun 5, 2023
| if (_mediaPlayer != null) | ||
| { | ||
| _mediaPlayer.PlaybackSession.Position = TimeSpan.FromSeconds(m_tpMediaPositionSlider.Value); | ||
| _wasPlaying = _mediaPlayer.PlaybackSession.IsPlaying; |
Contributor
There was a problem hiding this comment.
we paused the video at the start of drag (ThumbOnDragStarted)
reading from _mediaPlayer.PlaybackSession.IsPlaying will cause the video to never resume (Play) on release
if you want to guarantee that we only change position during pause, you should do somehting like:
if (_mediaPlayer.PlaybackSession.IsPlaying)
{
// on the off chance, ThumbOnDragStarted/ThumbOnDragCompleted desync'd
// we need to ensure the player is paused, while we update the position.
/* edit: idk whats the edge case here, add your explanation above, and delete this line */
_skipPlayPauseStateUpdate = true;
_isScrubbing = true;
_wasPlaying = true;
_mediaPlayer.Pause();
}
// continue with the rest of orginal code...
_mediaPlayer.PlaybackSession.Position = TimeSpan.FromSeconds(m_tpMediaPositionSlider.Value);
if (_wasPlaying)
{
_mediaPlayer.Play();
}
Contributor
Author
There was a problem hiding this comment.
I changed the strategy.
The problem happened when the m_tpMediaPositionSlider.Value was updated.
So while the mouse is on the Thumb or Slider this value is not updated. And back to be updated when leave the slider.
And use your change for the is playing.
So the tapped worked and so did the drag.
Can you validate again?
Member
|
@Mergifyio backport release/stable/4.9 |
Contributor
✅ Backports have been createdDetails
|
jeromelaban
added a commit
that referenced
this pull request
Jun 6, 2023
…4.9/pr-12541 [MPE][Wasm] Seeking bar can seek only once (backport #12541)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
GitHub Issue (If applicable): closes #12531
PR Type
What kind of change does this PR introduce?
What is the current behavior?
There is a loop in the seeking
What is the new behavior?
Now there is no loop on the MediaPlayer
🤖 Generated by Copilot at 3bb1420
This pull request enhances the Uno UI media player on WebAssembly and other platforms by improving the playback state synchronization, the cross-platform compatibility, and the user interaction of the
MediaTransportControlsand theHtmlMediaPlayerclasses. It also removes some unused or redundant code and simplifies the logic in theMediaPlayerExtensionandMediaTransportControls.MediaPlayerfiles.PR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information
Internal Issue (If applicable):