You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libraries/CommunityToolkit.Maui.MediaElement/Views/MediaManager.android.cs
+28-37Lines changed: 28 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
usingSystem.Diagnostics;
2
2
usingSystem.Diagnostics.CodeAnalysis;
3
+
usingSystem.Linq;
3
4
usingAndroid.Content;
4
5
usingAndroid.Views;
5
6
usingAndroid.Widget;
@@ -39,6 +40,7 @@ public partial class MediaManager : Java.Lang.Object, IPlayerListener
39
40
40
41
/// <summary>
41
42
/// The platform native counterpart of <see cref="MediaElement"/>.
43
+
/// Null in headless mode (audio-only, no view required).
42
44
/// </summary>
43
45
protectedPlayerView?PlayerView{get;set;}
44
46
@@ -126,58 +128,47 @@ or PlaybackState.StateSkippingToQueueItem
126
128
127
129
/// <summary>
128
130
/// Creates the corresponding platform view of <see cref="MediaElement"/> on Android.
131
+
/// Modified for headless (audio-only) playback - no TextureView/Surface required.
129
132
/// </summary>
130
133
/// <returns>The platform native counterpart of <see cref="MediaElement"/>.</returns>
131
134
/// <exception cref="NullReferenceException">Thrown when <see cref="Context"/> is <see langword="null"/> or when the platform view could not be created.</exception>
thrownewInvalidOperationException("Cannot create ExoPlayer - MauiContext.Context is null. Ensure bootstrap has completed before calling PrepareAndPlayAsync.");
0 commit comments