优化播放器尺寸调节逻辑:
1.播放器不会大于屏幕高度
2.增加灰色背景色区分播放区域
3.播放器居中
1个文件已修改
13 ■■■■ 已修改文件
web_src/src/components/common/jessibuca.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_src/src/components/common/jessibuca.vue
@@ -1,5 +1,5 @@
<template>
  <div id="container" ref="containerId" @dblclick="fullscreenSwich" style="width: 100%">
  <div id="container" ref="containerId" @dblclick="fullscreenSwich" style="background-color: #eee;margin:0 auto;">
    <div class="buttons-box" id="buttonsBox">
      <div class="buttons-box-left">
        <i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick"></i>
@@ -72,9 +72,16 @@
  methods: {
    updatePlayerDomSize() {
      let dom = document.getElementById('container');
      const width = dom.parentNode.clientWidth
      let width = dom.parentNode.clientWidth
      let height = (9 / 16) * width
      const clientHeight = Math.min(document.body.clientHeight, document.documentElement.clientHeight)
      if (height > clientHeight) {
        height = clientHeight
        width = (16 / 9) * height
      }
      dom.style.width = width + 'px';
      dom.style.height = (9 / 16) * width + "px";
      dom.style.height = height + "px";
    },
    create() {
      let options = {};