aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/core/auth/auth.service.ts2
-rw-r--r--client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts2
-rw-r--r--client/src/assets/player/p2p-media-loader/hls-plugin.ts16
-rw-r--r--client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts2
-rw-r--r--client/src/sass/application.scss8
-rw-r--r--client/src/shims/stream.ts1
6 files changed, 16 insertions, 15 deletions
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts
index 60bd72c60..ef5a3808e 100644
--- a/client/src/app/core/auth/auth.service.ts
+++ b/client/src/app/core/auth/auth.service.ts
@@ -206,7 +206,7 @@ Ensure you have correctly configured PeerTube (config/ directory), in particular
206 this.refreshingTokenObservable = this.http.post<UserRefreshToken>(AuthService.BASE_TOKEN_URL, body, { headers }) 206 this.refreshingTokenObservable = this.http.post<UserRefreshToken>(AuthService.BASE_TOKEN_URL, body, { headers })
207 .pipe( 207 .pipe(
208 map(res => this.handleRefreshToken(res)), 208 map(res => this.handleRefreshToken(res)),
209 tap(() => this.refreshingTokenObservable = null), 209 tap(() => { this.refreshingTokenObservable = null }),
210 catchError(err => { 210 catchError(err => {
211 this.refreshingTokenObservable = null 211 this.refreshingTokenObservable = null
212 212
diff --git a/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts
index 8b019103c..7069fa8fd 100644
--- a/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts
+++ b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts
@@ -47,7 +47,7 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit,
47 isNewPlaylistBlockOpened = false 47 isNewPlaylistBlockOpened = false
48 48
49 videoPlaylistSearch: string 49 videoPlaylistSearch: string
50 videoPlaylistSearchChanged = new Subject<string>() 50 videoPlaylistSearchChanged = new Subject<void>()
51 51
52 videoPlaylists: PlaylistSummary[] = [] 52 videoPlaylists: PlaylistSummary[] = []
53 53
diff --git a/client/src/assets/player/p2p-media-loader/hls-plugin.ts b/client/src/assets/player/p2p-media-loader/hls-plugin.ts
index 3050110cd..78f0944ef 100644
--- a/client/src/assets/player/p2p-media-loader/hls-plugin.ts
+++ b/client/src/assets/player/p2p-media-loader/hls-plugin.ts
@@ -1,7 +1,7 @@
1// Thanks https://github.com/streamroot/videojs-hlsjs-plugin 1// Thanks https://github.com/streamroot/videojs-hlsjs-plugin
2// We duplicated this plugin to choose the hls.js version we want, because streamroot only provide a bundled file 2// We duplicated this plugin to choose the hls.js version we want, because streamroot only provide a bundled file
3 3
4import * as Hlsjs from 'hls.js/dist/hls.light.js' 4import Hlsjs, { ErrorData, HlsConfig, Level, ManifestLoadedData } from 'hls.js'
5import videojs from 'video.js' 5import videojs from 'video.js'
6import { HlsjsConfigHandlerOptions, QualityLevelRepresentation, QualityLevels, VideoJSTechHLS } from '../peertube-videojs-typings' 6import { HlsjsConfigHandlerOptions, QualityLevelRepresentation, QualityLevels, VideoJSTechHLS } from '../peertube-videojs-typings'
7 7
@@ -10,11 +10,9 @@ type ErrorCounts = {
10} 10}
11 11
12type Metadata = { 12type Metadata = {
13 levels: Hlsjs.Level[] 13 levels: Level[]
14} 14}
15 15
16type CustomAudioTrack = Hlsjs.HlsAudioTrack & { name?: string, lang?: string }
17
18const registerSourceHandler = function (vjs: typeof videojs) { 16const registerSourceHandler = function (vjs: typeof videojs) {
19 if (!Hlsjs.isSupported()) { 17 if (!Hlsjs.isSupported()) {
20 console.warn('Hls.js is not supported in this browser!') 18 console.warn('Hls.js is not supported in this browser!')
@@ -93,8 +91,8 @@ class Html5Hlsjs {
93 private readonly source: videojs.Tech.SourceObject 91 private readonly source: videojs.Tech.SourceObject
94 private readonly vjs: typeof videojs 92 private readonly vjs: typeof videojs
95 93
96 private hls: Hlsjs & { manualLevel?: number, audioTrack?: any, audioTracks?: CustomAudioTrack[] } // FIXME: typings 94 private hls: Hlsjs
97 private hlsjsConfig: Partial<Hlsjs.Config & { cueHandler: any }> = null 95 private hlsjsConfig: Partial<HlsConfig & { cueHandler: any }> = null
98 96
99 private _duration: number = null 97 private _duration: number = null
100 private metadata: Metadata = null 98 private metadata: Metadata = null
@@ -255,7 +253,7 @@ class Html5Hlsjs {
255 this.tech.trigger('error') 253 this.tech.trigger('error')
256 } 254 }
257 255
258 private _onError (_event: any, data: Hlsjs.errorData) { 256 private _onError (_event: any, data: ErrorData) {
259 const error: { message: string, code?: number } = { 257 const error: { message: string, code?: number } = {
260 message: `HLS.js error: ${data.type} - fatal: ${data.fatal} - ${data.details}` 258 message: `HLS.js error: ${data.type} - fatal: ${data.fatal} - ${data.details}`
261 } 259 }
@@ -285,7 +283,7 @@ class Html5Hlsjs {
285 this.hls.currentLevel = qualityId 283 this.hls.currentLevel = qualityId
286 } 284 }
287 285
288 private _levelLabel (level: Hlsjs.Level) { 286 private _levelLabel (level: Level) {
289 if (this.player.srOptions_.levelLabelHandler) { 287 if (this.player.srOptions_.levelLabelHandler) {
290 return this.player.srOptions_.levelLabelHandler(level as any) 288 return this.player.srOptions_.levelLabelHandler(level as any)
291 } 289 }
@@ -523,7 +521,7 @@ class Html5Hlsjs {
523 } 521 }
524 } 522 }
525 523
526 private _onMetaData (_event: any, data: Hlsjs.manifestLoadedData) { 524 private _onMetaData (_event: any, data: ManifestLoadedData) {
527 // This could arrive before 'loadedqualitydata' handlers is registered, remember it so we can raise it later 525 // This could arrive before 'loadedqualitydata' handlers is registered, remember it so we can raise it later
528 this.metadata = data as any 526 this.metadata = data as any
529 this._handleQualityLevels() 527 this._handleQualityLevels()
diff --git a/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts b/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts
index 093795e48..acd40636e 100644
--- a/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts
+++ b/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts
@@ -1,4 +1,4 @@
1import * as Hlsjs from 'hls.js/dist/hls.light.js' 1import Hlsjs from 'hls.js'
2import videojs from 'video.js' 2import videojs from 'video.js'
3import { Events, Segment } from '@peertube/p2p-media-loader-core' 3import { Events, Segment } from '@peertube/p2p-media-loader-core'
4import { Engine, initHlsJsPlayer, initVideoJsContribHlsJsPlayer } from '@peertube/p2p-media-loader-hlsjs' 4import { Engine, initHlsJsPlayer, initVideoJsContribHlsJsPlayer } from '@peertube/p2p-media-loader-hlsjs'
diff --git a/client/src/sass/application.scss b/client/src/sass/application.scss
index bd834db70..e0e8fc828 100644
--- a/client/src/sass/application.scss
+++ b/client/src/sass/application.scss
@@ -1,5 +1,7 @@
1$icon-font-path: '~@neos21/bootstrap3-glyphicons/assets/fonts/'; 1$icon-font-path: '~@neos21/bootstrap3-glyphicons/assets/fonts/';
2 2
3@use 'sass:math';
4
3@use '_variables' as *; 5@use '_variables' as *;
4@use '_mixins' as *; 6@use '_mixins' as *;
5 7
@@ -353,11 +355,11 @@ ngx-loading-bar {
353 355
354@media screen and (max-width: #{breakpoint(xxl)}) { 356@media screen and (max-width: #{breakpoint(xxl)}) {
355 .main-col { 357 .main-col {
356 --horizontalMarginContent: #{$not-expanded-horizontal-margins / 2}; 358 --horizontalMarginContent: #{math.div($not-expanded-horizontal-margins, 2)};
357 --videosHorizontalMarginContent: 30px; 359 --videosHorizontalMarginContent: 30px;
358 360
359 &.expanded { 361 &.expanded {
360 --horizontalMarginContent: #{$expanded-horizontal-margins / 2}; 362 --horizontalMarginContent: #{math.div($expanded-horizontal-margins, 2)};
361 } 363 }
362 } 364 }
363} 365}
@@ -370,7 +372,7 @@ ngx-loading-bar {
370 /* the following applies from 500px to 900px and is partially overriden from 500px to 800px by changes below to $small-view */ 372 /* the following applies from 500px to 900px and is partially overriden from 500px to 800px by changes below to $small-view */
371 .main-col, 373 .main-col,
372 .main-col.expanded { 374 .main-col.expanded {
373 --horizontalMarginContent: #{$expanded-horizontal-margins / 3}; 375 --horizontalMarginContent: #{math.div($expanded-horizontal-margins, 3)};
374 376
375 .sub-menu { 377 .sub-menu {
376 padding: 0 50px; 378 padding: 0 50px;
diff --git a/client/src/shims/stream.ts b/client/src/shims/stream.ts
new file mode 100644
index 000000000..977fd05a0
--- /dev/null
+++ b/client/src/shims/stream.ts
@@ -0,0 +1 @@
module.exports = require('stream-browserify')