@@ -33,6 +33,8 @@ angular.module('streama.videoPlayer').directive('streamaVideoPlayer', [
3333 $scope . getBackgroundStyle = getBackgroundStyle ;
3434 $scope . changeEpisode = changeEpisode ;
3535 $scope . selectSubtitle = selectSubtitle ;
36+ $scope . selectVideoFile = selectVideoFile ;
37+ $scope . isVideoFileSelected = isVideoFileSelected ;
3638 $scope . showControls = showControls ;
3739 $scope . toggleSelectEpisodes = toggleSelectEpisodes ;
3840 $scope . createNewPlayerSession = createNewPlayerSession ;
@@ -135,6 +137,20 @@ angular.module('streama.videoPlayer').directive('streamaVideoPlayer', [
135137 localStorageService . set ( 'selectedSubtitleLanguage' , _ . get ( subtitle , 'subtitleSrcLang' ) ) ;
136138 }
137139
140+ function selectVideoFile ( videoFile ) {
141+ $scope . initialPlay = false ;
142+ $scope . options . customStartingTime = video . currentTime ;
143+ $scope . options . selectedVideoFile = videoFile ;
144+ $scope . options . videoSrc = ( videoFile . src || videoFile . externalLink ) ;
145+ $scope . options . originalFilename = videoFile . originalFilename ;
146+ $scope . options . videoType = videoFile . contentType ;
147+ localStorageService . set ( 'selectedVideoFile' , videoFile . label ) ;
148+ }
149+
150+ function isVideoFileSelected ( videoFile ) {
151+ return _ . isEqualBy ( $scope . options . selectedVideoFile , videoFile , 'id' ) ;
152+ }
153+
138154 function getCurrentSubtitleTrack ( ) {
139155 return _ . find ( $scope . options . subtitles , { id : $scope . options . currentSubtitle } ) ;
140156 }
@@ -378,7 +394,7 @@ angular.module('streama.videoPlayer').directive('streamaVideoPlayer', [
378394 }
379395
380396
381- console . log ( 'TIME UPDATE at time: ' + video . currentTime ) ;
397+ // console.log('TIME UPDATE at time: ' + video.currentTime);
382398 }
383399
384400 function determineNextVideoShowing ( ) {
0 commit comments