I am playing a video using vimeo in vue js app but i cant able to get the pause event and play event... Below i have given the code which i am using it, but it seems i missed the something or i am not getting the point to add. Video is getting through the API it is playing but i want to get pause event trigger on when video pause.
<template>
<div style="max-height: 560px">
<h1 class="title is-size-3" style="text-align: center;">{{ videoTitle }}</h1>
<vue-plyr ref="plyr">
<div class="plyr__video-embed">
<iframe
v-bind:src="videoUrl"
allowfullscreen
allowtransparency
allow="autoplay"
height="100%"
width="100%"
></iframe>
</div>
</vue-plyr>
<div class="vimeoPlayer"></div>
</div>
</template>
<script>
import { GET_VIDEO } from "../utils/endpoint.js";
const axios = require("axios");
export default {
name: "Vimeo",
data() {
return {
videoUrl: "",
videoTitle: "",
videoVimeoId: ""
};
},
computed: {
player() {
return this.$refs.plyr.player;
}
},
methods: {
onVideoPause: function() {
console.log("Video is Paused");
}
},
mounted() {
this.video_id = this.$route.query.video_id;
axios
.get(api)
.then(response => {
this.videoUrl =
response.data.data.video_url +
"?loop=false&byline=false&portrait=false&title=false&speed=true&transparent=0&gesture=media";
this.videoTitle = response.data.data.title;
this.videoVimeoId = response.data.data.video_url.split("/")[4];
})
.catch(e => {
console.log(e);
});
}
};
</script>