最基本live-player写法只有声音,不显示画面
发布于 5 年前 作者 liufang 6864 次浏览 来自 问答

求问以下写法问题在哪,目前这个组件在iOS和Android手机上都只有声音,没有画面。

设置了此width:100%;height:100%。  页面是空白。

* 提供一个最简复现 Demo

<live-player class="live-wrap"
            src="rtmp://live.hkstv.hk.lxdns.com/live/hks"
            mode="live"
            autoplay="true"
            object-fit="fillCrop"
            debug="true"
            bindstatechange="statechange"
            binderror="error"
>
</live-player>

视频用暴风影音打开过,确认视频没问题,只不过画质有点儿虚。

求问。谢谢大神。

10 回复

如果有了解决办法,求告知

那些能覆盖一些固定图标,比如说暂停,全屏之类的,但是弹幕文字没有办法覆盖

我试了试,好像可以覆盖上???

我看文档里写用其他的可覆盖在live-player上边??

噢噢噢噢哦哦哦原来存在这个情况,感谢告知哇。

感谢给个新思路,我原来都是拿一个<view>标签,然后将弹幕在里面遍历,设置动画效果飘在视频上面,没有想过这么来

<view id="video-box">
   <live-player class="live-wrap"
                src="rtmp://live.hkstv.hk.lxdns.com/live/hks"
                mode="live"
                autoplay="true"
                bindstatechange="statechange"
                binderror="error"
                background-mute="true"
                min-cache="1"
                max-cache="1"
   >
   <cover-view class="play-view">
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
       <cover-view>层层嵌套,层层嵌套,层层嵌套</cover-view>
   </cover-view>
   </live-player>
</view>

这是在真机上吗,能吧您的代码粘出来吗

我做的弹幕效果会被直播组件覆盖,安卓能显示,但是IOS会整个被覆盖,必须下拉才能看到,如果您有想法的话,望告知

回到顶部