I am retrieving videos from Vimeo server to play course videos in my website. On click of tag im playing the video in popup.
<a class="btn btn-primary btn-lg popup-vimeo btn-video" href="<?php echo 'https://player.vimeo.com/video/' . $vdoid; ?>">
<i class="fa fa-play" aria-hidden="true" style="font-weight:600;" id="<?php echo "vdo_" . $vv; ?>"></i></a>
Now I want to track the video current time using script. But on click of that tag it loads a separate view page(while inspecting) as popup.
I tried to track the player and to get the current played time from the player and i tried using this script.
<script src="https://player.vimeo.com/api/player.js"></script>
<script>
$(document).on('click', '.btn-video', function ()
{
var id = $(this).attr("id");
var iframe = document.getElementById(id);
var vPlayer = new Vimeo.Player(iframe);
setInterval(function ()
{
console.log(iframe);
console.log(vPlayer);
var currtym = vPlayer.getCurrentTime();
console.log(currtym);
var currentTime = vPlayer.currentTime;
console.log(currentTime);
}, 1000);
});
But im running out of ideas. Someone please help me to figure it out.!! Thanks...