A customizable video player with controls and fullscreen mode
let controller = VideoPlayerController()
controller.videoGravity = .resizeAspectFill
let url = Bundle.main.url(forResource: "Skate", withExtension: "mp4")!
let item = AVPlayerItem(url: url)
controller.load(item: item, autoPlay: true)
let capabilities: VideoPlayerController.Capabilities = [.seek, .fullscreen, .playPause]
let controller = VideoPlayerController(capabilities: capabilities)
var theme = VideoPlayerController.Theme()
theme.backgroundStyle = .plain(.white)
theme.controlsTintColor = .white
let controller = VideoPlayerController(theme: theme)
- Seeking (dragging)
- Seeking (+/- 15s double tap)