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
This happens on my case when the previous page has another running Android Service, but I think it has nothing to do with it, rather, the Android Notification in MediaControlsService setup seems to be modifying the Action object behavior even before the Notification object has been configured.
There is a similar issue in StackOverflow, that seems to back up my claim on this and the solution was to add the Actions first before configuring it.
Expected Behavior
When another Android Service is running, the MediaControlsService shouldn't crash the app. A simple code example like the code below should also be expected to run without issues:
publicstaticclassMauiProgram{publicstaticMauiAppCreateMauiApp(){varbuilder=MauiApp.CreateBuilder();builder.UseMauiApp<App>().UseMauiCommunityToolkit().UseMauiCompatibility().UseScreenRecording()// The other Android Service.UseMauiCommunityToolkitMediaElement();// MediaControlsService// ...}}
AndroidManifest.xml
<!-- other things --><!-- Video Player -->
<serviceandroid:name="communityToolkit.maui.media.services"android:exported="false"android:enabled="true"android:foregroundServiceType="mediaPlayback">
<intent-filter>
<actionandroid:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
<intent-filter>
<actionandroid:name="androidx.media3.session.MediaSessionService"/>
</intent-filter>
</service>
</application>
<uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permissionandroid:name="android.permission.INTERNET" />
<uses-permissionandroid:name="android.permission.CAMERA" />
<uses-permissionandroid:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permissionandroid:name="android.permission.RECORD_AUDIO" />
<uses-permissionandroid:name="android.permission.FOREGROUND_SERVICE" />
<uses-permissionandroid:name="android.permission.POST_NOTIFICATIONS" />
<uses-permissionandroid:name="android.permission.MEDIA_CONTENT_CONTROL" />
<!-- This one is only needed when targeting API 34 and up -->
<uses-permissionandroid:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
The following XAML code produces a crash on my Android Tablet device:
This happens on my case when the previous page has another running Android Service, but I think it has nothing to do with it, rather, the Android Notification in MediaControlsService setup seems to be modifying the Action object behavior even before the Notification object has been configured.
There is a similar issue in StackOverflow, that seems to back up my claim on this and the solution was to add the Actions first before configuring it.
Expected Behavior
When another Android Service is running, the
MediaControlsService
shouldn't crash the app. A simple code example like the code below should also be expected to run without issues:Page.xaml
MauiProgram.cs
AndroidManifest.xml
Steps To Reproduce
MediaElement
MediaElement
, it would crashLink to public reproduction project repository
https://github.com/mr5z/Repro-Maui.MediaElement.ScreenRecording
Environment
Anything else?
The text was updated successfully, but these errors were encountered: