-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
issue 310 - Added a new property, ignoreSilentSwitch. #403
issue 310 - Added a new property, ignoreSilentSwitch. #403
Conversation
…o will play even when the silent switch on an iOS device is set to silent. When false, the audio will toggle with the silent switch. Sets the AVAudioSession to either playback or ambient.
I like this, but could you please update the readme noting this as an iOS only feature? |
Yea, I'll add to the readme and update the example project in the next couple of days. |
Thanks! You rock! |
Just realized, no matter what, this is going to take over the audio session settings, even if the property isn't set. Hmm. It might make sense to have an enum setting instead of the boolean value. Something like:
That way if audioMode isn't set, then it won't take over apps audio just because a video exists in the app. |
This feature is useful, any reason not merge it? |
@SemonCat because as @duhseekoh pointed out, another API might be better |
@duhseekoh Great stuff! Do you have any updates on changing the ignoreSilentSwitch bool to a Api that accepts an enum? |
I'm also looking at something similar to this. What this doesn't handle is multiple videos. |
Any update on this? |
My company has created a $200 bounty for this PR, hoping someone can fix the issues soon. https://www.bountysource.com/issues/37409911-add-playwhilemuted-property |
@duhseekoh are you still interested in merging this? If not, I'm happy to update the api |
Yea looking back at this I'm good with merging it. We can't have this
library be the end all be all for sound management for an application, so a
boolean property to ignore the silent switch makes sense.
That being said I think there is a future here that handles sound
management for multiple videos on screen at one time, multiple sound
options, etc... it just depends on the level of sophistication we want in
this package and how much control we give through its API (preferably a
limited surface area).
…On Fri, Apr 7, 2017 at 8:41 PM Basil Siddiqui ***@***.***> wrote:
@duhseekoh <https://github.com/duhseekoh> are you still interested in
merging this? If not, I'm happy to update the api
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#403 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA43BHGWL8GrE2IOsSkNyGbtKJH7GQTAks5rttebgaJpZM4LDG10>
.
|
I created a version of this that handles multiple mounted video components and only stops the audio session when they are all unmounted: https://github.com/drivetribe/react-native-video/blob/fork/ios/RCTVideoAudio.m It may not be exactly what you need but perhaps by posting it here it helps someone. |
@duhseekoh @bsiddiqui Are you guys planning on merging this PR soon? |
This accounts for the case where the user does not want to modify the audio session from a particular video instance. The user would not use the ignoreSilentSwitch property at all in that case. Also, the audio session will only be updated when the video is unpaused, instead of whenever the video component has updated props. This allows for multiple videos to be on the screen, with the most recent video unpaused (aka played) being the video that has control over the audio session.
Updates: Changed ignoreSilentSwitch to accept two string values, ignore and obey. Would be great to have someone pull this down / into their project and test it. |
@duhseekoh Just tested this out and it's working perfectly in my project 👍 Thanks! Lets get this PR merged :) |
Great. @mattapperson - Anything else needed for a merge? |
…p#403) * issue 310 - Added a new property, ignoreSilentSwitch. When true, audio will play even when the silent switch on an iOS device is set to silent. When false, the audio will toggle with the silent switch. Sets the AVAudioSession to either playback or ambient. * Added ignoreSilentSwitch usage to example app and to readme * Changed ignoreSilentSwitch to accept two string values, ignore and obey. This accounts for the case where the user does not want to modify the audio session from a particular video instance. The user would not use the ignoreSilentSwitch property at all in that case. Also, the audio session will only be updated when the video is unpaused, instead of whenever the video component has updated props. This allows for multiple videos to be on the screen, with the most recent video unpaused (aka played) being the video that has control over the audio session.
* master: Added flag for background mode (TheWidlarzGroup#563) issue 310 - Added a new property, ignoreSilentSwitch. (TheWidlarzGroup#403) Add progressUpdateInterval to android-exoplayer (TheWidlarzGroup#540) Initial WPF Support (TheWidlarzGroup#385) added progressUpdateInterval to Android (TheWidlarzGroup#512) load new source if it is different (TheWidlarzGroup#502) Pausing progress if it was playing and the stating again (TheWidlarzGroup#526) bump android dependencies (TheWidlarzGroup#524) Update ExoPlayer to r2.2.0 (TheWidlarzGroup#505) Update readme (TheWidlarzGroup#497) [Android] App crash when unmounting video (TheWidlarzGroup#533) Fix/494 (TheWidlarzGroup#537) fix(RCTVideo.m): Fixed status bar disappearing issue
Thank you for working on this feature , I have it a set it to where the video is paused as soon as the video is loaded and I'm observing that However If I removed How can I get example
Thank you |
When true, audio will play even when the silent switch on an iOS device is set to silent. When false, the audio will toggle with the silent switch. Sets the AVAudioSession to either playback or ambient.
Essentially, this... #310
If you guys are good with this I'll update the example project and readme.