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直播流时间戳时间比较严格;两个同时初始化渲染;会出现此问题;注释掉另一个可以正常播放。
相关推荐
黑科技iOS上架15 小时前
双引擎解决oc/swift开发引用加固难题
开发语言·ios·swift·审核·ios混淆·执行程序差异化
wechatbot88816 小时前
企微第三方自动化开发:原生能力无阉割 API 开放平台介绍
后端·ios·微信·企业微信·ai编程·ipad
黑科技iOS上架16 小时前
iOS framework/dylib动态库定向加固实战
macos·ios·objective-c·cocoa·审核·ios混淆·执行程序差异化
可乐鸡翅yeah_1 天前
fmp4 碎片 MP4 格式 HLS 流,和传统 TS 分片有什么不一样
开发语言·javascript·ios·音视频·safari·m3u8·m3u8在线播放
茶底世界之下2 天前
为什么高精度透明图片上传到 Metal 时,必须把“拷贝像素”与“混合合成”分开
ios
老李IT笔记2 天前
iOS 27 更新延迟只能给 1 到 90 天:两个参数怎么配,配错了会发生什么
ios·智能手机
Helix2502 天前
移动端浏览器内核之争:iOS 为何强制使用 WebKit?
ios·safari·webkit·wkwebview·浏览器内核·blink·ios浏览器内核
传奇开心果编程2 天前
【SwiftUI提高练中学】第13课 实时活动与灵动岛:ActivityKit 实战
学习·ui·ios·swiftui·swift
可乐鸡翅yeah_2 天前
M3U8 防盗链 URL‑Token 签名,新手开发实操避坑
开发语言·javascript·ios·音视频·safari