提交 6735e865 作者: 方治民

feat: 限制视频全屏播放时竖屏

上级 eae6450e
......@@ -11,7 +11,7 @@
addViewCount(id)
const videoContext = uni.createVideoContext(`video${id}`)
videoContext.requestFullScreen()
videoContext.requestFullScreen({ direction: 0 })
videoContext.play()
})
}
......@@ -29,7 +29,7 @@
<view class="p-3" style="font-family: '思源黑体'; font-weight: 400">
<view class="w-full text-28">
<view class="mb-1">
<video class="w-full" :src="!isNull(detail) ? detail?.url : ''" controls loop></video>
<video class="w-full" :src="!isNull(detail) ? detail?.url : ''" controls loop :direction="0"></video>
</view>
</view>
<view class="flex flex-col justify-between mt-1 mb-6">
......
......@@ -75,7 +75,7 @@
// })
const videoContext = uni.createVideoContext(`video${id}`)
videoContext.requestFullScreen()
videoContext.requestFullScreen({ direction: 0 })
videoContext.play()
// 增加播放次数
......@@ -132,6 +132,7 @@
:show-center-play-btn="true"
:enable-progress-gesture="true"
:show-progress="true"
:direction="0"
object-fit="contain"
@loadedmetadata="handleMetadataLoaded"
@play="handleVideoPlay(item.id)"
......
......@@ -445,7 +445,7 @@
function playVideo(index) {
const videoContext = uni.createVideoContext(`video${index}`)
videoContext.requestFullScreen()
videoContext.requestFullScreen({ direction: 0 })
videoContext.play()
}
......@@ -825,6 +825,7 @@
:show-center-play-btn="true"
:enable-progress-gesture="true"
:show-progress="true"
:direction="0"
object-fit="contain"
@loadedmetadata="handleMetadataLoaded"
@play="handleVideoPlay(index)"
......
......@@ -461,7 +461,7 @@
function playVideo(index) {
const videoContext = uni.createVideoContext(`video${index}`)
videoContext.requestFullScreen()
videoContext.requestFullScreen({ direction: 0 })
videoContext.play()
}
......@@ -797,6 +797,7 @@
:show-center-play-btn="true"
:enable-progress-gesture="true"
:show-progress="true"
:direction="0"
object-fit="contain"
@loadedmetadata="handleMetadataLoaded"
@play="handleVideoPlay(index)"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论