Fai*_*ikh 5 audio video android videochat webrtc
我正在尝试实现Skype之类的功能,即在进行音频/视频通话时,我可以转到另一个屏幕,但是通话将继续,然后我可以返回到AV通话屏幕。我正在Android平台中实现这个想法。
我面临的问题是,当我切换屏幕时,视频已暂停,但音频仍在继续。即使我切换屏幕,有什么方法可以使视频继续播放。
我使用以下代码从以下位置开始音频/视频会议 VideoChatActivity.java
app.startLocalMedia(new SingleAction<Exception>() {
@Override
public void invoke(Exception ex) {
if (ex == null) {
// Start the signalling engine.
app.startSignalling(new SingleAction<String>() {
@Override
public void invoke(String ex) {
if (ex != null) {
// alert("Could not start signalling. %s",
// ex.getMessage());
alert("Some problem occured while establishing connection");
Logger.error("YES-Error at startSignalling " + ex);
}
}
}, webasyncURL);
// Start the conference engine.
Logger.error("YES-here-1.2");
app.startConference(iceLinkServerAddress, roomName, video, container, wheel, audioOnlyDefaultAvatar,
muteControlToggle, videoOnOffToggle, speakerToggle, videoChatActivity,
new SingleAction<Exception>() {
@Override
public void invoke(Exception ex) {
if (ex != null) {
// alert("Could not start conference. %s",
// ex.getMessage());
alert("Some problem occured while initializing video call");
Logger.error("YES-Error at startconference " + ex.getLocalizedMessage());
}
}
});
} else {
// alert("Could not start local media. %s",
// ex.getMessage());
Logger.error("YES-Error at startLocalMedia " + ex.getLocalizedMessage());
}
}
}, video, audio);
Run Code Online (Sandbox Code Playgroud)
当我在进行音频/视频会议时返回上一个活动时,我将该服务称为strat startLocalMedia。
这是我的 CameraService.java
VideoChatActivity.app.startLocalMedia(new SingleAction<Exception>() {
@Override
public void invoke(Exception ex) {
if (ex == null) {
// Start the signalling engine.
VideoChatActivity.app.startSignalling(new SingleAction<String>() {
@Override
public void invoke(String ex) {
if (ex != null) {
// alert("Could not start signalling. %s",
// ex.getMessage());
//alert("Some problem occured while establishing connection");
Logger.error("YES-Error at startSignalling " + ex);
}
}
}, VideoChatActivity.webasyncURL);
// Start the conference engine.
VideoChatActivity.app.startConference(VideoChatActivity.iceLinkServerAddress, VideoChatActivity.roomName, VideoChatActivity.video, VideoChatActivity.container, VideoChatActivity.wheel, VideoChatActivity.audioOnlyDefaultAvatar,
VideoChatActivity.muteControlToggle, VideoChatActivity.videoOnOffToggle, VideoChatActivity.speakerToggle, VideoChatActivity.videoChatActivity,
new SingleAction<Exception>() {
@Override
public void invoke(Exception ex) {
if (ex != null) {
// alert("Could not start conference. %s",
// ex.getMessage());
//alert("Some problem occured while initializing video call");
Logger.error("YES-Error at startconference " + ex.getLocalizedMessage());
}
}
});
} else {
// alert("Could not start local media. %s",
// ex.getMessage());
//alert("Some problem occured while getting media devices");
Logger.error("YES-Error at startLocalMedia " + ex.getLocalizedMessage());
}
}
}, VideoChatActivity.video, VideoChatActivity.audio);
Run Code Online (Sandbox Code Playgroud)
如何实现这种情况?
| 归档时间: |
|
| 查看次数: |
591 次 |
| 最近记录: |