diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-11 09:21:13 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-11 09:21:13 +0200 |
commit | 784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428 (patch) | |
tree | 29c46cfd6344065eb805680ed080cb05592ee1d4 /client | |
parent | c3030e944ad03c7fd7b5d668a2d88ff03e4cdf19 (diff) | |
download | PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.tar.gz PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.tar.zst PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.zip |
Prefer web videos in favour of webtorrent
Diffstat (limited to 'client')
12 files changed, 55 insertions, 57 deletions
diff --git a/client/e2e/src/suites-all/private-videos.e2e-spec.ts b/client/e2e/src/suites-all/private-videos.e2e-spec.ts index a25208bb3..829d76a84 100644 --- a/client/e2e/src/suites-all/private-videos.e2e-spec.ts +++ b/client/e2e/src/suites-all/private-videos.e2e-spec.ts | |||
@@ -31,8 +31,8 @@ describe('Private videos all workflow', () => { | |||
31 | return loginPage.loginOnPeerTube2() | 31 | return loginPage.loginOnPeerTube2() |
32 | }) | 32 | }) |
33 | 33 | ||
34 | it('Should play an internal webtorrent video', async () => { | 34 | it('Should play an internal web video video', async () => { |
35 | await go(FIXTURE_URLS.INTERNAL_WEBTORRENT_VIDEO) | 35 | await go(FIXTURE_URLS.INTERNAL_WEB_VIDEO) |
36 | 36 | ||
37 | await videoWatchPage.waitWatchVideoName(internalVideoName) | 37 | await videoWatchPage.waitWatchVideoName(internalVideoName) |
38 | await checkCorrectlyPlay(playerPage) | 38 | await checkCorrectlyPlay(playerPage) |
@@ -52,8 +52,8 @@ describe('Private videos all workflow', () => { | |||
52 | await checkCorrectlyPlay(playerPage) | 52 | await checkCorrectlyPlay(playerPage) |
53 | }) | 53 | }) |
54 | 54 | ||
55 | it('Should play an internal WebTorrent video in embed', async () => { | 55 | it('Should play an internal Web Video in embed', async () => { |
56 | await go(FIXTURE_URLS.INTERNAL_EMBED_WEBTORRENT_VIDEO) | 56 | await go(FIXTURE_URLS.INTERNAL_EMBED_WEB_VIDEO) |
57 | 57 | ||
58 | await videoWatchPage.waitEmbedForDisplayed() | 58 | await videoWatchPage.waitEmbedForDisplayed() |
59 | await checkCorrectlyPlay(playerPage) | 59 | await checkCorrectlyPlay(playerPage) |
diff --git a/client/e2e/src/suites-all/videos.e2e-spec.ts b/client/e2e/src/suites-all/videos.e2e-spec.ts index d1ab9aef3..5d0f8c152 100644 --- a/client/e2e/src/suites-all/videos.e2e-spec.ts +++ b/client/e2e/src/suites-all/videos.e2e-spec.ts | |||
@@ -89,7 +89,7 @@ describe('Videos all workflow', () => { | |||
89 | let videoNameToExcept = videoName | 89 | let videoNameToExcept = videoName |
90 | 90 | ||
91 | if (isMobileDevice() || isSafari()) { | 91 | if (isMobileDevice() || isSafari()) { |
92 | await go(FIXTURE_URLS.WEBTORRENT_VIDEO) | 92 | await go(FIXTURE_URLS.WEB_VIDEO) |
93 | videoNameToExcept = 'E2E tests' | 93 | videoNameToExcept = 'E2E tests' |
94 | } else { | 94 | } else { |
95 | await videoListPage.clickOnVideo(videoName) | 95 | await videoListPage.clickOnVideo(videoName) |
@@ -176,7 +176,7 @@ describe('Videos all workflow', () => { | |||
176 | await videoWatchPage.waitUntilVideoName(video2Name, 40 * 1000) | 176 | await videoWatchPage.waitUntilVideoName(video2Name, 40 * 1000) |
177 | }) | 177 | }) |
178 | 178 | ||
179 | it('Should watch the webtorrent playlist in the embed', async () => { | 179 | it('Should watch the WEB VIDEO playlist in the embed', async () => { |
180 | if (isUploadUnsupported()) return | 180 | if (isUploadUnsupported()) return |
181 | 181 | ||
182 | const accessToken = await browser.execute(`return window.localStorage.getItem('access_token');`) | 182 | const accessToken = await browser.execute(`return window.localStorage.getItem('access_token');`) |
diff --git a/client/e2e/src/utils/urls.ts b/client/e2e/src/utils/urls.ts index cc0bdfbff..eafe0aa5d 100644 --- a/client/e2e/src/utils/urls.ts +++ b/client/e2e/src/utils/urls.ts | |||
@@ -1,14 +1,14 @@ | |||
1 | const FIXTURE_URLS = { | 1 | const FIXTURE_URLS = { |
2 | INTERNAL_WEBTORRENT_VIDEO: 'https://peertube2.cpy.re/w/pwfz7NizSdPD4mJcbbmNwa?mode=webtorrent&start=0', | 2 | INTERNAL_WEB_VIDEO: 'https://peertube2.cpy.re/w/pwfz7NizSdPD4mJcbbmNwa?mode=web-video&start=0', |
3 | INTERNAL_HLS_VIDEO: 'https://peertube2.cpy.re/w/pwfz7NizSdPD4mJcbbmNwa?start=0', | 3 | INTERNAL_HLS_VIDEO: 'https://peertube2.cpy.re/w/pwfz7NizSdPD4mJcbbmNwa?start=0', |
4 | 4 | ||
5 | INTERNAL_EMBED_WEBTORRENT_VIDEO: 'https://peertube2.cpy.re/videos/embed/pwfz7NizSdPD4mJcbbmNwa?mode=webtorrent&start=0', | 5 | INTERNAL_EMBED_WEB_VIDEO: 'https://peertube2.cpy.re/videos/embed/pwfz7NizSdPD4mJcbbmNwa?mode=web-video&start=0', |
6 | INTERNAL_EMBED_HLS_VIDEO: 'https://peertube2.cpy.re/videos/embed/pwfz7NizSdPD4mJcbbmNwa?start=0', | 6 | INTERNAL_EMBED_HLS_VIDEO: 'https://peertube2.cpy.re/videos/embed/pwfz7NizSdPD4mJcbbmNwa?start=0', |
7 | 7 | ||
8 | INTERNAL_HLS_ONLY_VIDEO: 'https://peertube2.cpy.re/w/tKQmHcqdYZRdCszLUiWM3V?start=0', | 8 | INTERNAL_HLS_ONLY_VIDEO: 'https://peertube2.cpy.re/w/tKQmHcqdYZRdCszLUiWM3V?start=0', |
9 | INTERNAL_EMBED_HLS_ONLY_VIDEO: 'https://peertube2.cpy.re/videos/embed/tKQmHcqdYZRdCszLUiWM3V?start=0', | 9 | INTERNAL_EMBED_HLS_ONLY_VIDEO: 'https://peertube2.cpy.re/videos/embed/tKQmHcqdYZRdCszLUiWM3V?start=0', |
10 | 10 | ||
11 | WEBTORRENT_VIDEO: 'https://peertube2.cpy.re/w/122d093a-1ede-43bd-bd34-59d2931ffc5e', | 11 | WEB_VIDEO: 'https://peertube2.cpy.re/w/122d093a-1ede-43bd-bd34-59d2931ffc5e', |
12 | 12 | ||
13 | HLS_EMBED: 'https://peertube2.cpy.re/videos/embed/969bf103-7818-43b5-94a0-de159e13de50', | 13 | HLS_EMBED: 'https://peertube2.cpy.re/videos/embed/969bf103-7818-43b5-94a0-de159e13de50', |
14 | HLS_PLAYLIST_EMBED: 'https://peertube2.cpy.re/video-playlists/embed/73804a40-da9a-40c2-b1eb-2c6d9eec8f0a', | 14 | HLS_PLAYLIST_EMBED: 'https://peertube2.cpy.re/video-playlists/embed/73804a40-da9a-40c2-b1eb-2c6d9eec8f0a', |
diff --git a/client/e2e/wdio.local-test.conf.ts b/client/e2e/wdio.local-test.conf.ts index 96ddc67ca..6c0171372 100644 --- a/client/e2e/wdio.local-test.conf.ts +++ b/client/e2e/wdio.local-test.conf.ts | |||
@@ -24,19 +24,19 @@ module.exports = { | |||
24 | specFileRetries: 0, | 24 | specFileRetries: 0, |
25 | 25 | ||
26 | capabilities: [ | 26 | capabilities: [ |
27 | { | 27 | // { |
28 | 'browserName': 'chrome', | 28 | // 'browserName': 'chrome', |
29 | 'acceptInsecureCerts': true, | 29 | // 'acceptInsecureCerts': true, |
30 | 'goog:chromeOptions': { | 30 | // 'goog:chromeOptions': { |
31 | args: [ '--disable-gpu', windowSizeArg ], | 31 | // args: [ '--disable-gpu', windowSizeArg ], |
32 | prefs | 32 | // prefs |
33 | } | 33 | // } |
34 | }, | 34 | // }, |
35 | { | 35 | { |
36 | 'browserName': 'firefox', | 36 | 'browserName': 'firefox', |
37 | 'moz:firefoxOptions': { | 37 | 'moz:firefoxOptions': { |
38 | binary: '/usr/bin/firefox-developer-edition', | 38 | binary: '/usr/bin/firefox-developer-edition', |
39 | args: [ '--headless', windowSizeArg ], | 39 | // args: [ '--headless', windowSizeArg ], |
40 | 40 | ||
41 | prefs | 41 | prefs |
42 | } | 42 | } |
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html index fb750aca6..7218511a9 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html | |||
@@ -71,7 +71,7 @@ | |||
71 | <div class="form-group" [ngClass]="getTranscodingDisabledClass()"> | 71 | <div class="form-group" [ngClass]="getTranscodingDisabledClass()"> |
72 | <my-peertube-checkbox | 72 | <my-peertube-checkbox |
73 | inputName="transcodingWebTorrentEnabled" formControlName="enabled" | 73 | inputName="transcodingWebTorrentEnabled" formControlName="enabled" |
74 | i18n-labelText labelText="WebTorrent enabled" | 74 | i18n-labelText labelText="Web Videos enabled" |
75 | > | 75 | > |
76 | <ng-template ptTemplate="help"> | 76 | <ng-template ptTemplate="help"> |
77 | <ng-container> | 77 | <ng-container> |
@@ -93,14 +93,14 @@ | |||
93 | <ng-container i18n> | 93 | <ng-container i18n> |
94 | <strong>Requires ffmpeg >= 4.1</strong> | 94 | <strong>Requires ffmpeg >= 4.1</strong> |
95 | 95 | ||
96 | <p>Generate HLS playlists and fragmented MP4 files resulting in a better playback than with plain WebTorrent:</p> | 96 | <p>Generate HLS playlists and fragmented MP4 files resulting in a better playback than with Web Videos:</p> |
97 | <ul> | 97 | <ul> |
98 | <li>Resolution change is smoother</li> | 98 | <li>Resolution change is smoother</li> |
99 | <li>Faster playback especially with long videos</li> | 99 | <li>Faster playback especially with long videos</li> |
100 | <li>More stable playback (less bugs/infinite loading)</li> | 100 | <li>More stable playback (less bugs/infinite loading)</li> |
101 | </ul> | 101 | </ul> |
102 | 102 | ||
103 | <p>If you also enabled WebTorrent support, it will multiply videos storage by 2</p> | 103 | <p>If you also enabled Web Videos support, it will multiply videos storage by 2</p> |
104 | </ng-container> | 104 | </ng-container> |
105 | </ng-template> | 105 | </ng-template> |
106 | </my-peertube-checkbox> | 106 | </my-peertube-checkbox> |
diff --git a/client/src/app/+admin/overview/videos/video-admin.service.ts b/client/src/app/+admin/overview/videos/video-admin.service.ts index 195b265a1..722495706 100644 --- a/client/src/app/+admin/overview/videos/video-admin.service.ts +++ b/client/src/app/+admin/overview/videos/video-admin.service.ts | |||
@@ -59,12 +59,12 @@ export class VideoAdminService { | |||
59 | title: $localize`Video files`, | 59 | title: $localize`Video files`, |
60 | children: [ | 60 | children: [ |
61 | { | 61 | { |
62 | value: 'webtorrent:true isLocal:true', | 62 | value: 'webVideos:true isLocal:true', |
63 | label: $localize`With WebTorrent` | 63 | label: $localize`With Web Videos` |
64 | }, | 64 | }, |
65 | { | 65 | { |
66 | value: 'webtorrent:false isLocal:true', | 66 | value: 'webVideos:false isLocal:true', |
67 | label: $localize`Without WebTorrent` | 67 | label: $localize`Without Web Videos` |
68 | }, | 68 | }, |
69 | { | 69 | { |
70 | value: 'hls:true isLocal:true', | 70 | value: 'hls:true isLocal:true', |
@@ -126,8 +126,8 @@ export class VideoAdminService { | |||
126 | prefix: 'hls:', | 126 | prefix: 'hls:', |
127 | isBoolean: true | 127 | isBoolean: true |
128 | }, | 128 | }, |
129 | hasWebtorrentFiles: { | 129 | hasWebVideoFiles: { |
130 | prefix: 'webtorrent:', | 130 | prefix: 'webVideos:', |
131 | isBoolean: true | 131 | isBoolean: true |
132 | }, | 132 | }, |
133 | isLive: { | 133 | isLive: { |
diff --git a/client/src/app/+admin/overview/videos/video-list.component.html b/client/src/app/+admin/overview/videos/video-list.component.html index c4f78cadc..3a4666435 100644 --- a/client/src/app/+admin/overview/videos/video-list.component.html +++ b/client/src/app/+admin/overview/videos/video-list.component.html | |||
@@ -83,8 +83,8 @@ | |||
83 | </td> | 83 | </td> |
84 | 84 | ||
85 | <td> | 85 | <td> |
86 | <span *ngIf="isHLS(video)" class="pt-badge badge-blue">HLS</span> | 86 | <span *ngIf="hasHLS(video)" class="pt-badge badge-blue">HLS</span> |
87 | <span *ngIf="isWebTorrent(video)" class="pt-badge badge-blue">WebTorrent ({{ video.files.length }})</span> | 87 | <span *ngIf="hasWebVideos(video)" class="pt-badge badge-blue">Web Videos ({{ video.files.length }})</span> |
88 | <span i18n *ngIf="video.isLive" class="pt-badge badge-blue">Live</span> | 88 | <span i18n *ngIf="video.isLive" class="pt-badge badge-blue">Live</span> |
89 | <span i18n *ngIf="hasObjectStorage(video)" class="pt-badge badge-purple">Object storage</span> | 89 | <span i18n *ngIf="hasObjectStorage(video)" class="pt-badge badge-purple">Object storage</span> |
90 | 90 | ||
@@ -102,8 +102,8 @@ | |||
102 | <tr> | 102 | <tr> |
103 | <td class="video-info expand-cell" myAutoColspan> | 103 | <td class="video-info expand-cell" myAutoColspan> |
104 | <div> | 104 | <div> |
105 | <div *ngIf="isWebTorrent(video)"> | 105 | <div *ngIf="hasWebVideos(video)"> |
106 | WebTorrent: | 106 | Web Videos: |
107 | 107 | ||
108 | <ul> | 108 | <ul> |
109 | <li *ngFor="let file of video.files"> | 109 | <li *ngFor="let file of video.files"> |
@@ -112,13 +112,13 @@ | |||
112 | <my-global-icon | 112 | <my-global-icon |
113 | *ngIf="canRemoveOneFile(video)" | 113 | *ngIf="canRemoveOneFile(video)" |
114 | i18n-ngbTooltip ngbTooltip="Delete this file" iconName="delete" role="button" | 114 | i18n-ngbTooltip ngbTooltip="Delete this file" iconName="delete" role="button" |
115 | (click)="removeVideoFile(video, file, 'webtorrent')" | 115 | (click)="removeVideoFile(video, file, 'web-videos')" |
116 | ></my-global-icon> | 116 | ></my-global-icon> |
117 | </li> | 117 | </li> |
118 | </ul> | 118 | </ul> |
119 | </div> | 119 | </div> |
120 | 120 | ||
121 | <div *ngIf="isHLS(video)"> | 121 | <div *ngIf="hasHLS(video)"> |
122 | HLS: | 122 | HLS: |
123 | 123 | ||
124 | <ul> | 124 | <ul> |
diff --git a/client/src/app/+admin/overview/videos/video-list.component.ts b/client/src/app/+admin/overview/videos/video-list.component.ts index e9c526193..52f02d8d0 100644 --- a/client/src/app/+admin/overview/videos/video-list.component.ts +++ b/client/src/app/+admin/overview/videos/video-list.component.ts | |||
@@ -99,8 +99,8 @@ export class VideoListComponent extends RestTable <Video> implements OnInit { | |||
99 | iconName: 'cog' | 99 | iconName: 'cog' |
100 | }, | 100 | }, |
101 | { | 101 | { |
102 | label: $localize`Run WebTorrent transcoding`, | 102 | label: $localize`Run Web Video transcoding`, |
103 | handler: videos => this.runTranscoding(videos, 'webtorrent'), | 103 | handler: videos => this.runTranscoding(videos, 'web-video'), |
104 | isDisplayed: videos => videos.every(v => v.canRunTranscoding(this.authUser)), | 104 | isDisplayed: videos => videos.every(v => v.canRunTranscoding(this.authUser)), |
105 | iconName: 'cog' | 105 | iconName: 'cog' |
106 | }, | 106 | }, |
@@ -111,8 +111,8 @@ export class VideoListComponent extends RestTable <Video> implements OnInit { | |||
111 | iconName: 'delete' | 111 | iconName: 'delete' |
112 | }, | 112 | }, |
113 | { | 113 | { |
114 | label: $localize`Delete WebTorrent files`, | 114 | label: $localize`Delete Web Video files`, |
115 | handler: videos => this.removeVideoFiles(videos, 'webtorrent'), | 115 | handler: videos => this.removeVideoFiles(videos, 'web-videos'), |
116 | isDisplayed: videos => videos.every(v => v.canRemoveFiles(this.authUser)), | 116 | isDisplayed: videos => videos.every(v => v.canRemoveFiles(this.authUser)), |
117 | iconName: 'delete' | 117 | iconName: 'delete' |
118 | } | 118 | } |
@@ -150,14 +150,14 @@ export class VideoListComponent extends RestTable <Video> implements OnInit { | |||
150 | return video.state.id === VideoState.TO_IMPORT | 150 | return video.state.id === VideoState.TO_IMPORT |
151 | } | 151 | } |
152 | 152 | ||
153 | isHLS (video: Video) { | 153 | hasHLS (video: Video) { |
154 | const p = video.streamingPlaylists.find(p => p.type === VideoStreamingPlaylistType.HLS) | 154 | const p = video.streamingPlaylists.find(p => p.type === VideoStreamingPlaylistType.HLS) |
155 | if (!p) return false | 155 | if (!p) return false |
156 | 156 | ||
157 | return p.files.length !== 0 | 157 | return p.files.length !== 0 |
158 | } | 158 | } |
159 | 159 | ||
160 | isWebTorrent (video: Video) { | 160 | hasWebVideos (video: Video) { |
161 | return video.files.length !== 0 | 161 | return video.files.length !== 0 |
162 | } | 162 | } |
163 | 163 | ||
@@ -176,14 +176,14 @@ export class VideoListComponent extends RestTable <Video> implements OnInit { | |||
176 | getFilesSize (video: Video) { | 176 | getFilesSize (video: Video) { |
177 | let files = video.files | 177 | let files = video.files |
178 | 178 | ||
179 | if (this.isHLS(video)) { | 179 | if (this.hasHLS(video)) { |
180 | files = files.concat(video.streamingPlaylists[0].files) | 180 | files = files.concat(video.streamingPlaylists[0].files) |
181 | } | 181 | } |
182 | 182 | ||
183 | return files.reduce((p, f) => p += f.size, 0) | 183 | return files.reduce((p, f) => p += f.size, 0) |
184 | } | 184 | } |
185 | 185 | ||
186 | async removeVideoFile (video: Video, file: VideoFile, type: 'hls' | 'webtorrent') { | 186 | async removeVideoFile (video: Video, file: VideoFile, type: 'hls' | 'web-videos') { |
187 | const message = $localize`Are you sure you want to delete this ${file.resolution.label} file?` | 187 | const message = $localize`Are you sure you want to delete this ${file.resolution.label} file?` |
188 | const res = await this.confirmService.confirm(message, $localize`Delete file`) | 188 | const res = await this.confirmService.confirm(message, $localize`Delete file`) |
189 | if (res === false) return | 189 | if (res === false) return |
@@ -262,7 +262,7 @@ export class VideoListComponent extends RestTable <Video> implements OnInit { | |||
262 | }) | 262 | }) |
263 | } | 263 | } |
264 | 264 | ||
265 | private async removeVideoFiles (videos: Video[], type: 'hls' | 'webtorrent') { | 265 | private async removeVideoFiles (videos: Video[], type: 'hls' | 'web-videos') { |
266 | let message: string | 266 | let message: string |
267 | 267 | ||
268 | if (type === 'hls') { | 268 | if (type === 'hls') { |
@@ -274,7 +274,7 @@ export class VideoListComponent extends RestTable <Video> implements OnInit { | |||
274 | } else { | 274 | } else { |
275 | // eslint-disable-next-line max-len | 275 | // eslint-disable-next-line max-len |
276 | message = formatICU( | 276 | message = formatICU( |
277 | $localize`Are you sure you want to delete WebTorrent files of {count, plural, =1 {1 video} other {{count} videos}}?`, | 277 | $localize`Are you sure you want to delete Web Video files of {count, plural, =1 {1 video} other {{count} videos}}?`, |
278 | { count: videos.length } | 278 | { count: videos.length } |
279 | ) | 279 | ) |
280 | } | 280 | } |
@@ -293,7 +293,7 @@ export class VideoListComponent extends RestTable <Video> implements OnInit { | |||
293 | }) | 293 | }) |
294 | } | 294 | } |
295 | 295 | ||
296 | private runTranscoding (videos: Video[], type: 'hls' | 'webtorrent') { | 296 | private runTranscoding (videos: Video[], type: 'hls' | 'web-video') { |
297 | this.videoService.runTranscoding(videos.map(v => v.id), type) | 297 | this.videoService.runTranscoding(videos.map(v => v.id), type) |
298 | .subscribe({ | 298 | .subscribe({ |
299 | next: () => { | 299 | next: () => { |
diff --git a/client/src/app/core/users/user.model.ts b/client/src/app/core/users/user.model.ts index d57608f1c..5aa02e472 100644 --- a/client/src/app/core/users/user.model.ts +++ b/client/src/app/core/users/user.model.ts | |||
@@ -30,8 +30,6 @@ export class User implements UserServerModel { | |||
30 | autoPlayNextVideoPlaylist: boolean | 30 | autoPlayNextVideoPlaylist: boolean |
31 | 31 | ||
32 | p2pEnabled: boolean | 32 | p2pEnabled: boolean |
33 | // FIXME: deprecated in 4.1 | ||
34 | webTorrentEnabled: never | ||
35 | 33 | ||
36 | videosHistoryEnabled: boolean | 34 | videosHistoryEnabled: boolean |
37 | videoLanguages: string[] | 35 | videoLanguages: string[] |
diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts index e94087dbe..1ffc40411 100644 --- a/client/src/app/shared/shared-main/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts | |||
@@ -252,7 +252,7 @@ export class Video implements VideoServerModel { | |||
252 | user && user.hasRight(UserRight.MANAGE_VIDEO_FILES) && | 252 | user && user.hasRight(UserRight.MANAGE_VIDEO_FILES) && |
253 | this.state.id !== VideoState.TO_TRANSCODE && | 253 | this.state.id !== VideoState.TO_TRANSCODE && |
254 | this.hasHLS() && | 254 | this.hasHLS() && |
255 | this.hasWebTorrent() | 255 | this.hasWebVideos() |
256 | } | 256 | } |
257 | 257 | ||
258 | canRunTranscoding (user: AuthUser) { | 258 | canRunTranscoding (user: AuthUser) { |
@@ -265,7 +265,7 @@ export class Video implements VideoServerModel { | |||
265 | return this.streamingPlaylists?.some(p => p.type === VideoStreamingPlaylistType.HLS) | 265 | return this.streamingPlaylists?.some(p => p.type === VideoStreamingPlaylistType.HLS) |
266 | } | 266 | } |
267 | 267 | ||
268 | hasWebTorrent () { | 268 | hasWebVideos () { |
269 | return this.files && this.files.length !== 0 | 269 | return this.files && this.files.length !== 0 |
270 | } | 270 | } |
271 | 271 | ||
diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts index 4e8b84dfc..20145b9c5 100644 --- a/client/src/app/shared/shared-main/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts | |||
@@ -311,7 +311,7 @@ export class VideoService { | |||
311 | ) | 311 | ) |
312 | } | 312 | } |
313 | 313 | ||
314 | removeVideoFiles (videoIds: (number | string)[], type: 'hls' | 'webtorrent') { | 314 | removeVideoFiles (videoIds: (number | string)[], type: 'hls' | 'web-videos') { |
315 | return from(videoIds) | 315 | return from(videoIds) |
316 | .pipe( | 316 | .pipe( |
317 | concatMap(id => this.authHttp.delete(VideoService.BASE_VIDEO_URL + '/' + id + '/' + type)), | 317 | concatMap(id => this.authHttp.delete(VideoService.BASE_VIDEO_URL + '/' + id + '/' + type)), |
@@ -320,12 +320,12 @@ export class VideoService { | |||
320 | ) | 320 | ) |
321 | } | 321 | } |
322 | 322 | ||
323 | removeFile (videoId: number | string, fileId: number, type: 'hls' | 'webtorrent') { | 323 | removeFile (videoId: number | string, fileId: number, type: 'hls' | 'web-videos') { |
324 | return this.authHttp.delete(VideoService.BASE_VIDEO_URL + '/' + videoId + '/' + type + '/' + fileId) | 324 | return this.authHttp.delete(VideoService.BASE_VIDEO_URL + '/' + videoId + '/' + type + '/' + fileId) |
325 | .pipe(catchError(err => this.restExtractor.handleError(err))) | 325 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
326 | } | 326 | } |
327 | 327 | ||
328 | runTranscoding (videoIds: (number | string)[], type: 'hls' | 'webtorrent') { | 328 | runTranscoding (videoIds: (number | string)[], type: 'hls' | 'web-video') { |
329 | const body: VideoTranscodingCreate = { transcodingType: type } | 329 | const body: VideoTranscodingCreate = { transcodingType: type } |
330 | 330 | ||
331 | return from(videoIds) | 331 | return from(videoIds) |
diff --git a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts index 56527ddfa..0a3ada711 100644 --- a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts | |||
@@ -273,7 +273,7 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
273 | }) | 273 | }) |
274 | } | 274 | } |
275 | 275 | ||
276 | async removeVideoFiles (video: Video, type: 'hls' | 'webtorrent') { | 276 | async removeVideoFiles (video: Video, type: 'hls' | 'web-videos') { |
277 | const confirmMessage = $localize`Do you really want to remove "${this.video.name}" files?` | 277 | const confirmMessage = $localize`Do you really want to remove "${this.video.name}" files?` |
278 | 278 | ||
279 | const res = await this.confirmService.confirm(confirmMessage, $localize`Remove "${this.video.name}" files`) | 279 | const res = await this.confirmService.confirm(confirmMessage, $localize`Remove "${this.video.name}" files`) |
@@ -290,7 +290,7 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
290 | }) | 290 | }) |
291 | } | 291 | } |
292 | 292 | ||
293 | runTranscoding (video: Video, type: 'hls' | 'webtorrent') { | 293 | runTranscoding (video: Video, type: 'hls' | 'web-video') { |
294 | this.videoService.runTranscoding([ video.id ], type) | 294 | this.videoService.runTranscoding([ video.id ], type) |
295 | .subscribe({ | 295 | .subscribe({ |
296 | next: () => { | 296 | next: () => { |
@@ -394,8 +394,8 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
394 | iconName: 'cog' | 394 | iconName: 'cog' |
395 | }, | 395 | }, |
396 | { | 396 | { |
397 | label: $localize`Run WebTorrent transcoding`, | 397 | label: $localize`Run Web Video transcoding`, |
398 | handler: ({ video }) => this.runTranscoding(video, 'webtorrent'), | 398 | handler: ({ video }) => this.runTranscoding(video, 'web-video'), |
399 | isDisplayed: () => this.displayOptions.transcoding && this.canRunTranscoding(), | 399 | isDisplayed: () => this.displayOptions.transcoding && this.canRunTranscoding(), |
400 | iconName: 'cog' | 400 | iconName: 'cog' |
401 | }, | 401 | }, |
@@ -406,8 +406,8 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
406 | iconName: 'delete' | 406 | iconName: 'delete' |
407 | }, | 407 | }, |
408 | { | 408 | { |
409 | label: $localize`Delete WebTorrent files`, | 409 | label: $localize`Delete Web Video files`, |
410 | handler: ({ video }) => this.removeVideoFiles(video, 'webtorrent'), | 410 | handler: ({ video }) => this.removeVideoFiles(video, 'web-videos'), |
411 | isDisplayed: () => this.displayOptions.removeFiles && this.canRemoveVideoFiles(), | 411 | isDisplayed: () => this.displayOptions.removeFiles && this.canRemoveVideoFiles(), |
412 | iconName: 'delete' | 412 | iconName: 'delete' |
413 | } | 413 | } |