Muting an AVPlayer playing Http Live Streaming video - ios

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.

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.

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

You can mute the entire audio session using MPMusicPlayerController shared instance.
[[MPMusicPlayerController applicationMusicPlayer ]setVolume:0];

Related

ios Can I use MPMoviePlayerController to play .mp3 url

My app needs to play some music files, like .mp3. I would like to use MPMoviePlayerController because it has implemented all the UI stuff for me, i.e. I do not want to bother implementing progress slide bar and things like this.
I tested to use it to play a .mp3 file and it worked fine but I do not know if it is fine to use it to do this because its name says "movie player" and it seems it is supposed to play a movie. Would apple reject this? Thank you.
For playing audio from a file or memory, AVAudioPlayer is your best option but unfortunately it doesn't support a network stream while MPMoviePlayerController can
From documentation :
An instance of the AVAudioPlayer class, called an audio player,
provides playback of audio data from a file or memory.
Apple recommends that you use this class for audio playback unless you
are playing audio captured from a network stream or require very low
I/O latency.
For the Apple validation I don't think that your application can be rejected because you're using the Media Player Framework to play an audio file. In fact here they explicitly say that you can do just that:
Choose the right technology for your needs:
To play the audio items in a user’s iPod library, or to play local or
streamed movies, use the Media Player framework. Classes in this
framework automatically support sending audio and video to AirPlay
devices such as Apple TV.
Not sure about performance and memory issues though!
Best of luck.

Intercept/modify audio stream on iOS

I am looking at the feasibility of getting the current raw audio stream playing and do stuff with it such as stream it over Bluetooth or equalize it, etc. Is there any way to do this in iOS 8?
For example: apps such as Pandora/Spotify are playing music and I want to access the audio they are playing.
To process audio from another app, that app needs to participate in Inter-App Audio.
I don't know if your example apps do that.

How to create a music player for iPhone/iPad which can buffer and play songs from server?

I want to develop a music player for iPhone/iPad with the functionality:
-Buffer and Play MP3 songs from server(no downloading).
-Play.
-Pause.
-Stop.
-Adjust Volume(Slider).
-Song Status/ Playing time for Song(slider).
-Repeat Song.
-Shuffle Songs.
-In the center of the Music Player there must be eq like dancing bars with song etc.
I am using AVPlayer for this but it is giving me trouble with Adjust Volume,Stop,Song Timers etc. With AVPlayer only play/pause and buffering is working.
Even i have used AVAudioPlayer also and it was working fine with all the functionality i needed but with local files only, may be i don't know any method play songs from server in AVAudioPlayer.
Help me with any suggestions,examples,sample code or tutorial.
Playing an MP3 stream seems like it should be a straightforward task that the Cocoa APIs would handle easily.
see this post Live streaming

HTTP Audio Stream Framework?

I'm in process of creating radio app (tabbed application) to play http://sample.com/listen.m3u
I have used AVFoundation - AVAudioPlayer, AVPlayer and MPMoviePlayer frameworks thus far.
Experiencing difficulties with volume slider (MPVolumeView) / unable to see volume slider.
My question here is what is the best recommended framework to achieve below tasks?
Play m3u http stream, with play, pause and volume slider?
Use AudioStreamer by mattgallagher which is library for audio streaming. According to your requirement, u should use this.
Refer AudioStreamer library.

How to mute mic while Recording using UIImagePickerController?

I am using UIImagePickerController for recording video in one of my application. i have successfully Recorded video. But now i want to mute mic (video without audio) while recording video.
i have searched Alot but not a single clue about it.
please help me about this issue.
is it possible or not. if possible than how.
thanks in advance.
If you want your app to be in app store , then there is no apple approved method to actually mute whole iPhone.There are certain libraries but they are not approved.
Apple's documentation on Audio Session
According to the documentation you can only ask the user to have the phone silenced physically and you can respond to certain audio changes such as other sounds,phone calls, email sounds but you cannot mute programmatically.
Also See this Documentation on Programming in iPhone See the part 3.3 for Audio.(Events that can be accessed and performed in iOS).
You can use AVFoundation framework to record a video without the sound, check at this :
AVFoundation Programming Guide

Resources