AVPlayer自动播放

Kel*_*ort 5 macos avplayer

如何在osx autoplay中制作avplayer?

我试过这个:

NSURL *videoURL = [[NSBundle mainBundle]
URLForResource:@"video name" withExtension:@"mp4"];
self.movieView.player = [AVPlayer playerWithURL:videoURL];
Run Code Online (Sandbox Code Playgroud)

它没有自动播放?

dja*_*o-d 8

你还没有调用play方法.

[self.movieView.player play]
Run Code Online (Sandbox Code Playgroud)