← Back to Toolkit Releases
MediaElement v8.0.1: Fix Android Foreground Service Bug
Contributors
CommunityToolkit.Maui.MediaElement v8.0.1
This release fixes a bug when opting-out of the Android Foreground Service.
Initializing MediaElement
Opt-In to Android Foreground Service
To use MediaElement with Background Playback and/or Rich Media Notifications, opt-in to the Android Foreground Service when initializing CommunityToolkit.Maui.MediaElement:
.UseMauiCommunityToolkitMediaElement(isAndroidForegroundServiceEnabled: true, static options =>
{
options.SetDefaultAndroidViewType(AndroidViewType.TextureView);
})
Opt-out of Android Foreground Service
To use MediaElement without Background Playback and/or Rich Media Notifications, opt out of the Android Foreground Service when initializing CommunityToolkit.Maui.MediaElement:
.UseMauiCommunityToolkitMediaElement(isAndroidForegroundServiceEnabled: false, static options =>
{
options.SetDefaultAndroidViewType(AndroidViewType.TextureView);
})
What’s Changed
- Fix Android Services not being disabled when set by James Crutchley in https://github.com/CommunityToolkit/Maui/pull/3104
Full Changelog: https://github.com/CommunityToolkit/Maui/compare/6.0.0-camera…8.0.1-mediaelement