Mute audio tracks of live streams using AVPlayer
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using AVPlayer to play live stream (m3U8 file). It plays perfectly using AVPlayer but I am not able to mute it. I am using following code to mute the audio. NSMutableArray *allAudioParams = [NSMutableArray array]; for (AVPlayerItemTrack *track in _player.currentItem.tracks) { if ([track.assetTrack.mediaType isEqual:AVMediaTypeAudio]) { AVMutableAudioMixInputParameters *audioInputParams = [AVMutableAudioMixInputParameters audioMixInputParameters]; [audioInputParams setVolume:0.0 atTime:kCMTimeZero]; [audioInputParams setTrackID:[track