uni-app video组件的 direction属性为何仅限全屏播放时设置旋转 非全屏下无法设置旋转
uni-app video组件的 direction属性为何仅限全屏播放时设置旋转 非全屏下无法设置旋转
| 开发环境 | 版本号 | 项目创建方式 |
|---|---|---|
| Windows | window7 | HBuilderX |
### 示例代码:
```html
<template>
<view class="content" :class="{content_active: isContent_Active}">
<video
class="testVideo"
:class="{video_active: isVideo_Active}"
ref="video"
poster="https://i.postimg.cc/Twd5mCxF/20210526102007.png"
src="http://103.148.127.241/media/static/video/video1.mp4"
controls
[@fullscreenchange](/user/fullscreenchange)='full'
direction="-90"
>
<cover-view class="controls-title" [@click](/user/click)="clickFull"></cover-view>
</video>
</view>
</template>
<script>
export default {
data() {
return {
isContent_Active: false,
isVideo_Active: false
}
},
onLoad() {
},
methods: {
full(){
console.log('点击全屏按钮或者退出全屏')
},
clickFull(){
console.log(1111)
this.isVideo_Active = this.isContent_Active = !this.isContent_Active;
}
}
</script>
<style lang="less">
//默认横盘样式
.content{
height: 100vh;
position: relative;
display: flex;
justify-content: center;
align-items: center;
.testVideo{
height: 100vw;
width: 100vh;
transform: rotate(90deg);
position: absolute;
transition: 0.4s;
.controls-title{
position: absolute;
right: 0;
bottom: 0;
width: 20px;
height: 20px;
background-color: red;
}
}
}
</style>
操作步骤:
- 直接打开应用
预期结果:
- 不管在全屏播放还是在非全屏播放都能旋转
实际结果:
- 不能旋转
bug描述:
video组件的 direction 属性为什么只能设置在全屏播放旋转,不能在非全屏的下设置旋转
更多关于uni-app video组件的 direction属性为何仅限全屏播放时设置旋转 非全屏下无法设置旋转的实战教程也可以访问 https://www.itying.com/category-93-b0.html

