|
|
@ -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"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|