0
내 앱은 5 개의 다른 버튼을 탭하여 5 개의 짧은 비디오 (앱에 저장 됨)를 재생합니다. 나는 모든 비디오를 연속적으로 재생하는 "모두 재생"버튼을 갖고 싶습니다.모든 로컬 비디오를 연속적으로 재생하는 방법
-(IBAction)playVideo1;
{
NSURL *videoURL = [[NSBundle mainBundle]URLForResource:@”video1” withExtension:@"mp4"];
AVPlayer *player = [AVPlayer playerWithURL:videoURL];
AVPlayerViewController *controller = [[AVPlayerViewController alloc]init];
controller.player = player;
[player play];
[self presentViewController:controller animated:YES completion:nil];
controller.view.frame = self.view.frame;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playerItemDidReachEnd:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:_currentItem];
}
참조이 https://developer.apple.com/documentation/avfoundation/avqueueplayer https://developer.apple.com/ :
여기에 사용 AVQueuePlayer 시퀀스에서 비디오를 재생하는 방법 library/content/samplecode/AVFoundationQueuePlayer-iOS/소개/Intro.html – karthikeyan
감사합니다. @karthikeyan. 그러나 그것은 나를 위해 약간 너무 진보했다. 나는 이것에 초심자이다. 특정 코드로 나를 도울 수 있다고 생각하십니까? – Emily94
다음 링크를 통해 이동하십시오 : https://developer.apple.com/library/content/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/02_Playback.html – Mukesh