diff --git a/frontend/src/components/canvas/components/Editor/VideoLinks.vue b/frontend/src/components/canvas/components/Editor/VideoLinks.vue index 616cead784..c839335f03 100644 --- a/frontend/src/components/canvas/components/Editor/VideoLinks.vue +++ b/frontend/src/components/canvas/components/Editor/VideoLinks.vue @@ -43,6 +43,7 @@ import { mapState } from 'vuex' import { deepCopy } from '@/components/canvas/utils/utils' import { checkAddHttp } from '@/utils/urlUtils' +import bus from "@/utils/bus"; export default { props: { @@ -88,6 +89,7 @@ export default { this.linkInfoTemp[this.linkInfoTemp.videoType].sources[0].src = checkAddHttp(this.linkInfoTemp[this.linkInfoTemp.videoType].sources[0].src) this.curComponent.videoLinks = this.linkInfoTemp this.$store.state.styleChangeTimes++ + bus.$emit('videoLinksChange-' + this.curComponent.id) this.popoverClose() }, onClose() { diff --git a/frontend/src/components/canvas/custom-component/DeStreamMedia.vue b/frontend/src/components/canvas/custom-component/DeStreamMedia.vue index 8488ed4668..af831b6de1 100644 --- a/frontend/src/components/canvas/custom-component/DeStreamMedia.vue +++ b/frontend/src/components/canvas/custom-component/DeStreamMedia.vue @@ -42,7 +42,8 @@ export default { data() { return { pOption: this.element.streamMediaLinks[this.element.streamMediaLinks.videoType], - flvPlayer: null + flvPlayer: null, + videoShow: true } }, @@ -70,7 +71,13 @@ export default { mounted() { this.initOption() bus.$on('streamMediaLinksChange-' + this.element.id, () => { - this.initOption() + this.pOption = this.element.streamMediaLinks[this.element.streamMediaLinks.videoType], + this.flvPlayer = null, + this.videoShow = false + this.$nextTick(() => { + this.videoShow = true + this.initOption() + }) }) }, methods: { diff --git a/frontend/src/components/canvas/custom-component/DeVideo.vue b/frontend/src/components/canvas/custom-component/DeVideo.vue index e9af0c4029..8dc5788c3d 100644 --- a/frontend/src/components/canvas/custom-component/DeVideo.vue +++ b/frontend/src/components/canvas/custom-component/DeVideo.vue @@ -2,12 +2,12 @@
{ + this.showVideo = false + this.$nextTick(() => { + this.showVideo = true + this.initOption() + }) + }) }, methods: { initOption() { @@ -102,9 +111,6 @@ export default { onPlayerPlay(player) { // console.log('player play!', player) }, - onPlayerPause(player) { - // console.log('player pause!', player) - }, onPlayerEnded(player) { // console.log('player ended!', player) }, diff --git a/frontend/src/components/canvas/custom-component/component-list.js b/frontend/src/components/canvas/custom-component/component-list.js index b05b616d1c..b674eaba5f 100644 --- a/frontend/src/components/canvas/custom-component/component-list.js +++ b/frontend/src/components/canvas/custom-component/component-list.js @@ -77,7 +77,8 @@ export const VIDEOLINKS = { remainingTimeDisplay: false, currentTimeDisplay: false, // 当前时间 volumeControl: false, // 声音控制键 - fullscreenToggle: false + fullscreenToggle: false, + pause: false }, sources: [{ }]