Skip to content
pubscout

flutter_media_session

3.2.1, released 3 days ago by wyrin.dev

Flutter plugin for OS media integration across Android, iOS, macOS, Windows, Linux, and Web

WASM-ready
$ flutter pub add flutter_media_session
Source repository

What it does

Synchronizes media metadata, playback state, and hardware media buttons with the operating system’s media hub. It provides a lightweight API that can be wired to any audio player via adapters.

AI-written summary of version 3.2.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need lock‑screen or notification controls for background audio
  • You want a single API for all major platforms
  • You already have a custom audio player and need OS integration

Skip it when

  • You only need a simple audio player without OS controls
  • You are building a web‑only app that doesn’t use media session API

Strengths

  • Cross‑platform OS integration
  • Adapter pattern for any player
  • Configurable notification action layout
  • Background keep‑alive support

Weaknesses

  • Requires native setup on each platform
  • No built‑in audio playback
  • Some platforms need extra permissions

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
2

Add required permissions in iOS Info.plist and AndroidManifest.xml; request notification permission on Android 13+; optional Windows AUMID setup for packaged apps; Linux needs build dependencies (clang, cmake, etc.)

import 'package:flutter_media_session/flutter_media_session.dart';
final session = FlutterMediaSession();
await session.activate();
// Bind to a player adapter when ready

Alternatives

Packages that do the same job and could replace flutter_media_session.

Works with

Packages commonly used together with flutter_media_session: ones it builds on, ones built on it, and its own family.