Skip to content

Commit 88ee0b7

Browse files
GUACAMOLE-2025: Add a button to close the recording video player.
1 parent 2aa6afd commit 88ee0b7

5 files changed

Lines changed: 45 additions & 1 deletion

File tree

guacamole/src/main/frontend/src/app/player/directives/player.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ angular.module('player').directive('guacPlayer', ['$injector', function guacPlay
8383
const keyEventDisplayService = $injector.get('keyEventDisplayService');
8484
const playerHeatmapService = $injector.get('playerHeatmapService');
8585
const playerTimeService = $injector.get('playerTimeService');
86+
const $location = $injector.get('$location');
87+
const $routeParams = $injector.get('$routeParams');
8688

8789
/**
8890
* The number of milliseconds after the last detected mouse activity after
@@ -406,6 +408,14 @@ angular.module('player').directive('guacPlayer', ['$injector', function guacPlay
406408
}
407409
};
408410

411+
/**
412+
* Close recording player and return to history.
413+
*/
414+
$scope.closePlayer = function closePlayer() {
415+
const datasource = encodeURIComponent($routeParams.dataSource);
416+
$location.path('/settings/' + datasource + '/history');
417+
};
418+
409419
// Automatically load the requested session recording
410420
$scope.$watch('src', function srcChanged(src) {
411421

guacamole/src/main/frontend/src/app/player/styles/player.css

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ guac-player .guac-player-controls {
8383
margin: 0;
8484
}
8585

86+
.guac-player-controls .guac-player-close:hover,
8687
.guac-player-controls .guac-player-play:hover,
8788
.guac-player-controls .guac-player-pause:hover {
8889
background: rgba(255, 255, 255, 0.5);
@@ -113,6 +114,31 @@ guac-player .guac-player-controls {
113114
align-items: center;
114115
}
115116

117+
.guac-player-controls .guac-player-close {
118+
background: transparent;
119+
border: 0;
120+
box-shadow: none;
121+
margin: 0;
122+
min-width: 0;
123+
padding: 0;
124+
position: fixed;
125+
right: 0;
126+
top: 0;
127+
}
128+
129+
.guac-player-controls .guac-player-close .close-icon {
130+
background-image: url('images/x.svg');
131+
background-position: center center;
132+
background-repeat: no-repeat;
133+
background-size: 50%;
134+
content: "";
135+
cursor: pointer;
136+
display: block;
137+
height: 40px;
138+
margin: 0;
139+
width: 40px;
140+
}
141+
116142
.guac-player-controls .guac-player-keys {
117143
margin-left: auto;
118144
padding-right: 0.5em;
@@ -190,11 +216,12 @@ guac-player-display {
190216

191217
guac-player-text-view {
192218

219+
margin-top: 40px;
193220
min-width: 25em;
194221
flex-basis: 0;
195222

196223
/* Make room for the control bar at the bottom */
197-
height: calc(100% - 48px);
224+
height: calc(100% - 88px);
198225

199226
}
200227

guacamole/src/main/frontend/src/app/player/templates/player.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545

4646
<div class="guac-player-buttons">
4747

48+
<!-- Close button -->
49+
<button class="guac-player-close"
50+
ng-attr-title="{{ 'PLAYER.ACTION_CLOSE' | translate }}"
51+
ng-click="closePlayer()"><span class="close-icon"></span></button>
52+
4853
<!-- Play button -->
4954
<button class="guac-player-play"
5055
ng-attr-title="{{ 'PLAYER.ACTION_PLAY' | translate }}"

guacamole/src/main/frontend/src/translations/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@
486486
"PLAYER" : {
487487

488488
"ACTION_CANCEL" : "@:APP.ACTION_CANCEL",
489+
"ACTION_CLOSE" : "Close",
489490
"ACTION_PAUSE" : "@:APP.ACTION_PAUSE",
490491
"ACTION_PLAY" : "@:APP.ACTION_PLAY",
491492
"ACTION_SHOW_KEY_LOG" : "Keystroke Log",

guacamole/src/main/frontend/src/translations/fr.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@
481481
"PLAYER" : {
482482

483483
"ACTION_CANCEL" : "@:APP.ACTION_CANCEL",
484+
"ACTION_CLOSE" : "Fermer",
484485
"ACTION_PAUSE" : "@:APP.ACTION_PAUSE",
485486
"ACTION_PLAY" : "@:APP.ACTION_PLAY",
486487
"ACTION_SHOW_KEY_LOG" : "Journal des frappes",

0 commit comments

Comments
 (0)