<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVSystemRouting",
  "identifier" : "/documentation/AVSystemRouting/AVSystemRouteSession-gp78/init(url:mode:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AVSystemRouting"
    ],
    "preciseIdentifier" : "s:15AVSystemRouting0A12RouteSessionC3url4modeAC10Foundation3URLV_AA0aC0C10LaunchModeOtcfc"
  },
  "title" : "init(url:mode:)"
}
-->

# init(url:mode:)

Creates a session for initiating playback on a remote device.

```
init(url: URL, mode: AVSystemRoute.LaunchMode)
```

## 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
([`AVSystemRoute.LaunchMode.application`](/documentation/AVSystemRouting/AVSystemRoute-5s2um/LaunchMode/application)) or the system media player
([`AVSystemRoute.LaunchMode.player`](/documentation/AVSystemRouting/AVSystemRoute-5s2um/LaunchMode/player)) on the remote device.

## Discussion

Initialize a session with the media URL and launch mode before adding it to an [`AVSystemRoute`](/documentation/AVSystemRouting/AVSystemRoute-5s2um).
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.

> Note: After creating a session, you must add it to an ``doc://com.apple.avsystemrouting/documentation/AVSystemRouting/AVSystemRoute-5s2um`` using ``doc://com.apple.avsystemrouting/documentation/AVSystemRouting/AVSystemRoute-5s2um/addSession(_:)``
> before calling ``doc://com.apple.avsystemrouting/documentation/AVSystemRouting/AVSystemRouteSession-gp78/start()``.

---

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)