您的位置:首页 > 科技 > 能源 > 深圳专业的网站制作公司_做中英文网站_世界杯比分查询_seo优化广告

深圳专业的网站制作公司_做中英文网站_世界杯比分查询_seo优化广告

2025/4/2 18:39:47 来源:https://blog.csdn.net/small_fox_dtt/article/details/146421839  浏览:    关键词:深圳专业的网站制作公司_做中英文网站_世界杯比分查询_seo优化广告
深圳专业的网站制作公司_做中英文网站_世界杯比分查询_seo优化广告

1. 查看配置项没问题

    setTcPlayer() {let that = this;player = new TcPlayer("videoPlayer", {live: this.activatPlayType == "livePlay" ? true : false,x5_type: "h5",x5_fullscreen: true,systemFullscreen: true,x5_orientation: 1,x5_player: true,flash: false,webrtc: this.liveRTCSrc,m3u8: this.liveSrc, //请替换成实际可用的播放地址autoplay: false, //iOS 下 safari 浏览器,以及大部分移动端浏览器是不开放视频自动播放这个能力的width: that.fun.getPhoneEnv() != 3 ? window.innerWidth : "375", //视频的显示宽度,请尽量使用视频分辨率宽度height: this.liveHeight, //视频的显示高度,请尽量使用视频分辨率高度wording: {2032: "请求视频失败,请检查网络",2048: "请求m3u8文件失败,可能是网络错误或者跨域问题"},controls: "none",Flash: false,listener: function(msg) {// console.log(msg.type);if (msg.type == "loadeddata") {console.log("loadeddata===============");that.resizeH();// that.onPlayerPlay();}if (msg.type == "loadedmetadata") {// console.log("loadedmetadata==》》》》》",parseInt(player.video.el.duration));that.targetVideo.maxTime = parseInt(player.video.el.duration);}if (msg.type == "load") {timer_2 = setTimeout(() => {that.loadedVideoDataOk = true;}, 800);}if (msg.type == "error") {console.log("error::视频播放不了.....");Toast("该视频出现问题了!");that.show = true;that.loadedVideoDataOk = true;that.$set(that.liveList[that.activeSwiperIndex], "show", true);}if (msg.type == "play") {that.videoPlaying();clearInterval(timer_2);}if (msg.type == "playing") {that.songStop = false;that.isFirstPlay = true;// that.videoPlaying();}if (msg.type == "pause") {that.songStop = true;}if (msg.type == "timeupdate") {that.targetVideo.currentTime = player.video.el.currentTime;that.sliderTime = parseInt((that.targetVideo.currentTime / that.targetVideo.maxTime) * 100);}}});},

对比官方文档没发现什么问题

2. 最后在代码里查看 发现初始化两个palyer播放器;考虑ios直播流时间戳时间比较严格;两个同时初始化渲染;会出现此问题;注释掉另一个可以正常播放。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com