File tree Expand file tree Collapse file tree 4 files changed +7
-8
lines changed
Expand file tree Collapse file tree 4 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ public static MauiAppBuilder UseMauiCommunityToolkitMediaElement(this MauiAppBui
3030 {
3131 // Create MediaElementOptions and set the foreground service setting
3232 var mediaElementOptions = new MediaElementOptions ( builder ) ;
33- mediaElementOptions . EnableAndroidForegroundService ( enableForegroundService ) ;
33+ mediaElementOptions . SetAndroidForegroundServiceEnabled ( enableForegroundService ) ;
3434
3535 // Update the default MediaElementOptions for MediaElement if Action is not null
3636 options ? . Invoke ( mediaElementOptions ) ;
Original file line number Diff line number Diff line change @@ -40,5 +40,5 @@ internal MediaElementOptions(in MauiAppBuilder builder) : this()
4040 /// Enable Android Foreground Service for MediaElement
4141 /// </summary>
4242 /// <param name="enabled">True to enable foreground service, false to disable</param>
43- internal void EnableAndroidForegroundService ( bool enabled ) => IsAndroidForegroundServiceEnabled = enabled ;
43+ internal void SetAndroidForegroundServiceEnabled ( bool enabled ) => IsAndroidForegroundServiceEnabled = enabled ;
4444}
Original file line number Diff line number Diff line change @@ -90,7 +90,6 @@ protected virtual void Dispose(bool isDisposing)
9090 // Restore default MediaElementOptions
9191 var mediaElementOptions = new MediaElementOptions ( ) ;
9292 mediaElementOptions . SetDefaultAndroidViewType ( AndroidViewType . SurfaceView ) ;
93- mediaElementOptions . EnableAndroidForegroundService ( true ) ;
9493 isDisposed = true ;
9594 }
9695
Original file line number Diff line number Diff line change @@ -22,16 +22,16 @@ public void EnableAndroidForegroundService_Updates_StaticDefault()
2222
2323 try
2424 {
25- optionsInstance . EnableAndroidForegroundService ( false ) ;
25+ optionsInstance . SetAndroidForegroundServiceEnabled ( false ) ;
2626 MediaElementOptions . IsAndroidForegroundServiceEnabled . Should ( ) . BeFalse ( ) ;
2727
28- optionsInstance . EnableAndroidForegroundService ( true ) ;
28+ optionsInstance . SetAndroidForegroundServiceEnabled ( true ) ;
2929 MediaElementOptions . IsAndroidForegroundServiceEnabled . Should ( ) . BeTrue ( ) ;
3030 }
3131 finally
3232 {
3333 // restore original state to avoid test pollution
34- optionsInstance . EnableAndroidForegroundService ( original ) ;
34+ optionsInstance . SetAndroidForegroundServiceEnabled ( original ) ;
3535 }
3636 }
3737
@@ -67,7 +67,7 @@ public void MediaElement_Initializes_From_MediaElementOptions_Defaults()
6767 {
6868 // change defaults then create a new MediaElement and verify it picked them up
6969 optionsInstance . SetDefaultAndroidViewType ( AndroidViewType . TextureView ) ;
70- optionsInstance . EnableAndroidForegroundService ( false ) ;
70+ optionsInstance . SetAndroidForegroundServiceEnabled ( false ) ;
7171
7272 var mediaElement = new MediaElement ( ) ;
7373
@@ -78,7 +78,7 @@ public void MediaElement_Initializes_From_MediaElementOptions_Defaults()
7878 {
7979 // restore original state
8080 optionsInstance . SetDefaultAndroidViewType ( originalViewType ) ;
81- optionsInstance . EnableAndroidForegroundService ( originalForegroundEnabled ) ;
81+ optionsInstance . SetAndroidForegroundServiceEnabled ( originalForegroundEnabled ) ;
8282 }
8383 }
8484}
You can’t perform that action at this time.
0 commit comments