I'm tyring to write an own custom directive for HTML video element, I got this:
finalCutApp.directive('finalcutPlayer', ($timeout) => {
return {
restrict: 'A',
link: ($scope, $elem, $attrs) => {
$elem.on('canplay', () => {
$timeout(()=> {$scope.$emit('finalcutplayer.events.canplay')});
});
}
};
});
So I got this markup:
<video finalcut-player id="html5-player" controls>
<source src="videos/react@iugh.mp4" type="video/mp4">
</video>
So far I've achieved to get the event catched up at my controller. However I'm not sure how I can either programatically start the player or even change and reload its sources.
How can I achieve it?