diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-30 17:40:00 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-04-03 14:02:10 +0200 |
commit | c6352f2c64f3c1ad54f8500f493587cdce3d33c9 (patch) | |
tree | 642a5b29b4d68ed8915e5e800232eab069303f79 /client/src/app/videos/+video-watch | |
parent | 6b9af1293621a81564296ead6f12f5e70eafbca2 (diff) | |
download | PeerTube-c6352f2c64f3c1ad54f8500f493587cdce3d33c9.tar.gz PeerTube-c6352f2c64f3c1ad54f8500f493587cdce3d33c9.tar.zst PeerTube-c6352f2c64f3c1ad54f8500f493587cdce3d33c9.zip |
Improve player
Add a settings dialog based on the work of Yanko Shterev (@yshterev):
https://github.com/yshterev/videojs-settings-menu. Thanks!
Diffstat (limited to 'client/src/app/videos/+video-watch')
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 48 |
1 files changed, 10 insertions, 38 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 fda69efab..c7e26fad2 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -21,6 +21,7 @@ import { MarkdownService } from '../shared' | |||
21 | import { VideoDownloadComponent } from './modal/video-download.component' | 21 | import { VideoDownloadComponent } from './modal/video-download.component' |
22 | import { VideoReportComponent } from './modal/video-report.component' | 22 | import { VideoReportComponent } from './modal/video-report.component' |
23 | import { VideoShareComponent } from './modal/video-share.component' | 23 | import { VideoShareComponent } from './modal/video-share.component' |
24 | import { getVideojsOptions } from '../../../assets/player/peertube-player' | ||
24 | 25 | ||
25 | @Component({ | 26 | @Component({ |
26 | selector: 'my-video-watch', | 27 | selector: 'my-video-watch', |
@@ -341,45 +342,16 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
341 | this.playerElement.poster = this.video.previewUrl | 342 | this.playerElement.poster = this.video.previewUrl |
342 | } | 343 | } |
343 | 344 | ||
344 | const videojsOptions = { | 345 | const videojsOptions = getVideojsOptions({ |
345 | controls: true, | ||
346 | autoplay: this.isAutoplay(), | 346 | autoplay: this.isAutoplay(), |
347 | playbackRates: [ 0.5, 1, 1.5, 2 ], | 347 | inactivityTimeout: 4000, |
348 | plugins: { | 348 | videoFiles: this.video.files, |
349 | peertube: { | 349 | playerElement: this.playerElement, |
350 | videoFiles: this.video.files, | 350 | videoViewUrl: this.videoService.getVideoViewUrl(this.video.uuid), |
351 | playerElement: this.playerElement, | 351 | videoDuration: this.video.duration, |
352 | videoViewUrl: this.videoService.getVideoViewUrl(this.video.uuid), | 352 | enableHotkeys: true, |
353 | videoDuration: this.video.duration | 353 | peertubeLink: false |
354 | }, | 354 | }) |
355 | hotkeys: { | ||
356 | enableVolumeScroll: false | ||
357 | } | ||
358 | }, | ||
359 | controlBar: { | ||
360 | children: [ | ||
361 | 'playToggle', | ||
362 | 'currentTimeDisplay', | ||
363 | 'timeDivider', | ||
364 | 'durationDisplay', | ||
365 | 'liveDisplay', | ||
366 | |||
367 | 'flexibleWidthSpacer', | ||
368 | 'progressControl', | ||
369 | |||
370 | 'webTorrentButton', | ||
371 | |||
372 | 'playbackRateMenuButton', | ||
373 | |||
374 | 'muteToggle', | ||
375 | 'volumeControl', | ||
376 | |||
377 | 'resolutionMenuButton', | ||
378 | |||
379 | 'fullscreenToggle' | ||
380 | ] | ||
381 | } | ||
382 | } | ||
383 | 355 | ||
384 | this.videoPlayerLoaded = true | 356 | this.videoPlayerLoaded = true |
385 | 357 | ||