提交 6735e865 作者: 方治民

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

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