diff options
Diffstat (limited to 'client/src/app')
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 2d13f1b58..cf9dc8f9c 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -20,6 +20,7 @@ import { environment } from '../../../environments/environment' | |||
20 | import { VideoCaptionService } from '@app/shared/video-caption' | 20 | import { VideoCaptionService } from '@app/shared/video-caption' |
21 | import { MarkdownService } from '@app/shared/renderer' | 21 | import { MarkdownService } from '@app/shared/renderer' |
22 | import { | 22 | import { |
23 | CustomizationOptions, | ||
23 | P2PMediaLoaderOptions, | 24 | P2PMediaLoaderOptions, |
24 | PeertubePlayerManager, | 25 | PeertubePlayerManager, |
25 | PeertubePlayerManagerOptions, | 26 | PeertubePlayerManagerOptions, |
@@ -28,7 +29,7 @@ import { | |||
28 | import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' | 29 | import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' |
29 | import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' | 30 | import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' |
30 | import { Video } from '@app/shared/video/video.model' | 31 | import { Video } from '@app/shared/video/video.model' |
31 | import { isWebRTCDisabled } from '../../../assets/player/utils' | 32 | import { isWebRTCDisabled, timeToInt } from '../../../assets/player/utils' |
32 | import { VideoWatchPlaylistComponent } from '@app/videos/+video-watch/video-watch-playlist.component' | 33 | import { VideoWatchPlaylistComponent } from '@app/videos/+video-watch/video-watch-playlist.component' |
33 | 34 | ||
34 | @Component({ | 35 | @Component({ |
@@ -249,8 +250,13 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
249 | const urlOptions = { | 250 | const urlOptions = { |
250 | startTime: queryParams.start, | 251 | startTime: queryParams.start, |
251 | stopTime: queryParams.stop, | 252 | stopTime: queryParams.stop, |
253 | |||
254 | muted: queryParams.muted, | ||
255 | loop: queryParams.loop, | ||
252 | subtitle: queryParams.subtitle, | 256 | subtitle: queryParams.subtitle, |
253 | playerMode: queryParams.mode | 257 | |
258 | playerMode: queryParams.mode, | ||
259 | peertubeLink: false | ||
254 | } | 260 | } |
255 | 261 | ||
256 | this.onVideoFetched(video, captionsResult.data, urlOptions) | 262 | this.onVideoFetched(video, captionsResult.data, urlOptions) |
@@ -327,7 +333,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
327 | private async onVideoFetched ( | 333 | private async onVideoFetched ( |
328 | video: VideoDetails, | 334 | video: VideoDetails, |
329 | videoCaptions: VideoCaption[], | 335 | videoCaptions: VideoCaption[], |
330 | urlOptions: { startTime?: number, stopTime?: number, subtitle?: string, playerMode?: string } | 336 | urlOptions: CustomizationOptions & { playerMode: PlayerMode } |
331 | ) { | 337 | ) { |
332 | this.video = video | 338 | this.video = video |
333 | 339 | ||
@@ -339,7 +345,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
339 | 345 | ||
340 | this.videoWatchPlaylist.updatePlaylistIndex(video) | 346 | this.videoWatchPlaylist.updatePlaylistIndex(video) |
341 | 347 | ||
342 | let startTime = urlOptions.startTime || (this.video.userHistory ? this.video.userHistory.currentTime : 0) | 348 | let startTime = timeToInt(urlOptions.startTime) || (this.video.userHistory ? this.video.userHistory.currentTime : 0) |
343 | // If we are at the end of the video, reset the timer | 349 | // If we are at the end of the video, reset the timer |
344 | if (this.video.duration - startTime <= 1) startTime = 0 | 350 | if (this.video.duration - startTime <= 1) startTime = 0 |
345 | 351 | ||
@@ -378,12 +384,18 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
378 | enableHotkeys: true, | 384 | enableHotkeys: true, |
379 | inactivityTimeout: 2500, | 385 | inactivityTimeout: 2500, |
380 | poster: this.video.previewUrl, | 386 | poster: this.video.previewUrl, |
387 | |||
381 | startTime, | 388 | startTime, |
382 | stopTime: urlOptions.stopTime, | 389 | stopTime: urlOptions.stopTime, |
390 | controls: urlOptions.controls, | ||
391 | muted: urlOptions.muted, | ||
392 | loop: urlOptions.loop, | ||
393 | subtitle: urlOptions.subtitle, | ||
394 | |||
395 | peertubeLink: urlOptions.peertubeLink, | ||
383 | 396 | ||
384 | theaterMode: true, | 397 | theaterMode: true, |
385 | captions: videoCaptions.length !== 0, | 398 | captions: videoCaptions.length !== 0, |
386 | peertubeLink: false, | ||
387 | 399 | ||
388 | videoViewUrl: this.video.privacy.id !== VideoPrivacy.PRIVATE | 400 | videoViewUrl: this.video.privacy.id !== VideoPrivacy.PRIVATE |
389 | ? this.videoService.getVideoViewUrl(this.video.uuid) | 401 | ? this.videoService.getVideoViewUrl(this.video.uuid) |
@@ -392,8 +404,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
392 | 404 | ||
393 | language: this.localeId, | 405 | language: this.localeId, |
394 | 406 | ||
395 | subtitle: urlOptions.subtitle, | ||
396 | |||
397 | userWatching: this.user && this.user.videosHistoryEnabled === true ? { | 407 | userWatching: this.user && this.user.videosHistoryEnabled === true ? { |
398 | url: this.videoService.getUserWatchingVideoUrl(this.video.uuid), | 408 | url: this.videoService.getUserWatchingVideoUrl(this.video.uuid), |
399 | authorizationHeader: this.authService.getRequestHeaderValue() | 409 | authorizationHeader: this.authService.getRequestHeaderValue() |