<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iOSAppExtension: -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NowPlaying",
  "identifier" : "/documentation/NowPlaying/MediaSession/init(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Now Playing"
    ],
    "preciseIdentifier" : "s:10NowPlaying12MediaSessionCyACyxGxcfc"
  },
  "title" : "init(_:)"
}
-->

# init(_:)

Creates a new local Now Playing session.

```
@MainActor init(_ representable: Representable)
```

## Parameters

`representable`

The session representable that supplies content metadata, playback state, and commands.

## Discussion

The session automatically observes the representable and syncs metadata,
commands, and playback state to the system.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)