Commit 6e4fc1e79b7b4b91d6eb36f6b5638fa902665a50
1 parent
e7ab983f
1.修正了播放地址无法正常播放视频的问题,包含两个错误:
1.1修正播放器界面路由(此页面不需要layout边框,之前已经修复但在地图代码合并时又被错误覆盖) 1.2修正播放器id属性,此属性现在不需要父级组件传入(这是之前导致独立播放页面失效的主要原因) 2.调整滚动条美化样式到app.vue中,使其真正全局生效
Showing
5 changed files
with
36 additions
and
53 deletions
web_src/src/App.vue
| ... | ... | @@ -81,4 +81,24 @@ body, |
| 81 | 81 | text-align: center; |
| 82 | 82 | padding-top: 0px !important; |
| 83 | 83 | } |
| 84 | + | |
| 85 | +/*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/ | |
| 86 | +::-webkit-scrollbar { | |
| 87 | + width: 8px; | |
| 88 | + height: 8px; | |
| 89 | +} | |
| 90 | + | |
| 91 | +/*定义滚动条轨道 内阴影+圆角*/ | |
| 92 | +::-webkit-scrollbar-track { | |
| 93 | + border-radius: 4px; | |
| 94 | + background-color: #F5F5F5; | |
| 95 | +} | |
| 96 | + | |
| 97 | +/*定义滑块 内阴影+圆角*/ | |
| 98 | +::-webkit-scrollbar-thumb { | |
| 99 | + border-radius: 4px; | |
| 100 | + background-color: #c8c8c8; | |
| 101 | + box-shadow: inset 0 0 6px rgba(0, 0, 0, .1); | |
| 102 | + -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .1); | |
| 103 | +} | |
| 84 | 104 | </style> | ... | ... |
web_src/src/components/common/jessibuca.vue
| 1 | 1 | <template> |
| 2 | - <div :id="containerId" :ref="containerId" @dblclick="fullscreenSwich"> | |
| 2 | + <div id="container" ref="containerId" @dblclick="fullscreenSwich" style="width: 100%"> | |
| 3 | 3 | <div class="buttons-box" id="buttonsBox"> |
| 4 | 4 | <div class="buttons-box-left"> |
| 5 | 5 | <i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick"></i> |
| ... | ... | @@ -44,7 +44,7 @@ export default { |
| 44 | 44 | forceNoOffscreen: false, |
| 45 | 45 | }; |
| 46 | 46 | }, |
| 47 | - props: ['containerId', 'videoUrl', 'error', 'hasAudio', 'height'], | |
| 47 | + props: ['videoUrl', 'error', 'hasAudio', 'height'], | |
| 48 | 48 | mounted() { |
| 49 | 49 | window.onerror = (msg) => { |
| 50 | 50 | // console.error(msg) |
| ... | ... | @@ -71,19 +71,19 @@ export default { |
| 71 | 71 | }, |
| 72 | 72 | methods: { |
| 73 | 73 | updatePlayerDomSize() { |
| 74 | - let dom = document.getElementById(this.containerId); | |
| 74 | + let dom = document.getElementById('container'); | |
| 75 | 75 | const width = dom.parentNode.clientWidth |
| 76 | 76 | dom.style.width = width + 'px'; |
| 77 | 77 | dom.style.height = (9 / 16) * width + "px"; |
| 78 | 78 | }, |
| 79 | 79 | create() { |
| 80 | 80 | let options = {}; |
| 81 | - console.log(this.$refs[this.containerId]) | |
| 81 | + console.log(this.$refs.containerId) | |
| 82 | 82 | console.log("hasAudio " + this.hasAudio) |
| 83 | 83 | |
| 84 | 84 | this.jessibuca = new window.Jessibuca(Object.assign( |
| 85 | 85 | { |
| 86 | - container: this.$refs[this.containerId], | |
| 86 | + container: this.$refs.containerId, | |
| 87 | 87 | videoBuffer: 0.2, // 最大缓冲时长,单位秒 |
| 88 | 88 | isResize: true, |
| 89 | 89 | decoder: "static/js/jessibuca/decoder.js", |
| ... | ... | @@ -204,19 +204,6 @@ export default { |
| 204 | 204 | |
| 205 | 205 | }); |
| 206 | 206 | }, |
| 207 | - resize() { | |
| 208 | - if (this.jessibuca) { | |
| 209 | - this.jessibuca.resize() | |
| 210 | - this.$nextTick(() => { | |
| 211 | - let dom = document.getElementById(this.containerId); | |
| 212 | - if (dom.parentNode.clientHeight == 0) { | |
| 213 | - dom.style.height = (9 / 16) * dom.clientWidth + "px" | |
| 214 | - } | |
| 215 | - dom.style.height = dom.parentNode.clientHeight + "px"; | |
| 216 | - dom.style.width = dom.parentNode.clientWidth + "px"; | |
| 217 | - }) | |
| 218 | - } | |
| 219 | - }, | |
| 220 | 207 | playBtnClick: function (event) { |
| 221 | 208 | this.play(this.videoUrl) |
| 222 | 209 | }, | ... | ... |
web_src/src/components/dialog/devicePlayer.vue
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | <el-dialog title="视频播放" top="0" :close-on-click-modal="false" :visible.sync="showVideoDialog" @close="close()"> |
| 5 | 5 | <!-- <LivePlayer v-if="showVideoDialog" ref="videoPlayer" :videoUrl="videoUrl" :error="videoError" :message="videoError" :hasaudio="hasaudio" fluent autoplay live></LivePlayer> --> |
| 6 | 6 | <div style="width: 100%; height: 100%"> |
| 7 | - <player containerId="container" ref="videoPlayer" :visible.sync="showVideoDialog" :videoUrl="videoUrl" :error="videoError" :message="videoError" height="100px" :hasAudio="hasAudio" fluent autoplay live ></player> | |
| 7 | + <player ref="videoPlayer" :visible.sync="showVideoDialog" :videoUrl="videoUrl" :error="videoError" :message="videoError" height="100px" :hasAudio="hasAudio" fluent autoplay live ></player> | |
| 8 | 8 | </div> |
| 9 | 9 | <div id="shared" style="text-align: right; margin-top: 1rem;"> |
| 10 | 10 | <el-tabs v-model="tabActiveName" @tab-click="tabHandleClick"> | ... | ... |
web_src/src/layout/index.vue
| ... | ... | @@ -24,26 +24,6 @@ export default { |
| 24 | 24 | } |
| 25 | 25 | </script> |
| 26 | 26 | <style> |
| 27 | -/*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/ | |
| 28 | -::-webkit-scrollbar { | |
| 29 | - width: 8px; | |
| 30 | - height: 8px; | |
| 31 | -} | |
| 32 | - | |
| 33 | -/*定义滚动条轨道 内阴影+圆角*/ | |
| 34 | -::-webkit-scrollbar-track { | |
| 35 | - border-radius: 4px; | |
| 36 | - background-color: #F5F5F5; | |
| 37 | -} | |
| 38 | - | |
| 39 | -/*定义滑块 内阴影+圆角*/ | |
| 40 | -::-webkit-scrollbar-thumb { | |
| 41 | - border-radius: 4px; | |
| 42 | - background-color: #c8c8c8; | |
| 43 | - box-shadow: inset 0 0 6px rgba(0, 0, 0, .1); | |
| 44 | - -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .1); | |
| 45 | -} | |
| 46 | - | |
| 47 | 27 | /*定义标题栏*/ |
| 48 | 28 | .page-header { |
| 49 | 29 | background-color: #FFFFFF; |
| ... | ... | @@ -64,10 +44,6 @@ export default { |
| 64 | 44 | } |
| 65 | 45 | </style> |
| 66 | 46 | <style scoped> |
| 67 | -.el-main { | |
| 68 | - margin: 0; | |
| 69 | -} | |
| 70 | - | |
| 71 | 47 | .fade-enter { |
| 72 | 48 | visibility: hidden; |
| 73 | 49 | opacity: 0; | ... | ... |
web_src/src/router/index.js
| ... | ... | @@ -99,16 +99,6 @@ export default new VueRouter({ |
| 99 | 99 | component: media, |
| 100 | 100 | }, |
| 101 | 101 | { |
| 102 | - path: '/play/wasm/:url', | |
| 103 | - name: 'wasmPlayer', | |
| 104 | - component: wasmPlayer, | |
| 105 | - }, | |
| 106 | - { | |
| 107 | - path: '/play/rtc/:url', | |
| 108 | - name: 'rtcPlayer', | |
| 109 | - component: rtcPlayer, | |
| 110 | - }, | |
| 111 | - { | |
| 112 | 102 | path: '/map', |
| 113 | 103 | name: 'devicePosition', |
| 114 | 104 | component: devicePosition, |
| ... | ... | @@ -125,5 +115,15 @@ export default new VueRouter({ |
| 125 | 115 | name: 'deviceTree', |
| 126 | 116 | component: deviceTree, |
| 127 | 117 | }, |
| 118 | + { | |
| 119 | + path: '/play/wasm/:url', | |
| 120 | + name: 'wasmPlayer', | |
| 121 | + component: wasmPlayer, | |
| 122 | + }, | |
| 123 | + { | |
| 124 | + path: '/play/rtc/:url', | |
| 125 | + name: 'rtcPlayer', | |
| 126 | + component: rtcPlayer, | |
| 127 | + }, | |
| 128 | 128 | ] |
| 129 | 129 | }) | ... | ... |