小程序短剧
async goPlayer() { try { // **1. 获取加密数据** const encryptedData = await getEncryptData({ openid: uni.getStorageSync('openid'), srcAppId: 'wxbc2e45b8f33c6094', dramaId: '101357', serialList: [ { start_serial_no: 1, end_serial_no: 5, status: 1 }, // 1~5 集免费 { start_serial_no: 6, end_serial_no: 20, status: 2 } // 6~20 需解锁 ], dataExpireAt: Math.floor(Date.now() / 1000) + 7200 // 2 小时有效期 }); console.log("✅ 加密数据获取成功:", encryptedData); // **2. 禁止录屏** wx.setVisualEffectOnCapture({ visualEffect: 'hidden', }); // **3. 监听播放器加载,获取 `playerId`** plugin.onPageLoad((info) => { console.log("🎬 播放器加载完成:", info); if (!info.playerId) { console.error("❌ 无法获取 playerId"); return; } // **4. 获取播放器管理实例 `pm`** const pm = plugin.PlayletManager.getPageManager(info.playerId); console.log(plugin,'plugin'); if (!pm) { console.error("❌ 获取播放器实例失败!"); return; } console.log("✅ 成功获取播放器实例:", pm); pm.isCanPlay({ data: encryptedData, serialNo:'101357', status: '1' // 1=可播放, 2=需解锁 }); // **5. 设置可播放剧集** pm.setCanPlaySerialList({ data: encryptedData, freeList: [{ start_serial_no: 1, end_serial_no: 5 }] // 1~5 集免费 }); // // **6. 监听解锁事件** // pm.onCheckIsCanPlay((param) => { // console.log("🔓 需要检查是否可播放:", param); // this.handleUnlock(param, pm); // }); // // **7. 监听播放器错误** // pm.onPlayError((err) => { // console.log("❌ 播放失败:", err); // }); }); // **8. 跳转到播放器** PlayerManager.navigateToPlayer({ srcAppid: 'wxbc2e45b8f33c6094', dramaId: '101357', serialNo: 1, // ✅ 这里必须是数字 extParam: encodeURIComponent('a=b&c=d') // ✅ 传递 extParam 避免 `getLaunch options` 失败 }); let parms = { userId : uni.getStorageSync('userId'), playletId : '101357', controlType :'watch' } userActionApi(parms).then(res=>{ console.log(res,'用户行为'); }) console.log("🚀 已跳转到播放器,等待 onPageLoad 触发..."); } catch (error) { console.error("❌ 加密数据失败:", error); uni.showToast({ title: '获取加密数据失败', icon: 'none' }); } }, 页面也没有报错,就是一直在播放页转圈
wx.showModal({ title: '温馨提示', content: '请先登录', showCancel: true, confirmText: '登录', success: function (res) { if (res.confirm) { that.pm.navigateTo({ url: '/pages/login/login', fail: function (res) { console.log(res) } }) } else if (res.cancel) { that.pm.navigateBack() } } })
【请求地址】: https://api.weixin.qq.com/wxa/sec/vod/singlefileupload?access_token=89_-eB3raXXXXXXXXXXX 【请求参数】:/Users/xxx/Downloads/短剧001.mp4 【视频大小】:7M 【错误信息】:错误代码:48001, 错误信息:API 功能未授权,微信原始报文:{"errcode":48001,"errmsg":"api unauthorized rid: 67c90f87-1a03b7e1-119452d3"} 【参考文档】:https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/mini-drama/mini_drama.html#_1-%E5%AA%92%E8%B5%84%E4%B8%8A%E4%BC%A0 该文档中“媒资上传”和“媒资管理”所有接口都返回了48001
(1)推荐剧目设置,接口中的src_appid下面的drama_id, 需要填的是什么? 单独开通推荐接口,不进行剧目设置,播放最后一集到最后没有反应。 [图片] (2)设置分享后,用户点开分享,第一次打开分享可以看第二次就不能看了,需要怎么设置才能正常播放并返回到小程序首页 此测试,均为小程序开发版测试 、
getPageManage 这个有值, onDataReport undefined [图片] [图片]
短剧播放器播放几秒左右,错,然后虽然可以正常播放,但是会出现播放按钮[图片]
[图片]
appid: wx7eb66237b9cfcd21 drama_id: 100038 剧目提审后报错, 剧目无法再提交审核! rid: 67c158d6-541c3be9-66332d63" 什么原因造成的呀,怎么解决!
[图片][图片] 如果这边官方的短剧播放器自带的评论功能,我查看文档只有点击评论按钮的事件监听。 [图片] 如果我想知道上架的某一部剧,获取用户的评论数据,有什么方法
POST https://api.weixin.qq.com/wxa/sec/vod/uploadpart?access_token=ACCESS_TOKEN curl_init 上传一直报错"errcode" => -1 "errmsg" => "system error rid: 67c0239c-70b76efb-16684040" 使用w7corp/easywechat 提交一直这个报错 "errcode" => 47003 "errmsg" => "argument invalid! rid: 67c0255a-0ddbd90a-76984c23"
由于小程序违规,支付功能暂时无法使用[图片]
请问有什么方法可以在短剧的播放控件里面增加追剧按钮,或者是收藏按钮
[playlet-plugin][ERROR][player] 2025-02-25 17:32:21 -> onVideoRenderError {"type": "rendererror", "timeStamp": 129814, "target": {"id": "playerId-0", "offsetLeft": 0, "offsetTop": 0, "dataset": {}}, "currentTarget": {"id": "playerId-0", "offsetLeft": 0, "offsetTop": 0, "dataset": {}}, "mark": {}, "detail": {"errMsg": "updateVideoPlayer:fail invalid videoPlayerId"}, "mut": false, "_userTap": false, "__evName": "rendererror"}
[图片]1.bug1剧已经删除了,这边还是显示有2.文件选取没有排序有重复的排查很麻烦。3.数量统计不刷新,我重新搜索这些数量还在。[图片]3.视频管理没有排序重复了排查很麻烦。4.网络失败,上传就会导致重复也不给提示,希望整改一下
[图片] 这是什么警告 [图片] 还有这个问题 [图片] 这三个如何解决呢
请问可以以一进入小程序首页或者推荐页就自动播放视频吗?用viedo组件不行,想知道现在短剧播放器的组件可以吗? [图片][图片]
[图片][图片]
https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html 短剧小程序可以直接使用 jsapi支付吗,好像无法开通
[图片] 这个是过了还是没过,audit_detail中status描述的不够充分,示例中为status=3,麻烦帮看一下,谢谢
[图片]
您好,能否提供代码片段进一步定位问题呢?https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html