Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-06-24 12:38:27 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1d16be0575ec4a293f4966a26f294855cd6cb90c
1d16be05
1 parent
03ab72d5
fix 视频16:9比例根据页面width动态判断
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
3 deletions
src/components/AuditVideoCard/index.vue
src/components/MuiVideo/index.vue
src/components/VideoCard/index.vue
src/components/VideoDetail/index.vue
src/components/AuditVideoCard/index.vue
View file @
1d16be0
...
...
@@ -121,6 +121,10 @@ export default {
_this.detail.showStatus = true;
});
}, 500);
// 配置16:9高度比
const width = document.getElementById('mui-player-' + this.item.id).clientWidth;
const height = (width * 9) / 16;
document.getElementById('mui-player-' + this.item.id).height = height;
},
methods: {
goTo () { // 跳转作品详情页
...
...
@@ -162,7 +166,6 @@ export default {
.video-div {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
height: 13rem !important;
}
.video-bar {
...
...
src/components/MuiVideo/index.vue
View file @
1d16be0
...
...
@@ -62,6 +62,10 @@ onMounted(() => {
props: props.item,
});
});
// 配置16:9高度比
const width = document.getElementById('mui-player-' + props.item.id).clientWidth;
const height = (width * 9) / 16;
document.getElementById('mui-player-' + props.item.id).height = height;
});
</script>
...
...
@@ -76,7 +80,6 @@ onMounted(() => {
.video-div {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
height: 13rem !important;
}
.video-bar {
...
...
src/components/VideoCard/index.vue
View file @
1d16be0
...
...
@@ -106,6 +106,10 @@ onMounted(() => {
video && video.addEventListener('play', function () {
handleAction('play', props.item.id)
});
// 配置16:9高度比
const width = document.getElementById('mui-player-' + props.item.id).clientWidth;
const height = (width * 9) / 16;
document.getElementById('mui-player-' + props.item.id).height = height;
});
const goTo = () => { // 跳转作品详情页
...
...
@@ -143,7 +147,6 @@ const setComment = () => {
.video-div {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
height: 13rem !important;
}
.video-bar {
...
...
src/components/VideoDetail/index.vue
View file @
1d16be0
...
...
@@ -91,6 +91,10 @@ export default {
_this.handleAction('play', _this.item.id)
});
}, 500)
// 配置16:9高度比
const width = document.getElementById('mui-player-' + this.item.id).clientWidth;
const height = (width * 9) / 16;
document.getElementById('mui-player-' + this.item.id).height = height;
},
methods: {
}
...
...
@@ -99,6 +103,10 @@ export default {
<style lang="less" scoped>
.video-wrapper {
.video-div {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.video-bar {
color: #713610;
padding: 1rem;
...
...
Please
register
or
login
to post a comment