AVSystemRouteSession
An object that manages a single media playback session on a remote device.
Declaration
final class AVSystemRouteSessionMentioned in
Overview
AVSystemRouteSession manages a single media playback session on a remote device. Create a session to initiate playback on a connected device, communicate with a remote application, and control the lifecycle of the remote playback experience.
To use a session:
Create an AVSystemRouteSession with a URL and launch mode
Add the session to an AVSystemRoute using addSession(_:)
Start the session with start()
Use the returned AVSystemRouteMediaSession to communicate with the remote device
Call stop() when playback ends to clean up resources
Sessions are single-use. After calling stop(), the session cannot be restarted or added to another route. Create a new AVSystemRouteSession for each new playback.
Reporting Playback Metadata
Report playback metadata to MPNowPlayingInfoCenter to ensure the system displays accurate information about the current media across a person’s devices and in system UI.