How can I get the currentTime of a YouTube video?
I have been searching in the YouTube api and I just do not understand: https://developers.google.com/youtube/js_api_reference?csw=1
I have been searching in Stack and try to apply what they say but it does not work. Problably I am missing something that I do not understand:
Youtube API returning current time
Getting Current YouTube Video Time
I would appreciate any guidence to know where to begin
You can check yourself: http://jsfiddle.net/twL9z8e1/
$("#bookmarkBoto").click(function() {
//var time = $("#yt").currentTime();//no
//var time = $("#yt").getCurrentTime();//no
$('#check').text(time);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<iframe id="yt" name="yt" width="720" height="405" src="https://www.youtube.com/embed/M7lc1UVf-VE" frameborder="0" allowfullscreen></iframe>
<br><br>
<div id="bookmarkBoto">bookmarkBoto</div>
<div id="check">check</div>