5
votes

I was wondering if I could mute the sound of an AVPlayer playing a HTTP Live Streaming video?

I've already try several things, like the Apple method to set the volume of an AVPlayer explained here but it works only for local files... (cf. the note at the bottom of Apple documentation).

The similar method explained in this post does not working either.

Is there an solution? I really don't want to mute the sound of the device but only one video while other players could have their own audio (the user could balance audio between players).

Thanks in advance.

3

3 Answers

4
votes

iOS 7.0 now provides support for muting the player using

[AVPlayer setVolume:(float)volume] 

It also works for HTTP Live Streaming, my app is making extensive use of it.

1
votes

According to the AVFoundation team, it is impossible to mute or disable a track of an HLS video.

0
votes

You can mute the entire audio session using MPMusicPlayerController shared instance.

[[MPMusicPlayerController applicationMusicPlayer ]setVolume:0];