修复弹窗播放和分屏播放窗口尺寸异常的BUG
parent
ad4e61d7e7
commit
010e73b0c7
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div ref="container" @dblclick="fullscreenSwich"
|
<div ref="container" @dblclick="fullscreenSwich"
|
||||||
style="width:100%;height:518px; min-height: 200px;background-color: #000000;margin:0 auto;position: relative;">
|
style="width:100%; height: 100%; background-color: #000000;margin:0 auto;position: relative;">
|
||||||
<div class="buttons-box" id="buttonsBox">
|
<div class="buttons-box" id="buttonsBox">
|
||||||
<div class="buttons-box-left">
|
<div class="buttons-box-left">
|
||||||
<i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick"></i>
|
<i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick"></i>
|
||||||
|
@ -49,16 +49,23 @@ export default {
|
||||||
created() {
|
created() {
|
||||||
let paramUrl = decodeURIComponent(this.$route.params.url)
|
let paramUrl = decodeURIComponent(this.$route.params.url)
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
console.log(2222)
|
||||||
this.updatePlayerDomSize()
|
this.updatePlayerDomSize()
|
||||||
window.onresize = () => {
|
window.onresize = this.updatePlayerDomSize
|
||||||
this.updatePlayerDomSize()
|
|
||||||
}
|
|
||||||
if (typeof (this.videoUrl) == "undefined") {
|
if (typeof (this.videoUrl) == "undefined") {
|
||||||
this.videoUrl = paramUrl;
|
this.videoUrl = paramUrl;
|
||||||
}
|
}
|
||||||
this.btnDom = document.getElementById("buttonsBox");
|
this.btnDom = document.getElementById("buttonsBox");
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// mounted() {
|
||||||
|
// const ro = new ResizeObserver(entries => {
|
||||||
|
// entries.forEach(entry => {
|
||||||
|
// this.updatePlayerDomSize()
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// ro.observe(this.$refs.container);
|
||||||
|
// },
|
||||||
watch: {
|
watch: {
|
||||||
videoUrl: {
|
videoUrl: {
|
||||||
handler(val, _) {
|
handler(val, _) {
|
||||||
|
@ -74,15 +81,18 @@ export default {
|
||||||
let dom = this.$refs.container;
|
let dom = this.$refs.container;
|
||||||
let width = dom.parentNode.clientWidth
|
let width = dom.parentNode.clientWidth
|
||||||
let height = (9 / 16) * width
|
let height = (9 / 16) * width
|
||||||
|
console.log(height)
|
||||||
|
|
||||||
const clientHeight = Math.min(document.body.clientHeight, document.documentElement.clientHeight)
|
console.log(dom.clientHeight)
|
||||||
if (height > clientHeight) {
|
if (height > dom.clientHeight) {
|
||||||
height = clientHeight
|
height = dom.clientHeight
|
||||||
width = (16 / 9) * height
|
width = (16 / 9) * height
|
||||||
}
|
}
|
||||||
if (width > 0 && height > 0) {
|
if (width > 0 && height > 0) {
|
||||||
dom.style.width = width + 'px';
|
dom.style.width = width + 'px';
|
||||||
dom.style.height = height + "px";
|
dom.style.height = height + "px";
|
||||||
|
console.log(width)
|
||||||
|
console.log(height)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
create() {
|
create() {
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
v-if="Object.keys(this.player).length > 1">
|
v-if="Object.keys(this.player).length > 1">
|
||||||
<el-tab-pane label="Jessibuca" name="jessibuca">
|
<el-tab-pane label="Jessibuca" name="jessibuca">
|
||||||
<jessibucaPlayer v-if="activePlayer === 'jessibuca'" ref="jessibuca" :visible.sync="showVideoDialog"
|
<jessibucaPlayer v-if="activePlayer === 'jessibuca'" ref="jessibuca" :visible.sync="showVideoDialog"
|
||||||
:videoUrl="videoUrl" :error="videoError" :message="videoError" height="100px"
|
:videoUrl="videoUrl" :error="videoError" :message="videoError" style="height: 515px"
|
||||||
:hasAudio="hasAudio" fluent autoplay live></jessibucaPlayer>
|
:hasAudio="hasAudio" fluent autoplay live></jessibucaPlayer>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="WebRTC" name="webRTC">
|
<el-tab-pane label="WebRTC" name="webRTC">
|
||||||
|
|
Loading…
Reference in New Issue