Open Agusteen opened 7 years ago
hey! thanks for the kind words.
there's some discussion about this in #80 you could check out.
currently, there's no super simple answer. hope you get things working! 🌟
With a $watch not working... I think that I found a better solution, share it here for somebody who serves: I use angular service $interval, the function "timer" take as parameter the name of player and this refresh the time every 1 second. Here the documentation of $interval: https://docs.angularjs.org/api/ng/service/$interval
var timer = function(video) {
var promise = $interval(function() {
$scope. currentTime = video.getCurrentTime(); //this show current time in my view
if(condition to end interval)) {
$interval.cancel(promise);
}
}, 1000);
}
timer($scope.myPlayer);
I hope this helps someone!!
thanks for sharing!
Hello, first of all, thanks for this, it's very useful!...
I want to show the current time of the video, with the form: "min:sec", and this update it constantly in my HTML. I've been trying with a $watch of 'player.getCurrentTime()' but I didn't succeed. Is there a form od add it this watcher like a directive?.
From already thank you very much.