Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions app/js/controllers/PlayerCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
angular.module('storm.controllers')

// Player
.controller('PlayerCtrl', ['$scope', '$rootScope', '$timeout', '$sce', 'Player', 'Settings', 'Navigation', 'Remote',
.controller('PlayerCtrl', ['$scope', '$rootScope', '$timeout', '$sce', 'Player', 'Settings', 'Navigation', 'Remote',
function($scope, $rootScope, $timeout, $sce, Player, Settings, Navigation, Remote) {

$scope.playerLayer = true;
Expand Down Expand Up @@ -52,6 +52,13 @@ angular.module('storm.controllers')
Player.closePlayer();
};

$scope.save = function() {
var pom = win.window.document.createElement('a');
pom.setAttribute('href', $scope.videoUrl);
pom.setAttribute('download', $scope.item.name + '.mp4');
pom.click();
}

// Wait for player scope
var watchPlayer = $scope.$watch(function() {
return angular.element(document.querySelector('video')).scope();
Expand Down Expand Up @@ -90,7 +97,7 @@ angular.module('storm.controllers')

//
// REMOTE EVENTS
//
//

// Listen to track change to notify Remote
$scope.$watch('tracks', function(value) {
Expand Down
3 changes: 2 additions & 1 deletion app/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"PLAY": "Play",
"CANCEL": "Cancel",
"CLOSE": "Close",
"SAVE": "Save",
"CAST": "Cast",
"DIRECTOR": "Director",
"AUDIO_LANGUAGE": "Audio language",
Expand Down Expand Up @@ -146,4 +147,4 @@
"ADD_SUBTITLE_FROM_FILE": "Add subtitle from local file",
"NEWS_MSG": "While this application supports navigation with mouse, is optimized to be navigated with the keyboard or by connecting your smartphone as a remote control. To configure it, you can go to the Remote section of the upper left menu.",
"UI_MSG": "If you notice navigation is not smooth enough, go to Settings (top menu to the right) and disable UI animations and blur effect."
}
}
3 changes: 2 additions & 1 deletion app/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"PLAY": "Reproducir",
"CANCEL": "Cancelar",
"CLOSE": "Cerrar",
"SAVE": "Guardar",
"CAST": "Reparto",
"DIRECTOR": "Director",
"AUDIO_LANGUAGE": "Idioma de audio",
Expand Down Expand Up @@ -146,4 +147,4 @@
"ADD_SUBTITLE_FROM_FILE": "Agregar subtítulo desde archivo local",
"NEWS_MSG": "Si bien esta aplicación soporta la navegación con mouse, está optimizada para ser navegada con el teclado o conectando tu smartphone como control remoto. Para configurarlo, puedes ir a la sección Remoto a la izquierda del menu superior.",
"UI_MSG": "Si notas que la navegación no es tan fluida, ve a Ajustes (a la derecha del menú principal) y desactiva las animaciones y efecto blur."
}
}
3 changes: 2 additions & 1 deletion app/views/player.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<st-title-bar></st-title-bar>
<div class="wrap">
<a class="button close" st-navigatable ng-click="showClosePlayer()" nav-on="{escape: 'preventDefault', enter: showClosePlayer, up: 'preventDefault'}" nav-title="close-button" st-nav-if="playerLayer"><span translate>EXIT_VIDEO</span></a>
<a class="button close" ng-if="progress.complete" st-navigatable ng-click="save()" nav-on="{escape: 'preventDefault', enter: save, up: 'preventDefault'}" nav-title="save-button" st-nav-if="playerLayer"><span translate>SAVE</span></a>
<div once-if="item">
<img once-src="item.type=='episode' ? item.tvshow.covers.medium : item.covers.medium" />
<div class="info">
Expand Down Expand Up @@ -91,4 +92,4 @@ <h2 translate>EXIT_VIDEO</h2>
<li><a class="button big" ng-click="hideClosePlayer()" st-navigatable nav-on="{enter: hideClosePlayer, escape: hideClosePlayer, down: 'preventDefault'}" st-nav-if="playerCloseAlert"><span translate>CANCEL</span></a></li>
</ul>
</div>
</div>
</div>