chore:视频正常上下黑边删除
This commit is contained in:
@@ -148,34 +148,9 @@ export default {
|
||||
|
||||
// 弹窗视频容器样式
|
||||
popupVideoStyle() {
|
||||
let style = 'position:fixed;width:60%;left:50%;margin-left:-30%;';
|
||||
const defaultRatio = 9 / 16;
|
||||
|
||||
let ratio = defaultRatio;
|
||||
if (this.popupVideoWidth && this.popupVideoHeight) {
|
||||
ratio = this.popupVideoHeight / this.popupVideoWidth;
|
||||
}
|
||||
|
||||
const isPortrait = ratio > 1;
|
||||
|
||||
if (isPortrait) {
|
||||
style += 'top:50%;transform:translateY(-50%);';
|
||||
} else {
|
||||
style += 'top:25%;';
|
||||
}
|
||||
|
||||
// #ifdef H5
|
||||
style += 'height:0;padding-top: ' + (ratio * 100) + '%;';
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
style += 'height:0;padding-top: ' + (ratio * 100) + '%;';
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-HARMONY
|
||||
style += 'height: ' + (this.windowWidth * ratio) + 'px;';
|
||||
// #endif
|
||||
|
||||
// 固定宽高容器:60%宽 x 50vh高,居中显示
|
||||
// 竖屏视频填满高度→左右留黑边;横屏视频填满宽度→无黑边
|
||||
let style = 'position:fixed;width:60%;height:50vh;left:50%;top:50%;transform:translate(-50%,-50%);';
|
||||
return style;
|
||||
}
|
||||
},
|
||||
@@ -623,6 +598,7 @@ export default {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background-color: #000;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.adaptive-video {
|
||||
@@ -634,22 +610,6 @@ export default {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
/* #ifdef MP-WEIXIN */
|
||||
.adaptive-video {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
/* #endif */
|
||||
|
||||
/* #ifdef MP-HARMONY */
|
||||
.adaptive-video {
|
||||
position: static;
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
/* #endif */
|
||||
|
||||
.video-nav {
|
||||
padding: 16rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
Reference in New Issue
Block a user