aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets/player')
-rw-r--r--client/src/assets/player/shared/settings/resolution-menu-button.ts3
-rw-r--r--client/src/assets/player/shared/settings/resolution-menu-item.ts4
-rw-r--r--client/src/assets/player/shared/settings/settings-menu-item.ts2
-rw-r--r--client/src/assets/player/shared/webtorrent/webtorrent-plugin.ts5
4 files changed, 10 insertions, 4 deletions
diff --git a/client/src/assets/player/shared/settings/resolution-menu-button.ts b/client/src/assets/player/shared/settings/resolution-menu-button.ts
index 8bd5b4f03..a0b349f67 100644
--- a/client/src/assets/player/shared/settings/resolution-menu-button.ts
+++ b/client/src/assets/player/shared/settings/resolution-menu-button.ts
@@ -68,7 +68,8 @@ class ResolutionMenuButton extends MenuButton {
68 this.menu.addChild(new ResolutionMenuItem( 68 this.menu.addChild(new ResolutionMenuItem(
69 this.player_, 69 this.player_,
70 { 70 {
71 id: d.id, 71 id: d.id + '',
72 resolutionId: d.id,
72 label, 73 label,
73 selected: d.selected 74 selected: d.selected
74 }) 75 })
diff --git a/client/src/assets/player/shared/settings/resolution-menu-item.ts b/client/src/assets/player/shared/settings/resolution-menu-item.ts
index 6047f52f7..678eb368b 100644
--- a/client/src/assets/player/shared/settings/resolution-menu-item.ts
+++ b/client/src/assets/player/shared/settings/resolution-menu-item.ts
@@ -3,7 +3,7 @@ import videojs from 'video.js'
3const MenuItem = videojs.getComponent('MenuItem') 3const MenuItem = videojs.getComponent('MenuItem')
4 4
5export interface ResolutionMenuItemOptions extends videojs.MenuItemOptions { 5export interface ResolutionMenuItemOptions extends videojs.MenuItemOptions {
6 id: number 6 resolutionId: number
7} 7}
8 8
9class ResolutionMenuItem extends MenuItem { 9class ResolutionMenuItem extends MenuItem {
@@ -21,7 +21,7 @@ class ResolutionMenuItem extends MenuItem {
21 this.autoResolutionEnabled = true 21 this.autoResolutionEnabled = true
22 this.autoResolutionChosen = '' 22 this.autoResolutionChosen = ''
23 23
24 this.resolutionId = options.id 24 this.resolutionId = options.resolutionId
25 this.label = options.label 25 this.label = options.label
26 26
27 player.peertubeResolutions().on('resolutionChanged', () => this.updateSelection()) 27 player.peertubeResolutions().on('resolutionChanged', () => this.updateSelection())
diff --git a/client/src/assets/player/shared/settings/settings-menu-item.ts b/client/src/assets/player/shared/settings/settings-menu-item.ts
index 8d1819a2d..07ff0f2a8 100644
--- a/client/src/assets/player/shared/settings/settings-menu-item.ts
+++ b/client/src/assets/player/shared/settings/settings-menu-item.ts
@@ -301,7 +301,7 @@ class SettingsMenuItem extends MenuItem {
301 this.settingsSubMenuValueEl_.innerHTML = html 301 this.settingsSubMenuValueEl_.innerHTML = html
302 }, 250) 302 }, 250)
303 } else { 303 } else {
304 // Loop trough the submenu items to find the selected child 304 // Loop through the submenu items to find the selected child
305 for (const subMenuItem of this.subMenu.menu.children_) { 305 for (const subMenuItem of this.subMenu.menu.children_) {
306 if (!(subMenuItem instanceof component)) { 306 if (!(subMenuItem instanceof component)) {
307 continue 307 continue
diff --git a/client/src/assets/player/shared/webtorrent/webtorrent-plugin.ts b/client/src/assets/player/shared/webtorrent/webtorrent-plugin.ts
index b48203148..83b483d87 100644
--- a/client/src/assets/player/shared/webtorrent/webtorrent-plugin.ts
+++ b/client/src/assets/player/shared/webtorrent/webtorrent-plugin.ts
@@ -430,6 +430,11 @@ class WebTorrentPlugin extends Plugin {
430 private initializePlayer () { 430 private initializePlayer () {
431 this.buildQualities() 431 this.buildQualities()
432 432
433 if (this.videoFiles.length === 0) {
434 this.player.addClass('disabled')
435 return
436 }
437
433 if (this.autoplay) { 438 if (this.autoplay) {
434 this.player.posterImage.hide() 439 this.player.posterImage.hide()
435 440