We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
this.player = new Aliplayer(props, (player) => { console.log('播放器初始化完成', player) // 添加截图事件监听器 player.on('snapshoted', (data) => { console.log('截图完成', data) this.handleSnapshot(data) }) }) handleSnapshot(data) { // 处理截图数据,可以将数据保存到组件的变量中 console.log('截图完成', data) var pictureData = data.paramData.base64 var downloadElement = document.createElement('a') downloadElement.setAttribute('href', pictureData) var fileName = 'Aliplayer' + Date.now() + '.png' downloadElement.setAttribute('download', fileName) downloadElement.click() pictureData = null // 执行其他操作... },
{ "type": "snapshoted", "target": { "vdata1701140826521": "1B08F21A-CE0F-44B4-A668-64CC37C2CC4B", "paramData": null }, "paramData": { "time": 11.01612, "base64": "", "binary": "", "error": { "stack": "Error: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.\n at t.<anonymous> (https://g.alicdn.com/apsara-media-box/imp-web-player/2.18.3/aliplayer-min.js:2:614027)\n at HTMLDivElement.i (https://g.alicdn.com/apsara-media-box/imp-web-player/2.18.3/aliplayer-min.js:2:105799)\n at a.dispatcher.a.dispatcher (https://g.alicdn.com/apsara-media-box/imp-web-player/2.18.3/aliplayer-min.js:2:95256)" } }, "defaultPrevented": false }
The text was updated successfully, but these errors were encountered:
需要传入 extraInfo 来允许跨域,可以参考文档:https://help.aliyun.com/zh/vod/developer-reference/advanced-features-3#p-6e6-unl-31c
Sorry, something went wrong.
No branches or pull requests
示例代码
报错内容
The text was updated successfully, but these errors were encountered: