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,4 +81,24 @@ body, | ||
| 81 | text-align: center; | 81 | text-align: center; |
| 82 | padding-top: 0px !important; | 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 | </style> | 104 | </style> |
web_src/src/components/common/jessibuca.vue
| 1 | <template> | 1 | <template> |
| 2 | - <div :id="containerId" :ref="containerId" @dblclick="fullscreenSwich"> | 2 | + <div id="container" ref="containerId" @dblclick="fullscreenSwich" style="width: 100%"> |
| 3 | <div class="buttons-box" id="buttonsBox"> | 3 | <div class="buttons-box" id="buttonsBox"> |
| 4 | <div class="buttons-box-left"> | 4 | <div class="buttons-box-left"> |
| 5 | <i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick"></i> | 5 | <i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick"></i> |
| @@ -44,7 +44,7 @@ export default { | @@ -44,7 +44,7 @@ export default { | ||
| 44 | forceNoOffscreen: false, | 44 | forceNoOffscreen: false, |
| 45 | }; | 45 | }; |
| 46 | }, | 46 | }, |
| 47 | - props: ['containerId', 'videoUrl', 'error', 'hasAudio', 'height'], | 47 | + props: ['videoUrl', 'error', 'hasAudio', 'height'], |
| 48 | mounted() { | 48 | mounted() { |
| 49 | window.onerror = (msg) => { | 49 | window.onerror = (msg) => { |
| 50 | // console.error(msg) | 50 | // console.error(msg) |
| @@ -71,19 +71,19 @@ export default { | @@ -71,19 +71,19 @@ export default { | ||
| 71 | }, | 71 | }, |
| 72 | methods: { | 72 | methods: { |
| 73 | updatePlayerDomSize() { | 73 | updatePlayerDomSize() { |
| 74 | - let dom = document.getElementById(this.containerId); | 74 | + let dom = document.getElementById('container'); |
| 75 | const width = dom.parentNode.clientWidth | 75 | const width = dom.parentNode.clientWidth |
| 76 | dom.style.width = width + 'px'; | 76 | dom.style.width = width + 'px'; |
| 77 | dom.style.height = (9 / 16) * width + "px"; | 77 | dom.style.height = (9 / 16) * width + "px"; |
| 78 | }, | 78 | }, |
| 79 | create() { | 79 | create() { |
| 80 | let options = {}; | 80 | let options = {}; |
| 81 | - console.log(this.$refs[this.containerId]) | 81 | + console.log(this.$refs.containerId) |
| 82 | console.log("hasAudio " + this.hasAudio) | 82 | console.log("hasAudio " + this.hasAudio) |
| 83 | 83 | ||
| 84 | this.jessibuca = new window.Jessibuca(Object.assign( | 84 | this.jessibuca = new window.Jessibuca(Object.assign( |
| 85 | { | 85 | { |
| 86 | - container: this.$refs[this.containerId], | 86 | + container: this.$refs.containerId, |
| 87 | videoBuffer: 0.2, // 最大缓冲时长,单位秒 | 87 | videoBuffer: 0.2, // 最大缓冲时长,单位秒 |
| 88 | isResize: true, | 88 | isResize: true, |
| 89 | decoder: "static/js/jessibuca/decoder.js", | 89 | decoder: "static/js/jessibuca/decoder.js", |
| @@ -204,19 +204,6 @@ export default { | @@ -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 | playBtnClick: function (event) { | 207 | playBtnClick: function (event) { |
| 221 | this.play(this.videoUrl) | 208 | this.play(this.videoUrl) |
| 222 | }, | 209 | }, |
web_src/src/components/dialog/devicePlayer.vue
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | <el-dialog title="视频播放" top="0" :close-on-click-modal="false" :visible.sync="showVideoDialog" @close="close()"> | 4 | <el-dialog title="视频播放" top="0" :close-on-click-modal="false" :visible.sync="showVideoDialog" @close="close()"> |
| 5 | <!-- <LivePlayer v-if="showVideoDialog" ref="videoPlayer" :videoUrl="videoUrl" :error="videoError" :message="videoError" :hasaudio="hasaudio" fluent autoplay live></LivePlayer> --> | 5 | <!-- <LivePlayer v-if="showVideoDialog" ref="videoPlayer" :videoUrl="videoUrl" :error="videoError" :message="videoError" :hasaudio="hasaudio" fluent autoplay live></LivePlayer> --> |
| 6 | <div style="width: 100%; height: 100%"> | 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 | </div> | 8 | </div> |
| 9 | <div id="shared" style="text-align: right; margin-top: 1rem;"> | 9 | <div id="shared" style="text-align: right; margin-top: 1rem;"> |
| 10 | <el-tabs v-model="tabActiveName" @tab-click="tabHandleClick"> | 10 | <el-tabs v-model="tabActiveName" @tab-click="tabHandleClick"> |
web_src/src/layout/index.vue
| @@ -24,26 +24,6 @@ export default { | @@ -24,26 +24,6 @@ export default { | ||
| 24 | } | 24 | } |
| 25 | </script> | 25 | </script> |
| 26 | <style> | 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 | .page-header { | 28 | .page-header { |
| 49 | background-color: #FFFFFF; | 29 | background-color: #FFFFFF; |
| @@ -64,10 +44,6 @@ export default { | @@ -64,10 +44,6 @@ export default { | ||
| 64 | } | 44 | } |
| 65 | </style> | 45 | </style> |
| 66 | <style scoped> | 46 | <style scoped> |
| 67 | -.el-main { | ||
| 68 | - margin: 0; | ||
| 69 | -} | ||
| 70 | - | ||
| 71 | .fade-enter { | 47 | .fade-enter { |
| 72 | visibility: hidden; | 48 | visibility: hidden; |
| 73 | opacity: 0; | 49 | opacity: 0; |
web_src/src/router/index.js
| @@ -99,16 +99,6 @@ export default new VueRouter({ | @@ -99,16 +99,6 @@ export default new VueRouter({ | ||
| 99 | component: media, | 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 | path: '/map', | 102 | path: '/map', |
| 113 | name: 'devicePosition', | 103 | name: 'devicePosition', |
| 114 | component: devicePosition, | 104 | component: devicePosition, |
| @@ -125,5 +115,15 @@ export default new VueRouter({ | @@ -125,5 +115,15 @@ export default new VueRouter({ | ||
| 125 | name: 'deviceTree', | 115 | name: 'deviceTree', |
| 126 | component: deviceTree, | 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 | }) |