- (void)playVideoInteractionNarration:(NSString *)vNarr{
[self pauseActionExecution];
NSURL *u = [NSURL fileURLWithPath:vNarr];
AVQueuePlayer *player = [[AVQueuePlayer alloc] initWithURL:u];
self.controller = [[AVPlayerViewController alloc]init];
controller.player = player;
controller.showsPlaybackControls=NO;
[controller.player setActionAtItemEnd:AVPlayerActionAtItemEndAdvance];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(videoNarrationFinishedPlaying:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:player.currentItem];
//NSLog(@"MPVIDEOOOOOOO %@", player);
[controller.player setVolume:1.0];
[controller.player setMuted:NO];
[controller setViewInCurrentController];
[controller.player play];
}
- (void)videoNarrationFinishedPlaying:(NSNotification *) aNotification{
AVPlayerItem * item = [aNotification object];
[self.controller removeViewInCurrentController];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:AVPlayerItemDidPlayToEndTimeNotification
object:item];
[self.controller.player pause];
[self.controller release];
[self playActionExecution];
}
視頻開始和完成正確但沒有聲音 爲什麼?AVQueuePlayer播放但沒有聲音
你測試是在設備或模擬器應用程序? –
沒有在設備上... –
有沒有設備振動模式?或在聲音中,然後增加您的默認聲音 –