Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ public WebRTCModule(ReactApplicationContext reactContext) {
getUserMediaImpl = new GetUserMediaImpl(this, reactContext);
foregroundServiceController = new ForegroundServiceController(reactContext);
audioOutputManager = new AudioOutputManager(this, reactContext);
}

@Override
public void initialize() {
super.initialize();
audioOutputManager.startObserving();
}

Expand All @@ -137,9 +142,11 @@ private PeerConnection getPeerConnection(int id) {
}

void sendEvent(String eventName, @Nullable ReadableMap params) {
getReactApplicationContext()
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit(eventName, params);
ReactApplicationContext ctx = getReactApplicationContext();
if (!ctx.hasActiveReactInstance()) {
return;
}
ctx.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(eventName, params);
}

private PeerConnection.IceServer createIceServer(String url) {
Expand Down
Loading