live player 偶现进入直播间黑屏?
发布于 5 年前 作者 chaoyuan 4797 次浏览 来自 官方Issues

分享小程序码,用户通过小程序码进入直播间,在部分机型上会出现(苹果6,IOS12版本,微信最新版本7.0.8)进入直播间黑屏的问题,此现象为偶现,比如反复10次进入直播间然后大概有4次出现黑屏(不稳定),还望微信开发小伙伴帮忙看下代码实现逻辑为每次onShow的时候会进行拉流

2 回复

基础库版本是多少呢?麻烦扫描下图贴一下截图

另外,麻烦给一下能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

代码片段

  onShow(){

    if(liveRoomComponent == null) {

      liveRoomComponent = plugin.instance.getLiveRoomInstance();

    }

    this.initPage()

  }

// 初始化的时候会调用接口后获取播流地址后在执行如下代码

   if (url.indexOf(‘rtmp:’) == 0) {

        liveRoomComponent && liveRoomComponent.start();

        this.initPullServeMessage();

      } else if (url.indexOf(‘https:’) == 0 || url.indexOf(‘http:’) == 0) {

        if (url.indexOf(’.flv’) != -1) {

          liveRoomComponent && liveRoomComponent.start();

          this.initPullServeMessage();

        }

      } else {

          // 播流地址不合法

          wx.showToast({

            title:‘播流地址不合法’

          })

      }

回到顶部