This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MediaElement] Removed line that pauses player before setting it to n…
…ull. (#9531) * Removed Pause in MediaElement Dispose method I think the pause is there to stop background playback of the mediaelement, but since the next line also seems to stop it, I removed the line. * removed if app and changed video source * Revert sln This reverts commit 7a8d7d8. Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com> fixes #9525
- Loading branch information
1 parent
2b66939
commit 9f3410b
Showing
3 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue9525.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using System.Collections.Generic; | ||
using System.Reflection; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
#if UITEST | ||
using Xamarin.Forms.Core.UITests; | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
#if UITEST | ||
[Category(UITestCategories.ManualReview)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 9525, "MediaElement Disposing exception when MainPage is changed on iOS", PlatformAffected.iOS)] | ||
public class Issue9525 : TestNavigationPage | ||
{ | ||
protected override void Init() | ||
{ | ||
Device.SetFlags(new List<string>(Device.Flags ?? new List<string>()) { "MediaElement_Experimental" }); | ||
|
||
PushAsync(CreateRoot()); | ||
} | ||
private ContentPage CreateRoot() | ||
{ | ||
var button = new Button | ||
{ | ||
AutomationId = "Issue9525Button", | ||
Text = "Go to new page", | ||
}; | ||
button.Clicked += Button_Clicked; | ||
return new ContentPage | ||
{ | ||
Content = new StackLayout | ||
{ | ||
Children = | ||
{ | ||
new MediaElement | ||
{ | ||
AutomationId = "Issue9525MediaElement", | ||
Source = "https://sec.ch9.ms/ch9/80a3/6563611f-6a39-44fa-a768-1a58bdd080a3/HotRestart.mp4", | ||
HeightRequest=200, | ||
}, | ||
button | ||
} | ||
} | ||
}; | ||
|
||
} | ||
private void Button_Clicked(object sender, System.EventArgs e) | ||
{ | ||
Navigation.InsertPageBefore(CreateRoot(), CurrentPage); | ||
Navigation.RemovePage(CurrentPage); | ||
} | ||
|
||
|
||
#if UITEST | ||
[Test] | ||
public void Issue9525Test() | ||
{ | ||
//Will be exeption if fail. | ||
RunningApp.Screenshot("I am at Issue9525"); | ||
for (var i = 0; i < 10; i++) | ||
{ | ||
RunningApp.WaitForElement(q => q.Marked("Issue9525Button")); | ||
RunningApp.Screenshot("I see the Button"); | ||
RunningApp.Tap("Issue9525Button"); | ||
} | ||
} | ||
#endif | ||
} | ||
} |
This file contains 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
This file contains 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