Comments (20)
The WebRTC library is managing the system AVAudioSession on its own, so you have to use the audioroute plugin right after audio starts playing (you can technically do it a bit earlier, but anyway) because otherwise (libwebrtc) it will change your route.
Google has plans to allow for a more manual control of this, but that work hasn't landed in libwebrtc yet, so we have to juggle with timing.
from cordova-plugin-iosrtc.
Good point. However, there is nothing in the libwebrtc Objective-C API to select which audio output to use for a RTCAudioTrack
. Even worse, once a PeerConnection is connected and a remote MediaStream
is generated, the audio track of the the mediastream is just magically "rendered". I mean: the plugin does absolutely nothing with the RTCAudioTrack
.
Just check the code to realize that nothing is being explicitly donde with the audio track of a RTCMediaStream
.
BTW this is something to report to the Google's libwebrtc project. I'll do it in the next days.
from cordova-plugin-iosrtc.
For now I've just sent a mail to discuss-webrtc asking about this topic:
https://groups.google.com/forum/#!topic/discuss-webrtc/q4bttvVMB4I
from cordova-plugin-iosrtc.
I'm currently getting around this by adding
var session: AVAudioSession = AVAudioSession.sharedInstance()
session.overrideOutputAudioPort(AVAudioSessionPortOverride.Speaker, error: nil);
on render.
from cordova-plugin-iosrtc.
How does that work? Should I call that for each new "call"? should that session
variable be referenced not to be garbage collected?
from cordova-plugin-iosrtc.
So is it possible to use that to create some sort of toggle on the javascript side? Can it be called while the session is active?
from cordova-plugin-iosrtc.
@ibc I don't think you would need to reference the session variable, as it is a singleton, so just grabbing the sharedInstance() every time should be fine.
from cordova-plugin-iosrtc.
OK, I will add a JS binding for calling that method.
from cordova-plugin-iosrtc.
This is implemented in 1.2.6: 8b55797
from cordova-plugin-iosrtc.
One problem with this solution is that iOS will force the speaker when a user has headphones plugged in.
from cordova-plugin-iosrtc.
There may be a Cordova plugin that detects headphones plugged in.
from cordova-plugin-iosrtc.
Anyone running into this, you might be interested in https://github.com/saghul/cordova-plugin-audioroute
from cordova-plugin-iosrtc.
Hi @ibc was wondering if you could show in your docs how to use @saghul Audioroute plugin to route audio to speakers. I know he said something detecting AVAudioSession but I really have no clue where to start from. Thanks
from cordova-plugin-iosrtc.
@cozzbie I have no idea.
from cordova-plugin-iosrtc.
tears, sobs and pain Thank you. @ibc
from cordova-plugin-iosrtc.
@cozzbie You can try something like that:
cordova.plugins.audioroute.overrideOutput('speaker',
function(success) {
// Success
},
function(error) {
// Error
}
);
from cordova-plugin-iosrtc.
Already doing that but it doesn't work. Was thinking maybe it was the line I was calling it from so I asked @saghul and he said we should listen for AVAudioSession
something and I am at a loss as to how to go about that. @oscarvadillog
from cordova-plugin-iosrtc.
Audio is not coming through the specified device on my ipad when I specify speaker as the audio output ussing audioroute plugin @oscarvadillog @saghul
from cordova-plugin-iosrtc.
it works with the plugin mentioned by, @oscarvadillog
just call it after the audio session was established, for example for a working test, copy and paste after your videocall was established in safari's console.
cordova.plugins.audioroute.overrideOutput('speaker',
function(success) {
// Success
alert("success");
console.log("success",success);
},
function(error) {
// Error
alert("error");
console.log("error",error);
}
);
from cordova-plugin-iosrtc.
solved with me by using this plugin cordova-plugin-audioinput .
PS: in case of make a video call after remote stream added make
setTimeout(() => {
AudioToggle.setAudioMode(AudioToggle.SPEAKER);
}, 2000);
}
from cordova-plugin-iosrtc.
Related Issues (20)
- error: the use of xcframeworks is not supported in the legacy build system...my xcode xcode project. Build System : New Build System HOT 2
- Implementing Mediapipe Pose on ionic IOs using iosRTC HOT 1
- Add flashlight control HOT 4
- Add video border radius support HOT 1
- Enable/Disable track from Receiver/Sender is broken in case of use with Janus Videoroom HOT 5
- Getting error in connecting ios device microphone and video in openvidu ionic HOT 5
- RTCRtpSender not have DTMF properties and createDTMFSender deprecate HOT 4
- PrecompileSwiftBridgingHeader fails after first successful build ('WebRTC/RTCAudioSource.h' file not found) HOT 9
- Pretty bad H264 performance after upgrading to iOS 15.4 HOT 24
- blank screen issue HOT 2
- HTML element over video HOT 1
- Own audio shut down during video conference HOT 5
- App failing to build because of the plugin HOT 4
- navigator.mediaDevices is undefined HOT 2
- cordova iosrtc app crash on iphone device - 'NSInternalInconsistencyException', HOT 12
- Twilio VideoJs adaptive simulcast undefined error, because of missing width and height properties from MediaTrackSettings HOT 6
- Call canceled when callee pickup the phone. HOT 3
- Bug: Can't install plugin on latest cordova/xcode HOT 3
- Build Failed HOT 8
- PluginMediaStreamRenderer.mediaStreamChanged() has multithreading race condition
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-iosrtc.