When I use CallKit in my project, I don't know how to control the speaker button. Other buttons like mute,hang up and so on can be control. When I test my project, I found that the 'AVAudioSession' instance is changed when I tap the speaker button, but the result is unsatisfactory. When I tap once, the speaker button is not changed selected status , sure, speaker is not opened. Twice the speaker button is changed to selected status. But the speaker effect seems to me very strange. I want to know the system mechanism of CallKit framework so that I can modify my code about 'AVAudioSession'. Thanks.
According to https://forums.developer.apple.com/thread/66308
You will have to listen for audio route changes and perform speaker phone actions when the audio route changes to speaker mode.
Related
If this is possible, how can we do that? What methods handle the application opening from the Media Player Command Center?
I know we can handle the playback actions (play, pause, previous, next, etc) in the app.
I'd like to know if it's possible to detect that the app was opened after a user tapped on any area (like the top corner) of the Media Player (as on the screenshot below).
I'm trying to create a web radio application. For now, I'm able to play music from a streaming web radio, even when my application is on background (thanks to Background modes and the AVAudioSession singleton) I would like to know if I would be able, with the AVAudioPlayer class I'm using, to use the device music player to stream my web radio on the device locked screen and control it (see the screenshot I provided as an example) .
Thanks for reading me,
Maƫl
I found an issue to my problem. All I had to do is to use the MPNowPlayingInfoCenter class and to set informations like the song title. The audio controls show themselves automatically when you play sound thanks to the AVAudioSession singleton.
Hi i am building iOS application target iOS 5 and above. I am using MPMoviePlayerController to stream movie file. I that player i want to give airplay support.
According to apple documentation
Default Movie players (iOS 4.3 and later) support wireless movie
playback to AirPlay-enabled hardware such as Apple TV. The movie
player presents a control that allows the user to choose
AirPlay-enabled hardware for playback when such hardware is in range.
It seems that by default it will display airplay button in fullscreen mode if any airplay device is in range. But it is not seems to be happening. I am unable to see airplay button in movie player.
Am i missing something? Please advise.
By default, MPMoviePlayerController enables AirPlay support. If you haven't set it as FALSE. Then, probably you need to check your network or AppleTV's network connection. They need to be in same network (intranet usually).
There is a safe way to detect whether your iOS device is able to find AppleTV. You can double click HOME button, swipe task bar from left to right side, if you can see "Airplay" route button, then you can reach it. Otherwise, you need to check your AppleTV setting to make sure Airplay function is enabled and AppleTV is connected to same network that you iOS device in.
If you are using your own customized video play controller interface, you can embedded the "Airplay" button into your own UI.
MPVolumeView
Having trouble finding the API for the home screen shortcuts when the home button is clicked. My app plays audio and I want those similar shortcuts to pop up like the do for the iPod to give me the option to stop playback.
Can someone just point me to the reference?
This is a good place to start:
Remote Control Events
From the Apple documentation:
Test that your app is properly receiving and handling remote control
events with the Now Playing Controls. These controls are available on
recent iOS devices that are running iOS 4.0 or later. To access these
controls, press the Home button twice, then flick right along the
bottom of the screen until you find the audio playback controls. These
controls send remote control events to the app that is currently or
was most recently playing audio. The icon to the right of the playback
controls represents the app that is currently receiving the remote
control events.
I am working on a VOIP app on iOS. I have encountered some problems when implementing "Ignore incoming ringer" feature. It has the following requirements:
1. Should stop ringer if pressed screen lock or volume button
2. Should stop ringer if mute button is pushed to "mute" state
3. Should not play ringer if mute button is in "mute" state
Since iOS SDK provide no information of the phone's hardware buttons, I can only rely on setting AVAudioSession category. Before playing ringer, I set the category to ambient so screen lock and mute button can stop the audio. But this method cannot satisfy my requirements because app cannot play ringer when in background because ambient category cannot support background audio.
In order to solve this problem, I start playing the ringer in playbackandrecord category to make the audio stream come out and change the category to ambient immediately. Though it can meet my requirements, but this method caused many problems and bugs. For exameple, MPVolumeView cannot display the output devices correctly.
Can anyone provide a more elegant way way to simulate ringer? Or can this be done in iPhone? Since it will be in app store, I cannot use private apis. Thanks in advance.