|
|
@@ -15,6 +15,7 @@
|
|
|
@waiting="onVideoWaiting"
|
|
|
@playing="onVideoPlaying"
|
|
|
@error="onVideoError"
|
|
|
+ @ended="onVideoEnded"
|
|
|
/>
|
|
|
<div class="o-video__mask">
|
|
|
<div
|
|
|
@@ -41,7 +42,7 @@
|
|
|
/>
|
|
|
<div
|
|
|
v-else
|
|
|
- class="l-flex__none c-sibling-item o-quality-menu has-active u-pointer"
|
|
|
+ class="l-flex__none c-sibling-item o-quality-menu u-pointer"
|
|
|
@click.stop="toggleQualityMenu"
|
|
|
>
|
|
|
<div
|
|
|
@@ -52,12 +53,13 @@
|
|
|
v-for="item in qualities"
|
|
|
:key="item.value"
|
|
|
class="o-quality-menu__item u-pointer"
|
|
|
+ :class="{ active: quality.value === item.value }"
|
|
|
@click="changeQuality(item)"
|
|
|
>
|
|
|
{{ item.label }}
|
|
|
</div>
|
|
|
</div>
|
|
|
- {{ quality.label }}
|
|
|
+ <span class="has-active">{{ quality.label }}</span>
|
|
|
</div>
|
|
|
<i
|
|
|
class="c-sibling-item el-icon-full-screen has-active u-pointer"
|
|
|
@@ -148,6 +150,13 @@ export default {
|
|
|
this.hideQualityMenu()
|
|
|
},
|
|
|
methods: {
|
|
|
+ onVideoEnded () {
|
|
|
+ console.log('Device onVideoEnded')
|
|
|
+ this.destroyPlayer()
|
|
|
+ this.recordConfig = null
|
|
|
+ this.$playerInfo = null
|
|
|
+ this.createPlayer()
|
|
|
+ },
|
|
|
getRecordConfig () {
|
|
|
this.loadingQuality = true
|
|
|
getRecordConfig(this.device.id, { custom: true }).finally(() => {
|
|
|
@@ -237,13 +246,13 @@ export default {
|
|
|
this.getAuthCode()
|
|
|
return
|
|
|
}
|
|
|
- const { timestamp, expire, token } = this.$playerInfo
|
|
|
+ const { vhost = '__defaultVhost__', token, timestamp, expire } = this.$playerInfo
|
|
|
if (Number(timestamp) + Number(expire) * 1000 <= Date.now()) {
|
|
|
this.getAuthCode()
|
|
|
return
|
|
|
}
|
|
|
this.destroyPlayer()
|
|
|
- this.playUrl(`${GATEWAY}/live/${this.recordConfig.stream}.flv?authorization=${token}×tamp=${timestamp}&expire=${expire}`)
|
|
|
+ this.playUrl(`${GATEWAY}/live/${this.recordConfig.stream}.flv?vhost=${vhost}&authorization=${token}×tamp=${timestamp}&expire=${expire}`)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -273,6 +282,10 @@ export default {
|
|
|
padding: 4px 0;
|
|
|
color: #fff;
|
|
|
|
|
|
+ &.active {
|
|
|
+ color: $success;
|
|
|
+ }
|
|
|
+
|
|
|
&:hover {
|
|
|
color: $primary;
|
|
|
}
|