| | |
| | | videoData: [], |
| | | searchData: null, |
| | | hls: null, |
| | | videoList:[] |
| | | videoList: [], |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | .catch((err) => this.$message.error(err)); |
| | | }, |
| | | loadVideo(item) { |
| | | if (Hls.isSupported()) { |
| | | var video = document.getElementById(item.id); |
| | | var hls = new Hls(); |
| | | videoPoint.getVideoPointUrl(item.platResourceId).then((res) => { |
| | | if (res.code === 0) { |
| | | hls.loadSource(res.data); |
| | | hls.attachMedia(video); |
| | | this.videoList.push(video); |
| | | // hls.on(Hls.Events.MANIFEST_PARSED, function () { |
| | | // // video.play(); |
| | | // document.body.addEventListener( |
| | | // "click", |
| | | // function () { |
| | | // video.play(); |
| | | // }, |
| | | // false |
| | | // ); |
| | | // }); |
| | | setTimeout(() => { |
| | | video.play(); |
| | | }, 2000); |
| | | } |
| | | }); |
| | | if (item.platResourceId) { |
| | | if (Hls.isSupported()) { |
| | | var video = document.getElementById(item.id); |
| | | var hls = new Hls(); |
| | | videoPoint.getVideoPointUrl(item.platResourceId).then((res) => { |
| | | if (res.code === 0) { |
| | | hls.loadSource(res.data); |
| | | hls.attachMedia(video); |
| | | this.videoList.push(video); |
| | | // hls.on(Hls.Events.MANIFEST_PARSED, function () { |
| | | // // video.play(); |
| | | // document.body.addEventListener( |
| | | // "click", |
| | | // function () { |
| | | // video.play(); |
| | | // }, |
| | | // false |
| | | // ); |
| | | // }); |
| | | setTimeout(() => { |
| | | video.play(); |
| | | }, 2000); |
| | | } |
| | | }); |
| | | } |
| | | } else { |
| | | this.$message.error("暂无视频"); |
| | | } |
| | | }, |
| | | selectedDepartment(data) { |
| | |
| | | this.getVideoPointList(this.searchData); |
| | | }, |
| | | }, |
| | | beforeDestroy(){ |
| | | videoList.forEach(element => { |
| | | element.push() |
| | | beforeDestroy() { |
| | | videoList.forEach((element) => { |
| | | element.push(); |
| | | }); |
| | | }, |
| | | }; |
| | |
| | | } |
| | | |
| | | video::-webkit-media-controls-timeline { |
| | | display: none; |
| | | display: none; |
| | | } |
| | | |
| | | video::-webkit-media-controls-current-time-display { |
| | | display: none; |
| | | display: none; |
| | | } |
| | | |
| | | video::-webkit-media-controls-time-remaining-display { |
| | | display: none; |
| | | display: none; |
| | | } |
| | | |
| | | video::-webkit-media-controls-mute-button { |
| | | display: none; |
| | | display: none; |
| | | } |
| | | |
| | | video::-webkit-media-controls-toggle-closed-captions-button { |
| | | display: none; |
| | | display: none; |
| | | } |
| | | </style> |