Skip to content

Design Doc: video_player background playback with media notifications #181594

@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-media-notifications

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions