Skip to content

Commit

Permalink
Merge pull request #783 from unoplatform/dev/ramr/issue12638-AudioKee…
Browse files Browse the repository at this point in the history
…pPlay

[Gallery][Android] MediaPlayerElement the Audio of the played video keeps on running for the first and third 'show sample' option.
  • Loading branch information
agneszitte authored Jun 22, 2023
2 parents af83c32 + 317d8e0 commit e206907
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ public MediaPlayerElementSample_NestedPage1()
Unloaded += MediaPlayerElementSample_NestedPage1_Unloaded;
}

private void NavigateBack(object sender, RoutedEventArgs e) => Shell.GetForCurrentView().BackNavigateFromNestedSample();
private void NavigateBack(object sender, RoutedEventArgs e)
{
MediaPlayerElementSample1.MediaPlayer.Pause();
Shell.GetForCurrentView().BackNavigateFromNestedSample();
}

private void MediaPlayerElementSample_NestedPage1_Unloaded(object sender, RoutedEventArgs e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ public MediaPlayerElementSample_NestedPage2()
Unloaded += MediaPlayerElementSample_NestedPage2_Unloaded;
}

private void NavigateBack(object sender, RoutedEventArgs e) => Shell.GetForCurrentView().BackNavigateFromNestedSample();

private void NavigateBack(object sender, RoutedEventArgs e)
{
MediaPlayerElementSample2.MediaPlayer.Pause();
Shell.GetForCurrentView().BackNavigateFromNestedSample();
}
private void MediaPlayerElementSample_NestedPage2_Unloaded(object sender, RoutedEventArgs e)
{
MediaPlayerElementSample2.MediaPlayer.Pause();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ public MediaPlayerElementSample_NestedPage3()
Unloaded += MediaPlayerElementSample_NestedPage3_Unloaded;
}

private void NavigateBack(object sender, RoutedEventArgs e) => Shell.GetForCurrentView().BackNavigateFromNestedSample();
private void NavigateBack(object sender, RoutedEventArgs e)
{
MediaPlayerElementSample3.MediaPlayer.Pause();
Shell.GetForCurrentView().BackNavigateFromNestedSample();
}

private void MediaPlayerElementSample_NestedPage3_Unloaded(object sender, RoutedEventArgs e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ public MediaPlayerElementSample_NestedPage4()
Unloaded += MediaPlayerElementSample_NestedPage4_Unloaded;
}

private void NavigateBack(object sender, RoutedEventArgs e) => Shell.GetForCurrentView().BackNavigateFromNestedSample();
private void NavigateBack(object sender, RoutedEventArgs e)
{
MediaPlayerElementSample4.MediaPlayer.Pause();
Shell.GetForCurrentView().BackNavigateFromNestedSample();
}

private void MediaPlayerElementSample_NestedPage4_Unloaded(object sender, RoutedEventArgs e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ private void InitializePlaybackList()
MediaPlayerElementSample5.MediaPlayer.Source = mediaPlaybackList;
}

private void NavigateBack(object sender, RoutedEventArgs e) => Shell.GetForCurrentView().BackNavigateFromNestedSample();

private void NavigateBack(object sender, RoutedEventArgs e)
{
MediaPlayerElementSample5.MediaPlayer.Pause();
Shell.GetForCurrentView().BackNavigateFromNestedSample();
}

private void MediaPlayerElementSample_NestedPage5_Unloaded(object sender, RoutedEventArgs e)
{
Expand Down

0 comments on commit e206907

Please sign in to comment.