Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] No media sound when phone is in silent mode. #204

Closed
bcalik opened this issue May 1, 2016 · 7 comments
Closed

[iOS] No media sound when phone is in silent mode. #204

bcalik opened this issue May 1, 2016 · 7 comments

Comments

@bcalik
Copy link
Contributor

bcalik commented May 1, 2016

There is no video sound when the phone is in silent mode in iOS.
It should actually play media sounds even if it is in silent mode, as seen on instagram or any other app.

@dojiboy9
Copy link
Contributor

Go into your ios/AppDelegate.m file and insert the line:

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];

just before the end of the didFinishLaunchingWithOptions method. This should replace the similarly looking line you have there already. The issue is most likely that you have done setCategory:AVAudioSessionCategoryAmbient which will mute the sound in silent mode.

@mattapperson
Copy link
Contributor

We should actually provide an API for this... @bcalik mind opening a feature request ticket?

@bcalik
Copy link
Contributor Author

bcalik commented Aug 30, 2016

@mattapperson What do you mean by feature request ticket? Consider this issue as a feature request ticket by labelling it.

@mattapperson
Copy link
Contributor

@bcalik I went ahead and created a ticket that outlines what is needed as more of a feature request to make it easier for a dev to just pick it up and run with it.
#310

@timwuhaotian
Copy link

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];

Just add to that answer, we need to

link the AVFoundation lib and then

#import <AVFoundation/AVFoundation.h> on the top of the AppDelegate.m

@kadikraman
Copy link

For anyone else stumbling on this from a Google/issue search - this is now built into the library. You can use ignoreSilentSwitch

<Video
  [---]
  ignoreSilentSwitch="ignore"
/>

@samibaris
Copy link

image
doesnt work,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants