ライブラリからビデオを選択してその URL をプレーヤーに渡すと、「MPMoviePlayerViewController」を使用してビデオを再生する必要があり、約 2 秒間再生されて応答が停止し (対話がまったくない)、コンソールでこれらの行が見つかりました
[MPAVController] Autoplay: Enabling autoplay
[MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)
[MPAVController] Autoplay: Enabling autoplay
[MPCloudAssetDownloadController] Prioritization requested for media item ID: 0
[MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)
[MPAVController] Autoplay: _streamLikelyToKeepUp: 0 -> 1
[MPAVController] Autoplay: Disabling autoplay for pause
[MPAVController] Autoplay: Disabling autoplay
[MPAVController] Autoplay: Disabling autoplay for pause
[MPAVController] Autoplay: Disabling autoplay
[MPAVController] Autoplay: Disabling autoplay for pause
[MPAVController] Autoplay: Disabling autoplay
[MPAVController] Autoplay: Disabling autoplay
[MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 1, on player: 0)
[MPAVController] Autoplay: Enabling autoplay
[MPAVController] Autoplay: Likely to keep up or full buffer: 0
[MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up.
[MPCloudAssetDownloadController] Prioritization requested for media item ID: 0
[MPAVController] Autoplay: Likely to keep up or full buffer: 1
[MPAVController] Autoplay: Enabling autoplay
[MPAVController] Autoplay: _streamLikelyToKeepUp: 0 -> 1
[MPAVController] Autoplay: Enabling autoplay
[MPAVController] Autoplay: Likely to keep up or full buffer: 0
[MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up.
[MPAVController] Autoplay: Enabling autoplay
[MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)
[MPAVController] Autoplay: Enabling autoplay
[MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)
「stackoverflow」にあるものはすべて試しましたが、役に立ちません。解決策を教えてください。
デバイス:iPad-3、バージョン:6.1
提案してください
ここに私がビデオの再生から使用しているコードがあります
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
NSString* mediaType = [info objectForKey:UIImagePickerControllerMediaType];
if([mediaType isEqualToString:(NSString*)kUTTypeMovie])
{
[self playVideoWithURL:[info objectForKey:UIImagePickerControllerMediaURL]];
}
}
- (void)playVideoWithURL:(NSURL*)fileURL
{
if(!self.playerViewController)
{
self.playerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL];
[self.moviePlayerContainer addSubview:self.playerViewController.view];
self.playerViewController.moviePlayer.scalingMode = MPMovieScalingModeNone;
self.playerViewController.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
[self.playerViewController.moviePlayer stop];
}
else
{
self.playerViewController.moviePlayer.contentURL = fileURL;
}
CGRect movieFrame = self.moviePlayerContainer.frame;
movieFrame.origin = CGPointZero;
self.playerViewController.view.frame = movieFrame;
}