FlutterMediaSessionPlatform class abstract
The platform-specific interface for FlutterMediaSession.
Platform implementations should extend this class and register themselves with FlutterMediaSessionPlatform.instance.
- Inheritance
-
- Object
- PlatformInterface
- FlutterMediaSessionPlatform
- Implementers
Constructors
- FlutterMediaSessionPlatform()
- Constructs a FlutterMediaSessionPlatform.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
onMediaAction
→ Stream<
MediaAction> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
activate(
) → Future< void> - Activates the media session on the current platform.
-
deactivate(
) → Future< void> - Deactivates the media session on the current platform.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
requestNotificationPermission(
) → Future< bool> - Requests the POST_NOTIFICATIONS permission on Android (33+).
-
setActionLayout(
ActionSlotLayout layout) → Future< void> - Sets the customizable action slot layout for system media controls.
-
setAppId(
String id, {String? displayName, String? iconPath}) → Future< void> - Sets the application identity (App ID / AUMID / DesktopEntry) for the current process.
-
setAutoHandleInterruptions(
bool enabled) → Future< void> - Opts the plugin into handling system audio interruptions (calls, navigation prompts, other apps grabbing audio).
-
setBackgroundKeepAlive(
bool enabled) → Future< void> - Opts the session into a background keep-alive for off-device playback such as casting. Defaults to a no-op on platforms where not implemented.
-
setMediaLibrary(
MediaLibraryChildrenProvider? getChildren) → Future< void> -
Opts into a browsable media library (Android Auto and other Media3 browsers), whose items
getChildrenprovides; null opts out. Has no effect on platforms without media browsers. -
setPauseWhenDucked(
bool enabled) → Future< void> - Pause instead of being ducked when another app speaks briefly (a navigation prompt), for spoken-word content. Has no effect where the platform doesn't duck.
-
setResumptionItem(
MediaLibraryItem? item, Duration position) → Future< void> - A stream of media actions emitted by the current platform. Saves the library item to resume (or clears it with null), kept while the app is closed.
-
setSkipIntervals(
{int forwardSeconds = 10, int backwardSeconds = 10}) → Future< void> - Sets the preferred skip intervals for rewind (backward) and fast-forward (forward) commands.
-
setWindowsAppUserModelId(
String id, {String? displayName, String? iconPath}) → Future< void> - Sets the AppUserModelID for the current process on Windows.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateAvailableActions(
Set< MediaAction> ? actions) → Future<void> - Updates the set of media actions available in system controls.
-
updateMetadata(
MediaMetadata metadata) → Future< void> - Updates the media metadata on the current platform.
-
updatePlaybackState(
PlaybackState state) → Future< void> - Updates the playback state on the current platform.
-
wasStartedInBackground(
) → Future< bool> - Whether the app was started in the background by a media browser (Android Auto) through the shared engine, rather than by the user opening it. False where that can't happen.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ FlutterMediaSessionPlatform
-
The default instance of FlutterMediaSessionPlatform to use.
getter/setter pair