Skip to content

Commit

Permalink
fix media player can not pause bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mryanshenghong committed Oct 28, 2021
1 parent 5ff3996 commit e2c290f
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/components/Blog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,7 @@ export default class CardView extends Vue {
public onMusicPlay(player: any) {
if (this.currentMediaRef) {
if (this.currentMediaRef.type === "music" && this.currentMediaRef.ele !== this.$refs.musicPlayer) {
this.currentMediaRef.ele.pause();
}
if (this.currentMediaRef.type === "video" && this.currentMediaRef.ele !== (this.$refs.videoPlayer as any).$refs.video) {
this.currentMediaRef.ele.pause();
}
this.currentMediaRef.ele.pause();
}
this.setMediaRef({
type: "music",
Expand All @@ -124,12 +119,7 @@ export default class CardView extends Vue {
public onVideoPlay() {
if (this.currentMediaRef) {
if (this.currentMediaRef.type === "music" && this.currentMediaRef.ele !== this.$refs.musicPlayer) {
this.currentMediaRef.ele.pause();
}
if (this.currentMediaRef.type === "video" && this.currentMediaRef.ele !== (this.$refs.videoPlayer as any).$refs.video) {
this.currentMediaRef.ele.pause();
}
this.currentMediaRef.ele.pause();
}
this.setMediaRef({
type: "video",
Expand Down

0 comments on commit e2c290f

Please sign in to comment.