Commit 4aae5817 authored by sheteng's avatar sheteng

语音房间 3

parent d8ca40ab
......@@ -680,6 +680,9 @@ public class CCIMClient {
JanusConfImpl conf = new JanusConfImpl();
conf.url(audioServer);
conf.plugin(JanusPlugins.VIDEOROOM);
if (janusService != null) {
janusService.stop();
}
janusService = new JanusService(context, roomId, user, callback);
janusService.start(context, conf);
}
......@@ -690,9 +693,14 @@ public class CCIMClient {
public void exitAudioRoom() {
if (janusService != null) {
janusService.stop();
janusService = null;
}
}
/**
* 是否禁言自己
* @param enable
*/
public void setLocalAudio(boolean enable) {
if (janusService != null) {
janusService.setLocalAudio(enable);
......
......@@ -58,6 +58,7 @@ public class JanusService extends JanusDelegate {
this.callback = callback;
if (audioManager != null) {
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
// audioManager.adjustStreamVolume (AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, AudioManager.FLAG_SHOW_UI);
// audioManager.setSpeakerphoneOn(true);
}
}
......@@ -129,8 +130,10 @@ public class JanusService extends JanusDelegate {
@Override
public void onMediaChanged(MediaBundle media) {
if ( media.localAudioTrack() != null) {
audioTrack = media.localAudioTrack();
}
}
@Override
public void onDatachannelMessage(DataChannel.Buffer buffer) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment