Mavic Enterprise Advanced Android 开发下载文件后,在切换到拍摄模式,执行推流结果无法推流
CompletedMavic Enterprise Advanced Android 开发下载文件后,在切换到拍摄模式,执行推流结果无法推流
//文件下载完成重新设置拍照模式
DJISampleApplication.getCameraInstance().setMode(SettingsDefinitions.CameraMode.RECORD_VIDEO, error -> {
});
startStream();
/**
* 下载完成重新推流
*/
private void startStream() {
if (!isLiveStreamManagerOn()) {
return;
}
if (DJISDKManager.getInstance().getLiveStreamManager().isStreaming()) {
//wang
Toast.makeText(context, "already started!", Toast.LENGTH_SHORT).show();
return;
}
new Thread() {
@Override
public void run() {
DJISDKManager.getInstance().getLiveStreamManager().setLiveUrl("");
int result = DJISDKManager.getInstance().getLiveStreamManager().startStream();
DJISDKManager.getInstance().getLiveStreamManager()
.setVideoEncodingEnabled(true);
DJISDKManager.getInstance().getLiveStreamManager().setStartTime();
//wang
ToastUtils.setResultToToast("startLive:" + result +
"\n isVideoStreamSpeedConfigurable:" + DJISDKManager.getInstance().getLiveStreamManager().isVideoStreamSpeedConfigurable() +
"\n isLiveAudioEnabled:" + DJISDKManager.getInstance().getLiveStreamManager().isLiveAudioEnabled() +
"\n 视频帧率为:" + DJISDKManager.getInstance().getLiveStreamManager().getLiveVideoFps() + "fps");
}
}.start();
}
private boolean isLiveStreamManagerOn() {
if (DJISDKManager.getInstance().getLiveStreamManager() == null) {
// ToastUtils.setResultToToast("No live stream manager!");
//wang
Toast.makeText(context, "No live stream manager!", Toast.LENGTH_SHORT).show();
return false;
}
return true;
}
Please sign in to leave a comment.
Comments
1 comment