aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--client/src/assets/player/peertube-videojs-plugin.ts13
-rw-r--r--client/src/assets/player/resolution-menu-button.ts1
-rw-r--r--client/src/assets/player/resolution-menu-item.ts11
-rw-r--r--client/src/sass/player/settings-menu.scss14
4 files changed, 30 insertions, 9 deletions
diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts
index fc07c35d6..208105d3c 100644
--- a/client/src/assets/player/peertube-videojs-plugin.ts
+++ b/client/src/assets/player/peertube-videojs-plugin.ts
@@ -57,6 +57,7 @@ class PeerTubePlugin extends Plugin {
57 private renderer 57 private renderer
58 private fakeRenderer 58 private fakeRenderer
59 private autoResolution = true 59 private autoResolution = true
60 private forbidAutoResolution = false
60 private isAutoResolutionObservation = false 61 private isAutoResolutionObservation = false
61 62
62 private videoViewInterval 63 private videoViewInterval
@@ -304,11 +305,17 @@ class PeerTubePlugin extends Plugin {
304 this.trigger('autoResolutionUpdate') 305 this.trigger('autoResolutionUpdate')
305 } 306 }
306 307
307 disableAutoResolution () { 308 disableAutoResolution (forbid = false) {
309 if (forbid === true) this.forbidAutoResolution = true
310
308 this.autoResolution = false 311 this.autoResolution = false
309 this.trigger('autoResolutionUpdate') 312 this.trigger('autoResolutionUpdate')
310 } 313 }
311 314
315 isAutoResolutionForbidden () {
316 return this.forbidAutoResolution === true
317 }
318
312 getCurrentVideoFile () { 319 getCurrentVideoFile () {
313 return this.currentVideoFile 320 return this.currentVideoFile
314 } 321 }
@@ -509,6 +516,8 @@ class PeerTubePlugin extends Plugin {
509 } 516 }
510 517
511 private fallbackToHttp (done?: Function, play = true) { 518 private fallbackToHttp (done?: Function, play = true) {
519 this.disableAutoResolution(true)
520
512 this.flushVideoFile(this.currentVideoFile, true) 521 this.flushVideoFile(this.currentVideoFile, true)
513 this.torrent = null 522 this.torrent = null
514 523
@@ -555,7 +564,7 @@ class PeerTubePlugin extends Plugin {
555 this.player.controlBar.on('mouseenter', () => disableInactivity()) 564 this.player.controlBar.on('mouseenter', () => disableInactivity())
556 settingsDialog.on('mouseenter', () => disableInactivity()) 565 settingsDialog.on('mouseenter', () => disableInactivity())
557 this.player.controlBar.on('mouseleave', () => enableInactivity()) 566 this.player.controlBar.on('mouseleave', () => enableInactivity())
558 settingsDialog.on('mouseleave', () => enableInactivity()) 567 // settingsDialog.on('mouseleave', () => enableInactivity())
559 } 568 }
560 569
561 private pickAverageVideoFile () { 570 private pickAverageVideoFile () {
diff --git a/client/src/assets/player/resolution-menu-button.ts b/client/src/assets/player/resolution-menu-button.ts
index d317a5efc..e30074173 100644
--- a/client/src/assets/player/resolution-menu-button.ts
+++ b/client/src/assets/player/resolution-menu-button.ts
@@ -12,6 +12,7 @@ class ResolutionMenuButton extends MenuButton {
12 this.player = player 12 this.player = player
13 13
14 player.peertube().on('videoFileUpdate', () => this.updateLabel()) 14 player.peertube().on('videoFileUpdate', () => this.updateLabel())
15 player.peertube().on('autoResolutionUpdate', () => this.updateLabel())
15 } 16 }
16 17
17 createEl () { 18 createEl () {
diff --git a/client/src/assets/player/resolution-menu-item.ts b/client/src/assets/player/resolution-menu-item.ts
index 3fe1d8f0f..0ab0f53b5 100644
--- a/client/src/assets/player/resolution-menu-item.ts
+++ b/client/src/assets/player/resolution-menu-item.ts
@@ -19,6 +19,8 @@ class ResolutionMenuItem extends MenuItem {
19 } 19 }
20 20
21 handleClick (event) { 21 handleClick (event) {
22 if (this.id === -1 && this.player_.peertube().isAutoResolutionForbidden()) return
23
22 super.handleClick(event) 24 super.handleClick(event)
23 25
24 // Auto resolution 26 // Auto resolution
@@ -32,6 +34,15 @@ class ResolutionMenuItem extends MenuItem {
32 } 34 }
33 35
34 updateSelection () { 36 updateSelection () {
37 // Check if auto resolution is forbidden or not
38 if (this.id === -1) {
39 if (this.player_.peertube().isAutoResolutionForbidden()) {
40 this.addClass('disabled')
41 } else {
42 this.removeClass('disabled')
43 }
44 }
45
35 if (this.player_.peertube().isAutoResolutionOn()) { 46 if (this.player_.peertube().isAutoResolutionOn()) {
36 this.selected(this.id === -1) 47 this.selected(this.id === -1)
37 return 48 return
diff --git a/client/src/sass/player/settings-menu.scss b/client/src/sass/player/settings-menu.scss
index f95123f52..0c064c182 100644
--- a/client/src/sass/player/settings-menu.scss
+++ b/client/src/sass/player/settings-menu.scss
@@ -99,8 +99,11 @@ $setting-transition-easing: ease-out;
99 transition: all $setting-transition-duration $setting-transition-easing; 99 transition: all $setting-transition-duration $setting-transition-easing;
100 100
101 .vjs-menu-item { 101 .vjs-menu-item {
102 font-size: 1em;
103 text-transform: initial;
102 104
103 &:hover { 105 &:hover {
106 cursor: pointer;
104 background-color: rgba(255, 255, 255, 0.2); 107 background-color: rgba(255, 255, 255, 0.2);
105 } 108 }
106 109
@@ -111,14 +114,11 @@ $setting-transition-easing: ease-out;
111 &:last-child { 114 &:last-child {
112 margin-bottom: 5px; 115 margin-bottom: 5px;
113 } 116 }
114 }
115 117
116 li { 118 &.disabled {
117 font-size: 1em; 119 opacity: 0.5;
118 text-transform: initial; 120 cursor: default !important;
119 121 background-color: inherit !important;
120 &:hover {
121 cursor: pointer;
122 } 122 }
123 } 123 }
124 } 124 }