<!--
{
  "availability" : [
    "iOS: 3.2.0 - 9.0.0",
    "iPadOS: 3.2.0 - 9.0.0",
    "macCatalyst: 13.1.0 - 13.1.0"
  ],
  "documentType" : "symbol",
  "framework" : "MediaPlayer",
  "identifier" : "/documentation/MediaPlayer/MPMoviePlayerController/init(contentURL:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Media Player"
    ],
    "preciseIdentifier" : "c:objc(cs)MPMoviePlayerController(im)initWithContentURL:"
  },
  "title" : "init(contentURL:)"
}
-->

# init(contentURL:)

Returns a `MPMoviePlayerController` object initialized with the movie at the specified URL.

```
init!(contentURL url: URL!)
```

## Parameters

`url`

The location of the movie file. This file must be located either in your app directory or on a remote server.

## Return Value

The movie player object.

## Discussion

This method initializes a movie player, but does not prepare it for playback. To prepare a new movie player for playback, call the [`prepareToPlay()`](/documentation/MediaPlayer/MPMediaPlayback/prepareToPlay()) method, described in [`MPMediaPlayback`](/documentation/MediaPlayer/MPMediaPlayback).

To be notified when a new movie player is ready to play, register for the [`MPMoviePlayerLoadStateDidChangeNotification`](/documentation/MediaPlayer/MPMoviePlayerLoadStateDidChangeNotification) notification. You can then check load state by accessing the [`loadState`](/documentation/MediaPlayer/MPMoviePlayerController/loadState) property.

To check for errors in URL loading, register for the [`MPMoviePlayerPlaybackDidFinishNotification`](/documentation/MediaPlayer/MPMoviePlayerPlaybackDidFinishNotification) notification. On error, this notification contains an <doc://com.apple.documentation/documentation/Foundation/NSError> object available using the `@"error"` key in the notification’s `userInfo` dictionary.

---

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)