|
|
|
@ -8,6 +8,7 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import DPlayer from 'dplayer';
|
|
|
|
|
import { saveAs } from 'file-saver';
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
@ -60,7 +61,16 @@ export default {
|
|
|
|
|
video: {
|
|
|
|
|
url: this.thermalVideoUrl,
|
|
|
|
|
type: 'auto'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
contextmenu: [
|
|
|
|
|
{
|
|
|
|
|
text: '下载视频',
|
|
|
|
|
link: this.thermalVideoUrl,
|
|
|
|
|
click: () => {
|
|
|
|
|
this.downloadVideo(this.thermalVideoUrl, 'thermal-video.mp4');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.visiblePlayer = new DPlayer({
|
|
|
|
@ -69,8 +79,24 @@ export default {
|
|
|
|
|
video: {
|
|
|
|
|
url: this.visibleVideoUrl,
|
|
|
|
|
type: 'auto'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
contextmenu: [
|
|
|
|
|
{
|
|
|
|
|
text: '下载视频',
|
|
|
|
|
link: this.visibleVideoUrl,
|
|
|
|
|
click: () => {
|
|
|
|
|
this.downloadVideo(this.visibleVideoUrl, 'visible-video.mp4');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
downloadVideo(url, filename) {
|
|
|
|
|
fetch(url)
|
|
|
|
|
.then(response => response.blob())
|
|
|
|
|
.then(blob => saveAs(blob, filename))
|
|
|
|
|
.catch(error => console.error('下载失败:', error));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|