У меня есть AVPlayer с AVPlayerItem. Я хочу отключить воспроизведение звука с AVPlayer. Я хочу воспроизвести только видео.
Может кто-нибудь мне помочь? Спасибо!
self.avPlayerItem = [AVPlayerItem playerItemWithURL:self.videoUrl];
self.avPlayer = [AVPlayer playerWithPlayerItem:self.avPlayerItem];
[self.avPlayer play];
self.avPlayer.actionAtItemEnd = AVPlayerActionAtItemEndNone;
self.avPlayerLayer = [AVPlayerLayer playerLayerWithPlayer:self.avPlayer];
self.avPlayerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playerItemDidPlayToEndTime:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:self.avPlayerItem];
CGRect screenRect = [[UIScreen mainScreen] bounds];
self.avPlayerLayer.frame = CGRectMake(0, 0, screenRect.size.width , screenRect.size.height );
[self.view.layer insertSublayer:self.avPlayerLayer atIndex:0];