ios端使用TCplayer直播播放三秒直接卡顿bug

  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);
           }
         }
       });
     },

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

  1. 最后在代码里查看 发现初始化两个palyer播放器;考虑ios直播流时间戳时间比较严格;两个同时初始化渲染;会出现此问题;注释掉另一个可以正常播放。
相关推荐
denggun123455 小时前
ios开发逆向安全防抓包
安全·ios
陌路物是人非8 小时前
记一个 @Resource BUG
java·开发语言·bug
冬奇Lab17 小时前
稳定性性能系列之四——异常日志机制与进程冻结:问题排查的黑匣子
android·性能优化·车载系统·bug
Digitally17 小时前
如何在Windows 10 PC上获取 iPhone短信
ios·iphone
_OP_CHEN18 小时前
【测试理论与实践】(三)测试BUG篇:从 BUG 本质到实战博弈,带你吃透软件测试的核心逻辑
运维·测试开发·产品运营·bug·压力测试·测试
脾气有点小暴18 小时前
uv-drop-down-popup 在 iOS 真机中随屏幕滚动偏移
ios·uniapp·uv
2501_9240641118 小时前
2025年移动应用渗透测试流程方案及iOS与Android框架对比
android·ios
tangweiguo0305198718 小时前
Objective-C 核心语法深度解析:基本类型、集合类与代码块实战指南
开发语言·ios·objective-c
代码s贝多芬的音符18 小时前
IOS webview打开相机 相册 选择文件上传
数码相机·ios
鹏多多2 天前
Flutter下拉刷新上拉加载侧拉刷新插件:easy_refresh全面使用指南
android·前端·ios