Skip to content

Design Doc: video_player background playback with system media notifications #181595

@Deni-al

Description

@Deni-al

Summary

This design document describes adding system media notification support to the video_player plugin, enabling Flutter developers to display media controls on the lock screen, notification shade (Android), and Control Center (iOS/macOS) when playing video/audio in the background.

Design Doc

flutter.dev/go/video-player-background-playback

Problem Statement

Flutter app developers building media applications expect video/audio playback to continue when the app is backgrounded, with system-level media controls that users are accustomed to from native apps.

Currently, while video_player supports basic background audio via allowBackgroundPlayback, there is no built-in way to:

  • Display media metadata (title, artist, album art) on system UI
  • Provide play/pause/seek controls from lock screen or notification shade
  • Integrate with platform media session APIs

This forces developers to implement complex native code or use third-party packages for a feature that should be part of the core video player experience.

Proposed Solution

Add a new NotificationMetadata class and notificationMetadata parameter to VideoPlayerOptions that enables system media notifications when combined with allowBackgroundPlayback: true.

Platform implementations:

  • Android: Media3 MediaSessionService with foreground service notifications
  • iOS/macOS: MPNowPlayingInfoCenter and MPRemoteCommandCenter
  • Web: Not supported (browser limitations)

Related PR

flutter/packages#10915

See also #62739

Metadata

Metadata

Assignees

No one assigned

    Labels

    📜Issue was posted to Discord. Remove to have the issue reannounced. (For "design doc", "emergency")P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterdesign docTracks a design discussion documentp: video_playerThe Video Player pluginpackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions