initWithURL:mode:
Creates a session for initiating playback on a remote device.
Declaration
- (instancetype) initWithURL:(NSURL *) url mode:(AVSystemRouteLaunchMode) mode;Parameters
- url:
The URL identifying the media content to play. This URL is passed to the remote application or player. For application mode, your remote application receives this URL to handle appropriately (for example, to navigate to specific content). For player mode, the system uses this URL to load media directly.
- mode:
The launch mode determining whether to start your app’s counterpart (Application) or the system media player (Player) on the remote device.
Discussion
Initialize a session with the media URL and launch mode before adding it to an AVSystemRoute. The URL and mode determine how the remote device handles playback — either by launching your app’s counterpart or using the system’s built-in media player.