|
@@ -41,6 +41,13 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ controlStatus:function () {
|
|
|
|
+ if (this.controlStatus) {
|
|
|
|
+ this.play();
|
|
|
|
+ } else {
|
|
|
|
+ this.pause();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -65,6 +72,7 @@ export default {
|
|
|
|
|
|
// 暂停动画
|
|
// 暂停动画
|
|
pause(){
|
|
pause(){
|
|
|
|
+
|
|
if (this.player) this.player.pauseAnimation();
|
|
if (this.player) this.player.pauseAnimation();
|
|
},
|
|
},
|
|
|
|
|
|
@@ -84,42 +92,54 @@ export default {
|
|
useSrc = useSrc[0];
|
|
useSrc = useSrc[0];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
// useSrc = 'http://localhost:8080/svga/'+this.play_src.split('/').pop();
|
|
// useSrc = 'http://localhost:8080/svga/'+this.play_src.split('/').pop();
|
|
this.parser.load(useSrc || this.play_src, (videoItem)=>{
|
|
this.parser.load(useSrc || this.play_src, (videoItem)=>{
|
|
this.player.loops = count; // 设置循环播放次数是1
|
|
this.player.loops = count; // 设置循环播放次数是1
|
|
- this.player.setVideoItem(videoItem);
|
|
|
|
|
|
|
|
if (this.mode) {
|
|
if (this.mode) {
|
|
this.player.setContentMode(this.mode);
|
|
this.player.setContentMode(this.mode);
|
|
}
|
|
}
|
|
|
|
|
|
- this.player.startAnimation();
|
|
|
|
|
|
+ this.player.setVideoItem(videoItem);
|
|
|
|
|
|
|
|
+ if (this.hoverStatus) {
|
|
|
|
+ if (this.hoverPlayStatus) {
|
|
|
|
+ return this.player.startAnimation();
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ return this.controlStatus && this.player.startAnimation();
|
|
|
|
+ }
|
|
},()=>{
|
|
},()=>{
|
|
if (this.$attrs.onStop) {
|
|
if (this.$attrs.onStop) {
|
|
this.$emit('stop');
|
|
this.$emit('stop');
|
|
}
|
|
}
|
|
});
|
|
});
|
|
} else if (this.src === this.play_src){
|
|
} else if (this.src === this.play_src){
|
|
- this.player.startAnimation();
|
|
|
|
|
|
+ //
|
|
|
|
+ this.controlStatus && this.player.stepToFrame(this.player._currentFrame || 0,true);
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
// 进入
|
|
// 进入
|
|
enter(){
|
|
enter(){
|
|
- if (!this.hover) return ;
|
|
|
|
|
|
+ if (!this.hover && !this.hoverStatus) return ;
|
|
if (!this.draw) this.draw = true;
|
|
if (!this.draw) this.draw = true;
|
|
|
|
|
|
- this.status = true;
|
|
|
|
|
|
+
|
|
|
|
+ if (this.hoverStatus) this.hoverPlayStatus= true;
|
|
|
|
+ else this.status = true;
|
|
|
|
|
|
return nextTick(()=> this.play(0));
|
|
return nextTick(()=> this.play(0));
|
|
},
|
|
},
|
|
|
|
|
|
// 离开
|
|
// 离开
|
|
leave(){
|
|
leave(){
|
|
- if (!this.hover) return ;
|
|
|
|
- this.status = false;
|
|
|
|
|
|
+ if (!this.hover && !this.hoverStatus) return ;
|
|
|
|
+ if (this.hoverStatus) this.hoverPlayStatus= false;
|
|
|
|
+ else this.status = false;
|
|
this.pause();
|
|
this.pause();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -143,6 +163,10 @@ export default {
|
|
|
|
|
|
created() {
|
|
created() {
|
|
this.status = !this.hover;
|
|
this.status = !this.hover;
|
|
|
|
+ if (this.hoverStatus) {
|
|
|
|
+ this.status = true;
|
|
|
|
+ this.hoverPlayStatus = false;
|
|
|
|
+ }
|
|
if (this.status) {
|
|
if (this.status) {
|
|
this.status = this.playStatus;
|
|
this.status = this.playStatus;
|
|
}
|
|
}
|