猿问

Videojs 和 clappr 直播总是在直播上打开,如何禁用?

我有一个显示实时流视频的页面,但是当我在 ios 设备上打开该页面时,它会在全屏模式下打开实时流,当退出全屏模式时,实时流会暂停。我希望直播视频无需在全屏模式下打开即可播放。


使用video.js这是我尝试过的:


html:


<video id="hls-player" controls autoPlay preload="auto" className='video-js vjs-default-skin vjs-big-play-centered'>

      <source src="http://localhost:8080/hls/cam06.m3u8" />                

  </video>

js:


videojs('hls-player', {             

            controls: true,

            liveui:true,

            allowfullscreen:false,

            autoplay: true,                                           

        });   

另外,我尝试使用Clappr 库但得到了相同的结果,这是我所做的:


*html:


<div id="player" align='center'>                

    </div>

js: *


new Clappr.Player({

            // this is an example url - for this to work you'll need to generate fresh token

            source: 'http://localhost:8080/hls/cam06.m3u8',

            parentId: '#player',

            autoPlay:true,

        });

希望有人能帮助我,我有点绝望


慕雪6442864
浏览 216回答 1
1回答

慕哥9229398

对于 Video.js,将playsinline属性添加到视频元素。
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答