I am writing an audio application and I need to pause playing music when I pull out the headphones. I use react-native-sound.
Can I listen to headphones, moved events? How to do it?
Thanks in advance!
Check out the react-native-music-control. As far as I read in their docs, they say it plays well with react-native-sound.
See the register to events section in their docs.
On iOS this event will also be triggered by the audio router change event.
This happens when headphones are unplugged or a bluetooth audio peripheral disconnects from the device:
MusicControl.on('pause', ()=> {
// Do your magic here.
});
That's how you can do it on iOS! Unfortunately, I can't find any info if on Android the behavior is the same or if not - what's the workaround there.
Related
My goal is to make iOS play audio in a background.
When the audio is received by iPhone, it's not played unless I open the app in the foreground.
Basically, the iPhone is "waiting" when I click to open the app, and then it plays the audio.
Following Developer Guide, I added ios.background_modes=music to my .properties file.
However, nothing changed in behaviour.
I receive audio in real time via websocket class (onMessage(byte[] message) method).
What approach would you suggest in order to resolve this issue and make iOS play audio in a background?
This is the syntax for adding via the GUI not editing the properties file directly. You need to add the property with a codename1.arg. prefix.
Specifically: codename1.arg.ios.background_modes=music
I use "twilio-video": "^2.8.0" for building a video chat app. On mobile devices chat app should be able to switch the camera front and back.
I try something like this to the video track
tracks.restart({ facingMode: 'environment' })
But If I console log the tracks. There is no method called restart. Why would this happen?
Any help!
Thanks in adcanced. =)
Twilio developer evangelist here.
Can you upgrade to 2.9.0? I just tested with 2.8.0 and it didn't work, but 2.9.0 had the restart function.
My app displays MPVolumeView button. When no earphone or bluetooth headset is not connected, clicking on this button shows two options. iPhone and iPhone speaker (for speaker and ear piece). This was perfectly fine till iOS 10. But on iOS 11, this button is disabled. It shows available routes only when connected to wireless headset.
I do not see any change or deprecated APIs in MPVolumeView. Anyone else seeing this issue?
Also a thing to note here is I still see old volume control indicator while I read about volume control indicator designed differently on iOS 11.
Figured out that I need to use AVRoutePickerView on iOS 11. This offers audio route options and also volume slider.
I have a site where I need to show two different videos on it and I need to be able to do some actions with the videogular API.
The thing is that when I share the $API from the view to the controller using vgPlayerReady($API) the method I call to one video is applied in both! For example I want to mute one video but when I call setVolume() with the API returned, both videos get muted.
Is this a known issue?
Is there other way to mute just one video?
The workaround I found to fix this was to setVolume(0) when the video that I want to be muted is ready to be played, and setVolume(1) when the video I want with volume is ready to be played.
The volume property didn't work for me.
I have set up a vLine agent withing Xilium CefGlue and mostly it works. It can send text messages, receive voice and video calls that function as expected but when a voice or video call is made out of CefGlue to a Chrome browser or CefGlue the call appears to connect but no video or audio makes it from one client to the other. Local vidoe is displayed and it appears local audio is being captured but the other client can see nor hear anything.
[1202/163721:ERROR:webrtc_audio_renderer.cc(231)] NOT IMPLEMENTED shows up in CefGlue.log
Any ideas what can be done to make this work?
Run application (or add it programmatically) with --enable-media-stream switch.
http://apprtc.appspot.com/ should work.
If problems still persists, but works in chrome - then you probably should report issue into CEF issue tracker, or there is problem with vLine (what is it?).