|
@@ -8,6 +8,7 @@ var beautyArchiveDetailMixin = {
|
|
|
//页面配置
|
|
|
archiveId: '', //资料列表id
|
|
|
currentVideoUrl: '', //正在播放的视频链接(上一个播放的的视频)
|
|
|
+ currentVideo: '',
|
|
|
showVideoDialog: false,
|
|
|
isPlayer: false, //是否正在播放
|
|
|
imageGroup: {},
|
|
@@ -59,34 +60,44 @@ var beautyArchiveDetailMixin = {
|
|
|
},
|
|
|
//显示视频播放窗口
|
|
|
handleShowPlayer: function (url) {
|
|
|
+ var _self = this;
|
|
|
if (this.checkPermission() !== 0) return;
|
|
|
//暂停上一个正在播放的播放器
|
|
|
- this.currentVideoUrl = url;
|
|
|
+ // this.currentVideoUrl = url;
|
|
|
+ this.isPlayer = true;
|
|
|
+ this.currentVideoUrl = 'https://www.w3school.com.cn/i/movie.ogg';
|
|
|
this.showVideoDialog = true;
|
|
|
+ setTimeout(function(){
|
|
|
+ // var video = this.$refs.videoRef;
|
|
|
+ _self.currentVideo = document.querySelector('#realPlayer');
|
|
|
+ _self.currentVideo.addEventListener('pause', function () {
|
|
|
+ _self.isPlayer = false;
|
|
|
+ console.log('暂停播放');
|
|
|
+ });
|
|
|
+ _self.currentVideo.addEventListener('ended', function () {
|
|
|
+ _self.isPlayer = false;
|
|
|
+ console.log('播放结束');
|
|
|
+ });
|
|
|
+ _self.currentVideo.addEventListener('error', function () {
|
|
|
+ _self.isPlayer = false;
|
|
|
+ console.log('播放错误');
|
|
|
+ });
|
|
|
+ _self.currentVideo.addEventListener('play', function () {
|
|
|
+ _self.isPlayer = true;
|
|
|
+ console.log('开始播放');
|
|
|
+ });
|
|
|
+ })
|
|
|
},
|
|
|
//隐藏视频播放窗口
|
|
|
handleClosePlayer: function () {
|
|
|
this.$refs.videoRef.pause();
|
|
|
this.currentVideoUrl = '';
|
|
|
this.showVideoDialog = false;
|
|
|
+ this.isPlayer = false;
|
|
|
},
|
|
|
//播放视频
|
|
|
handlePlayer: function () {
|
|
|
- var _self = this;
|
|
|
- var video = this.$refs.videoRef;
|
|
|
- video.addEventListener('pause', function () {
|
|
|
- _self.isPlayer = false
|
|
|
- });
|
|
|
- video.addEventListener('ended', function () {
|
|
|
- _self.isPlayer = false
|
|
|
- });
|
|
|
- video.addEventListener('error', function () {
|
|
|
- _self.isPlayer = false
|
|
|
- });
|
|
|
- video.addEventListener('play', function () {
|
|
|
- _self.isPlayer = true
|
|
|
- });
|
|
|
- if (!_self.isPlayer) video.play();
|
|
|
+ if (!this.isPlayer) this.currentVideo.play();
|
|
|
},
|
|
|
//预览office文件 word ppt pdf
|
|
|
handlePreviewOffice: function (file) {
|