IOS 5 No sound when playing video in silent mode using buzztouch app

I made some buzztouch apps for Iphone and Ipads, here is a free example:

http://itunes.apple.com/us/app/lr-basics-free-edition/id497563707?mt=8

I am not very good at code, I have very little reason, so I developed my application using Buzztouch, which, by the way, is amazing!

The only problem I encountered was that the default behavior when playing a video (which was busy in most of my applications, played in tutorials), and if the silent mode is enabled on the iPad or Iphone, there is no sound, I even thought that the volume slider is active, given the user experience that there is an error, and because of this I got some bad reviews, I also write to me about it. I will tell them all they need to do is turn off silent mode and the sound returns, it works every time, but in the meantime I get compliments!

So, here are my questions, is there a simple way in which I can place a property in the generated Buzztouch code that can be easily changed, so that when the video is played, the sound remains, turning off the silent mode.

I really checked 4 or 5 other similar apps for iPhones, including the default Apple app for youtube, the default setting is audio playback, even if quiet mode is on, which gives my client the impression that my app is listening.

I am not a programmer, so please, but as simple as possible in your answer.

Tku is so much for reference.

Serge

+4
source share
3 answers

What you are describing is the default behavior in iOS - when the ringer / silent switch is in silent mode, all sound from your application will be suppressed.

I donโ€™t know about the implementation of this from BuzzTouch, but here is my own solution that I used to get around this for one of my applications that play videos:

MPMoviePlayerViewController *mpvc = [[MPMoviePlayerViewController alloc] initWithContentURL:myVidURL]; ... set up player ... // prevent mute switch from switching off audio from movie player NSError *_error = nil; [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &_error]; [self presentMoviePlayerViewControllerAnimated:mpvc]; 

You will also need to enable the AVFoundation structure for this.

Here is the link where I first found this tip:

http://www.24100.net/2011/05/ignore-ringtone-mute-switch-during-mpmovieplayer-video-playback-ios/

+17
source

In the immediate vicinity of the documentation - iOS has 6 categories of audio connections, of which 3 affect the behavior of the Slient switch:

AVAudioSessionCategoryAmbient or equivalent kAudioSessionCategory_AmbientSound. Using this category, your sound is muted by the Ring / Silent switch when the screen is locked. Used when we want our application sound with integrated application sound

AVAudioSessionCategorySoloAmbient or the equivalent of kAudioSessionCategory_SoloAmbientSound - use this category for the application whose sound you want to turn off when the user switches the Ring / Silent switch to the silent position and when the screen locks. This is the default category.

AVAudioSessionCategoryPlayback or the equivalent of kAudioSessionCategory_MediaPlayback. Use this category for an application whose sound reproduction is of utmost importance. Your sound plays even when the screen is locked and the Ring / Silent switch is off.

+1
source

Tip. Upload the audio file to your buzztouch account files. This is the only way Buzztouch recognizes audio. then add the audio file to the xcode bttouch sound folder and add all the links. You must be fine!

+1
source

Source: https://habr.com/ru/post/1399101/


All Articles