evans
evans
  • 发布:2020-07-27 17:16
  • 更新:2022-08-28 16:01
  • 阅读:1796

uni-app使用腾讯云点播时,video标签不兼容

分类:uni-app

js 报错:errorHandler TypeError: The element type must be <video>.

使用uni-app开发H5项目,需要使用腾讯云点播 的视频播放器“TCPlayer”,经过测试,在uni-app项目中才出现的错误

errorHandler TypeError: The element type must be <video>.

因为需要做视频试看,防盗链等功能,所以必须用TCPlayer,不知道怎么屏蔽uni-app的video组件

环境是HBuilderX 运行端 安卓真机

如果用动态js创建标签,在h5正常,但是手机真机就不行,请问有解决的方法吗

2020-07-27 17:16 负责人:无 分享
已邀请:
debug中

debug中

帅哥这个问题解决了吗?解决了的话我可以请教一下吗?

00后霸道总裁

00后霸道总裁 - 00后霸道总裁

index.html引入sdk:

<link href="https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.2/tcplayer.min.css" rel="stylesheet"/>  
<script src="https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.2/libs/hls.min.0.13.2m.js"></script>  
<script src="https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.2/tcplayer.v4.5.2.min.js"></script>  

vue里面动态初始化:
initPlyer(){
const video = document.createElement("video")
video.setAttribute("id", "player-container-id")
video.setAttribute('playsinline',true)
video.setAttribute('webkit-playsinline',true)
video.setAttribute('autoplay',true)
document.getElementById("videoContain").appendChild(video)
this.player = TCPlayer('player-container-id', {});
},

要回复问题请先登录注册