2***@qq.com
2***@qq.com
  • 发布:2020-05-22 16:42
  • 更新:2020-05-27 16:15
  • 阅读:810

APP端 video怎么检测到live-pusher暂停推流呢

分类:uni-app

做APP端值播功能
推流页面使用的是live-pusher标签,拉流播放页面使用的是video标签,当live-pusher暂停推流时,video播放黑屏,这样就很不美观了,想实现主播暂停推流时,播放页面显示一个“主播不在,请稍等的标语”。
但是怎么能检测到推流暂停了呢?
而且当live-pusher暂停、播放黑屏时,video 标签的这些方法@timeupdate @error @waiting @ended @pla @pause 都没有反应,而且@timeupdate 进度也依旧正常加载

2020-05-22 16:42 负责人:无 分享
已邀请:
karlar

karlar - 一只程序猿

有解决办法吗?我也遇到了这个问题了

2***@qq.com

2***@qq.com (作者) - QQ:2388817150

推流页面

<live-pusher :style="[{width: widthWin + 'px',height:heightWin + 'px'}]" id='livePusher' ref="livePusher" class="livePusher"  
             :url="url" mode="FHD" @statechange="statechange" aspect="9:16" :beauty="index" :whiteness="indexOne" @error="error"></live-pusher>  

pause: function() {  
                this.context.pause({  
                    success: (a) => {  
                        console.log("livePusher.pause:" + JSON.stringify(a));  
                    }  
                });  
            },  

播放页面

<video :style="[{width: widthWin + 'px',height:heightWin + 'px'}]" id="myVideo" class="videosty" :src="livePlay"  
         :autoplay="true" :enable-progress-gesture="false" object-fit="fill" :controls="false"  
         :enable-play-gesture="false" :vslide-gesture-in-fullscreen="false" @timeupdate="timeupdate" @error="videoErrorCallback" @waiting='waiting' @ended="ended" @play='start' @pause="stop" v-if='liveinfo.status == 1'>  
        </video>  
DCloud_App_Array

DCloud_App_Array

按我理解暂停后拉流效果应该是服务器来处理的,推流只是一个输入源而已,暂停了就应该没有输入源了。

  • 2***@qq.com (作者)

    如果是暂停了,没有输入源了,这个时候video标签的@error方法会被执行,然后video就一直转圈圈,就算恢复了也还是一直转圈圈

    2020-05-29 14:17

  • chihiro_yy

    回复 2***@qq.com: 想问一下这个问题解决了嘛

    2020-09-11 10:07

该问题目前已经被锁定, 无法添加新回复