val uri: Uri = UriUtils.file2Uri(File(videoPath))
val thumbBmp = BitmapFactory.decodeResource(resources, R.drawable.button_bang_bg)
val gameVideoFileObject = WXFileObject()
gameVideoFileObject.filePath = videoPath
this.grantUriPermission(
"com.tencent.mm",
uri,
Intent.FLAG_GRANT_READ_URI_PERMISSION
)
val msg = WXMediaMessage()
msg.setThumbImage(thumbBmp)
msg.title = "分享轨迹视频.mp4"
msg.description = "this is description"
msg.mediaObject = gameVideoFileObject
val req = SendMessageToWX.Req()
req.transaction = buildTransaction("appdata")
req.message = msg
req.scene = mTargetScene
api!!.sendReq(req)
UriUtils.file2Uri(File(videoPath))
最新推荐文章于 2024-05-11 10:24:57 发布