---
title: "init(player:videoOverlay:)"
framework: avkit
role: symbol
role_heading: Initializer
path: "avkit/videoplayer/init(player:videooverlay:)"
---

# init(player:videoOverlay:)

Creates a video-player user interface for the player object.

## Declaration

```swift
@MainActor @preconcurrency init(player: AVPlayer?, @ViewBuilder videoOverlay: () -> VideoOverlay)
```

## Parameters

- `player`: The player that plays the audiovisual content.
- `videoOverlay`: A closure that returns a VideoOverlay view to present over the player’s video content. This view is fully interactive, but is placed below the system-provided playback controls, and only receives unhandled events.

## See Also

### Creating a video player

- [init(player:)](avkit/videoplayer/init(player:).md)
