Answer the question
In order to leave comments, you need to log in
Track variable, not scope?
There is a player object. It has an ended property.
Is it possible to track the change of player.ended in the form of such an example
player = document.getElementsByClassName('player')[0];
scope.video = [МАССИВ];
var
count = 0,
length = scope.video.length;
scope.$watch("player.ended", function (newValue, oldValue) {
if(newValue == oldValue || newValue){
scope.player.setAttribute('src', scope.video[count++%length]);
scope.player.play();
}
});
Answer the question
In order to leave comments, you need to log in
You don't have to do that. Find the desired event on your player and subscribe to it
Of course you can. Just before that, you need to set this variable before and outside the function:newValue = "";
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question