(function () { "use strict"; angular.module('laz.videoLibrary') .component('currentVideoPlayer', { controller: 'currentVideoPlayerCtrl', templateUrl: '/shared/js/angular/video-library/current-video-player.html', bindings: { video: '<' } }) .controller('currentVideoPlayerCtrl', [ function() { var ctrl = this; ctrl.$onChanges = function(changes){ if(changes.video){ var captions = (ctrl.video && ctrl.video.captionFiles) || []; ctrl.captionFiles = captions.map(function(caption){ return angular.extend({}, caption, { filename: caption.src }); }); ctrl.displayTitle = ctrl.video.categoryName ? ctrl.video.categoryName + ': ' + ctrl.video.title : ctrl.video.title; } } }]); })();