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

Allow change position after MediaEnded event #1315

Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d4ba3fb
Allow change position after MediaEnded event
niksedk Jul 31, 2023
f7302ce
Merge branch 'main' into feature/Allow-change-position-after-media-en…
niksedk Jul 31, 2023
d1d4d7c
Also allow position change after "Stop"
niksedk Aug 2, 2023
15fb970
Merge branch 'feature/Allow-change-position-after-media-ended-event' …
niksedk Aug 2, 2023
202498f
Clear/stop timer when media source is set to null
niksedk Aug 3, 2023
d9ff401
Merge branch 'main' into feature/Allow-change-position-after-media-en…
niksedk Aug 3, 2023
86ac4b8
Merge branch 'main' into feature/Allow-change-position-after-media-en…
niksedk Aug 3, 2023
936db93
Remove unneeded check
niksedk Aug 3, 2023
605802b
Merge branch 'feature/Allow-change-position-after-media-ended-event' …
niksedk Aug 3, 2023
3323d3b
Merge branch 'main' into feature/Allow-change-position-after-media-en…
niksedk Aug 4, 2023
43b4368
Merge branch 'main' into feature/Allow-change-position-after-media-en…
brminnick Aug 17, 2023
c15b268
Merge branch 'main' into feature/Allow-change-position-after-media-en…
niksedk Aug 18, 2023
813c207
Move `ClearTimer` to `OnSourcePropertyChanged`
niksedk Aug 18, 2023
30b07b1
Merge branch 'main' into feature/Allow-change-position-after-media-en…
niksedk Aug 25, 2023
7658e86
Merge branch 'main' into feature/Allow-change-position-after-media-en…
brminnick Aug 27, 2023
84202ba
Merge branch 'main' into feature/Allow-change-position-after-media-en…
brminnick Sep 7, 2023
06e37fa
Merge branch 'main' into feature/Allow-change-position-after-media-en…
jfversluis Sep 7, 2023
e9fff79
Merge branch 'main' into feature/Allow-change-position-after-media-en…
jfversluis Sep 8, 2023
781180f
Merge branch 'main' into feature/Allow-change-position-after-media-en…
jfversluis Sep 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/CommunityToolkit.Maui.MediaElement/MediaElement.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ public void Pause()
/// <inheritdoc cref="IMediaElement.Play"/>
public void Play()
{
InitializeTimer();
OnPlayRequested();
Handler?.Invoke(nameof(PlayRequested));
}
Expand All @@ -372,14 +371,12 @@ public void SeekTo(TimeSpan position)
/// <inheritdoc cref="IMediaElement.Stop"/>
public void Stop()
{
ClearTimer();
OnStopRequested();
Handler?.Invoke(nameof(StopRequested));
}

internal void OnMediaEnded()
{
ClearTimer();
jfversluis marked this conversation as resolved.
Show resolved Hide resolved
CurrentState = MediaElementState.Stopped;
eventManager.HandleEvent(this, EventArgs.Empty, nameof(MediaEnded));
}
Expand Down Expand Up @@ -471,6 +468,8 @@ void OnSourceChanged(object? sender, EventArgs eventArgs)

void OnSourcePropertyChanged(MediaSource? newValue)
{
ClearTimer();

if (newValue is not null)
{
newValue.SourceChanged += OnSourceChanged;
Expand Down