我使用 React-Player 作为登陆页面的背景,但是当在移动设备(而不是台式机)上使用它时,有时(并非总是)会进入全屏模式并卡在那里。
我使用的视频来自vimeo,所以我不确定问题是否出在我的ReactPlayer配置上,或者是否是vimeo API / SDK的问题。
<ReactPlayer
key={`video-${videoIdx}`}
url={videoSrcUrl}
className="react-player"
playing={true}
controls={false}
muted={true}
config={{
vimeo: {
iframeParams: { fullscreen: 0 },
autoplay: true,
playsinline: true,
muted: true
},
}}
onReady={() => {
setReady(true)
}}
onEnded={() => {
setReady(false)
}}
/>
您可以这样配置 vimeo 选项:
config={{
vimeo: {
playerOptions: {
fullscreen: false,
},
},
}}
这会隐藏控件中的全屏按钮