Browse Source

change

tencentVideo
zmt 3 years ago
parent
commit
9e2aa301c4
  1. 2
      build.gradle
  2. 11
      uniplugin_module_TXLiveAVSDK/src/main/java/io/dcloud/txLive/TXLiveModule.java

2
build.gradle

@ -34,7 +34,7 @@ ext {
compileSdkVersion = 25
buildToolsVersion = "25.0.2"
supportSdkVersion = "25.4.0"
minSdkVersion = 16
minSdkVersion = 23
targetSdkVersion = 23
versionCode = 1
versionName = "v1.0"

11
uniplugin_module_TXLiveAVSDK/src/main/java/io/dcloud/txLive/TXLiveModule.java

@ -7,6 +7,7 @@ import android.util.Log;
import com.alibaba.fastjson.JSONObject;
//import com.tencent.qcloud.ugckit.utils.VideoPathUtil;
import com.tencent.qcloud.ugckit.UGCKitVideoPublish;
import com.tencent.qcloud.ugckit.module.upload.TXUGCPublish;
import com.tencent.qcloud.ugckit.module.upload.TXUGCPublishTypeDef;
import com.tencent.rtmp.TXLiveBase;
@ -134,6 +135,7 @@ public class TXLiveModule extends UniModule {
TXUGCPublish mVideoPublish = new TXUGCPublish(this.mUniSDKInstance.getContext(), customKey);
mVideoPublish.setListener(new TXUGCPublishTypeDef.ITXVideoPublishListener() {
@Override
public void onPublishProgress(long uploadBytes, long totalBytes) {
@ -142,7 +144,11 @@ public class TXLiveModule extends UniModule {
@Override
public void onPublishComplete(TXUGCPublishTypeDef.TXPublishResult result) {
// mResultMsg.setText(result.retCode + " Msg:" + (result.retCode == 0 ? result.videoURL : result.descMsg));
System.out.println(result.retCode + " Msg:" + (result.retCode == 0 ? result.videoURL : result.descMsg));
JSONObject uploadData = new JSONObject();
uploadData.put("code", result.retCode);
uploadData.put("result", (result.retCode == 0 ? result.videoURL : result.descMsg));
callback.invokeAndKeepAlive(uploadData); //回调上传视频信息
}
});
@ -156,8 +162,7 @@ public class TXLiveModule extends UniModule {
param.coverPath = mCoverPath;
mVideoPublish.publishVideo(param);
JSONObject data = new JSONObject();
data.put("code", "success uniplugin_module");
}

Loading…
Cancel
Save