File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ internal MediaElementOptions(in MauiAppBuilder builder) : this()
2020 /// <summary>
2121 /// Set Android Foreground Service for MediaElement on construction
2222 /// </summary>
23- internal static bool AndroidForegroundServiceEnabled { get ; private set ; } = false ;
23+ internal static bool AndroidForegroundServiceEnabled { get ; private set ; } = true ;
2424
2525 /// <summary>
2626 /// Set Android View type for MediaElement as SurfaceView or TextureView on construction
Original file line number Diff line number Diff line change @@ -139,27 +139,24 @@ public void UseMauiCommunityToolkitMediaElement_ShouldSetDefaultAndroidViewType(
139139
140140 MediaElementOptions . DefaultAndroidViewType . Should ( ) . Be ( AndroidViewType . TextureView ) ;
141141 }
142- /* Needs to be fixed! If it is run by itself it works, but when run with the rest of the tests it fails.
142+
143143 [ Fact ]
144- public void UseMauiCommunityToolkitMediaElement_ShouldSetAndroidServiceByDefaultToFalse ()
144+ public void UseMauiCommunityToolkitMediaElement_ShouldSetAndroidServiceByDefault ( )
145145 {
146- MediaElementOptions.AndroidForegroundServiceEnabled.Should().Be(false);
147146 var builder = MauiApp . CreateBuilder ( ) ;
148147 builder . UseMauiCommunityToolkitMediaElement ( ) ;
149- MediaElementOptions.AndroidForegroundServiceEnabled.Should().Be(false );
148+ MediaElementOptions . AndroidForegroundServiceEnabled . Should ( ) . Be ( true ) ;
150149 }
151- */
150+
152151 [ Fact ]
153- public void UseMauiCommunityToolkitMediaElement_ServiceCanBeEnabled ( )
152+ public void UseMauiCommunityToolkitMediaElement_ServiceCanBeDisabled ( )
154153 {
155- MediaElementOptions . AndroidForegroundServiceEnabled . Should ( ) . Be ( false ) ;
156-
157154 var builder = MauiApp . CreateBuilder ( ) ;
158155 builder . UseMauiCommunityToolkitMediaElement ( static options =>
159156 {
160- options . SetDefaultAndroidForegroundService ( true ) ;
157+ options . SetDefaultAndroidForegroundService ( false ) ;
161158 } ) ;
162- MediaElementOptions . AndroidForegroundServiceEnabled . Should ( ) . Be ( true ) ;
159+ MediaElementOptions . AndroidForegroundServiceEnabled . Should ( ) . Be ( false ) ;
163160 }
164161}
165162#pragma warning restore CA1416
You can’t perform that action at this time.
0 commit comments