I have a VideoElement with id="videoElement" where
$('#videoElement')[0].currentTime;
gives me time which a video is playing at.
On my controller I have a method
setTime(time)
where time is the value of the video elements currentTime value.
How can I pass this value to it?
Found a way to do this (after Mathew's comment below as my solution initially was tying the controller to the view):
app.directive('currentVideoPlayTime', function () {
var linker = function (scope, element, attrs) {
element.bind('timeupdate', function () {
scope.currentPlayTime = element[0].currentTime;
});
};
return {
restrict:'A',
link:linker
}
});