aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts2
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts2
-rw-r--r--client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts2
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.ts11
-rw-r--r--client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts2
-rw-r--r--client/src/app/shared/shared-main/video/embed.component.ts2
-rw-r--r--client/src/app/shared/shared-share-modal/video-share.component.ts2
-rw-r--r--client/src/assets/player/index.ts2
-rw-r--r--client/src/assets/player/peertube-player-manager.ts59
-rw-r--r--client/src/assets/player/shared/bezels/bezels-plugin.ts (renamed from client/src/assets/player/bezels/bezels-plugin.ts)0
-rw-r--r--client/src/assets/player/shared/bezels/index.ts2
-rw-r--r--client/src/assets/player/shared/bezels/pause-bezel.ts (renamed from client/src/assets/player/bezels/pause-bezel.ts)2
-rw-r--r--client/src/assets/player/shared/common/index.ts1
-rw-r--r--client/src/assets/player/shared/common/utils.ts66
-rw-r--r--client/src/assets/player/shared/control-bar/index.ts5
-rw-r--r--client/src/assets/player/shared/control-bar/next-previous-video-button.ts (renamed from client/src/assets/player/control-bar/next-previous-video-button.ts)2
-rw-r--r--client/src/assets/player/shared/control-bar/p2p-info-button.ts (renamed from client/src/assets/player/control-bar/p2p-info-button.ts)4
-rw-r--r--client/src/assets/player/shared/control-bar/peertube-link-button.ts (renamed from client/src/assets/player/control-bar/peertube-link-button.ts)2
-rw-r--r--client/src/assets/player/shared/control-bar/peertube-load-progress-bar.ts (renamed from client/src/assets/player/control-bar/peertube-load-progress-bar.ts)0
-rw-r--r--client/src/assets/player/shared/control-bar/theater-button.ts (renamed from client/src/assets/player/control-bar/theater-button.ts)2
-rw-r--r--client/src/assets/player/shared/dock/index.ts2
-rw-r--r--client/src/assets/player/shared/dock/peertube-dock-component.ts (renamed from client/src/assets/player/dock/peertube-dock-component.ts)0
-rw-r--r--client/src/assets/player/shared/dock/peertube-dock-plugin.ts (renamed from client/src/assets/player/dock/peertube-dock-plugin.ts)0
-rw-r--r--client/src/assets/player/shared/hotkeys/index.ts1
-rw-r--r--client/src/assets/player/shared/hotkeys/peertube-hotkeys-plugin.ts (renamed from client/src/assets/player/hotkeys/peertube-hotkeys-plugin.ts)0
-rw-r--r--client/src/assets/player/shared/manager-options/control-bar-options-builder.ts (renamed from client/src/assets/player/manager-options/control-bar-options-builder.ts)11
-rw-r--r--client/src/assets/player/shared/manager-options/hls-options-builder.ts (renamed from client/src/assets/player/manager-options/hls-options-builder.ts)8
-rw-r--r--client/src/assets/player/shared/manager-options/index.ts1
-rw-r--r--client/src/assets/player/shared/manager-options/manager-options-builder.ts (renamed from client/src/assets/player/manager-options/manager-options-builder.ts)9
-rw-r--r--client/src/assets/player/shared/manager-options/webtorrent-options-builder.ts (renamed from client/src/assets/player/manager-options/webtorrent-options-builder.ts)2
-rw-r--r--client/src/assets/player/shared/mobile/index.ts2
-rw-r--r--client/src/assets/player/shared/mobile/peertube-mobile-buttons.ts (renamed from client/src/assets/player/mobile/peertube-mobile-buttons.ts)0
-rw-r--r--client/src/assets/player/shared/mobile/peertube-mobile-plugin.ts (renamed from client/src/assets/player/mobile/peertube-mobile-plugin.ts)0
-rw-r--r--client/src/assets/player/shared/p2p-media-loader/hls-plugin.ts (renamed from client/src/assets/player/p2p-media-loader/hls-plugin.ts)2
-rw-r--r--client/src/assets/player/shared/p2p-media-loader/index.ts5
-rw-r--r--client/src/assets/player/shared/p2p-media-loader/p2p-media-loader-plugin.ts (renamed from client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts)2
-rw-r--r--client/src/assets/player/shared/p2p-media-loader/redundancy-url-manager.ts (renamed from client/src/assets/player/p2p-media-loader/redundancy-url-manager.ts)0
-rw-r--r--client/src/assets/player/shared/p2p-media-loader/segment-url-builder.ts (renamed from client/src/assets/player/p2p-media-loader/segment-url-builder.ts)0
-rw-r--r--client/src/assets/player/shared/p2p-media-loader/segment-validator.ts (renamed from client/src/assets/player/p2p-media-loader/segment-validator.ts)0
-rw-r--r--client/src/assets/player/shared/peertube/index.ts1
-rw-r--r--client/src/assets/player/shared/peertube/peertube-plugin.ts (renamed from client/src/assets/player/peertube-plugin.ts)8
-rw-r--r--client/src/assets/player/shared/playlist/index.ts4
-rw-r--r--client/src/assets/player/shared/playlist/playlist-button.ts (renamed from client/src/assets/player/playlist/playlist-button.ts)2
-rw-r--r--client/src/assets/player/shared/playlist/playlist-menu-item.ts (renamed from client/src/assets/player/playlist/playlist-menu-item.ts)2
-rw-r--r--client/src/assets/player/shared/playlist/playlist-menu.ts (renamed from client/src/assets/player/playlist/playlist-menu.ts)2
-rw-r--r--client/src/assets/player/shared/playlist/playlist-plugin.ts (renamed from client/src/assets/player/playlist/playlist-plugin.ts)4
-rw-r--r--client/src/assets/player/shared/resolutions/index.ts1
-rw-r--r--client/src/assets/player/shared/resolutions/peertube-resolutions-plugin.ts (renamed from client/src/assets/player/peertube-resolutions-plugin.ts)2
-rw-r--r--client/src/assets/player/shared/settings/index.ts7
-rw-r--r--client/src/assets/player/shared/settings/resolution-menu-button.ts (renamed from client/src/assets/player/settings/resolution-menu-button.ts)0
-rw-r--r--client/src/assets/player/shared/settings/resolution-menu-item.ts (renamed from client/src/assets/player/settings/resolution-menu-item.ts)0
-rw-r--r--client/src/assets/player/shared/settings/settings-dialog.ts (renamed from client/src/assets/player/settings/settings-dialog.ts)0
-rw-r--r--client/src/assets/player/shared/settings/settings-menu-button.ts (renamed from client/src/assets/player/settings/settings-menu-button.ts)6
-rw-r--r--client/src/assets/player/shared/settings/settings-menu-item.ts (renamed from client/src/assets/player/settings/settings-menu-item.ts)3
-rw-r--r--client/src/assets/player/shared/settings/settings-panel-child.ts (renamed from client/src/assets/player/settings/settings-panel-child.ts)0
-rw-r--r--client/src/assets/player/shared/settings/settings-panel.ts (renamed from client/src/assets/player/settings/settings-panel.ts)0
-rw-r--r--client/src/assets/player/shared/stats/index.ts2
-rw-r--r--client/src/assets/player/shared/stats/stats-card.ts (renamed from client/src/assets/player/stats/stats-card.ts)4
-rw-r--r--client/src/assets/player/shared/stats/stats-plugin.ts (renamed from client/src/assets/player/stats/stats-plugin.ts)0
-rw-r--r--client/src/assets/player/shared/upnext/end-card.ts (renamed from client/src/assets/player/upnext/end-card.ts)0
-rw-r--r--client/src/assets/player/shared/upnext/index.ts2
-rw-r--r--client/src/assets/player/shared/upnext/upnext-plugin.ts (renamed from client/src/assets/player/upnext/upnext-plugin.ts)0
-rw-r--r--client/src/assets/player/shared/webtorrent/peertube-chunk-store.ts (renamed from client/src/assets/player/webtorrent/peertube-chunk-store.ts)0
-rw-r--r--client/src/assets/player/shared/webtorrent/video-renderer.ts (renamed from client/src/assets/player/webtorrent/video-renderer.ts)0
-rw-r--r--client/src/assets/player/shared/webtorrent/webtorrent-plugin.ts (renamed from client/src/assets/player/webtorrent/webtorrent-plugin.ts)7
-rw-r--r--client/src/assets/player/types/index.ts2
-rw-r--r--client/src/assets/player/types/manager-options.ts (renamed from client/src/assets/player/manager-options/manager-options.model.ts)2
-rw-r--r--client/src/assets/player/types/peertube-videojs-typings.ts (renamed from client/src/assets/player/peertube-videojs-typings.ts)24
-rw-r--r--client/src/root-helpers/index.ts3
-rw-r--r--client/src/root-helpers/video.ts33
-rw-r--r--client/src/root-helpers/web-browser.ts24
-rw-r--r--client/src/standalone/videos/embed.ts9
72 files changed, 267 insertions, 102 deletions
diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
index 67752c15a..033305a2b 100644
--- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
+++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
@@ -1,6 +1,5 @@
1import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
2import { switchMap } from 'rxjs/operators' 2import { switchMap } from 'rxjs/operators'
3import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils'
4import { environment } from 'src/environments/environment' 3import { environment } from 'src/environments/environment'
5import { Component, OnInit } from '@angular/core' 4import { Component, OnInit } from '@angular/core'
6import { ActivatedRoute, Router } from '@angular/router' 5import { ActivatedRoute, Router } from '@angular/router'
@@ -8,6 +7,7 @@ import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable, S
8import { AdvancedInputFilter } from '@app/shared/shared-forms' 7import { AdvancedInputFilter } from '@app/shared/shared-forms'
9import { DropdownAction, VideoService } from '@app/shared/shared-main' 8import { DropdownAction, VideoService } from '@app/shared/shared-main'
10import { VideoBlockService } from '@app/shared/shared-moderation' 9import { VideoBlockService } from '@app/shared/shared-moderation'
10import { buildVideoOrPlaylistEmbed } from '@root-helpers/video'
11import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils' 11import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils'
12import { VideoBlacklist, VideoBlacklistType } from '@shared/models' 12import { VideoBlacklist, VideoBlacklistType } from '@shared/models'
13 13
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts
index fb6f2601b..5655e48da 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts
@@ -1,6 +1,6 @@
1import { truncate } from 'lodash-es' 1import { truncate } from 'lodash-es'
2import { UploadState, UploadxOptions, UploadxService } from 'ngx-uploadx' 2import { UploadState, UploadxOptions, UploadxService } from 'ngx-uploadx'
3import { isIOS } from 'src/assets/player/utils' 3import { isIOS } from '@root-helpers/web-browser'
4import { HttpErrorResponse, HttpEventType, HttpHeaders } from '@angular/common/http' 4import { HttpErrorResponse, HttpEventType, HttpHeaders } from '@angular/common/http'
5import { AfterViewInit, Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core' 5import { AfterViewInit, Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'
6import { Router } from '@angular/router' 6import { Router } from '@angular/router'
diff --git a/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts b/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts
index 24030df3e..b51457e02 100644
--- a/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts
+++ b/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts
@@ -1,8 +1,8 @@
1import { Component, Input, OnInit } from '@angular/core' 1import { Component, Input, OnInit } from '@angular/core'
2import { ServerService, User, UserService } from '@app/core' 2import { ServerService, User, UserService } from '@app/core'
3import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' 3import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
4import { isP2PEnabled } from '@root-helpers/video'
4import { HTMLServerConfig, Video } from '@shared/models' 5import { HTMLServerConfig, Video } from '@shared/models'
5import { isP2PEnabled } from '../../../../../assets/player/utils'
6 6
7@Component({ 7@Component({
8 selector: 'my-privacy-concerns', 8 selector: 'my-privacy-concerns',
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 067d3bc84..f13c885f2 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/+videos/+video-watch/video-watch.component.ts
@@ -1,6 +1,6 @@
1import { Hotkey, HotkeysService } from 'angular2-hotkeys' 1import { Hotkey, HotkeysService } from 'angular2-hotkeys'
2import { forkJoin, map, Observable, of, Subscription, switchMap } from 'rxjs' 2import { forkJoin, map, Observable, of, Subscription, switchMap } from 'rxjs'
3import { isP2PEnabled } from 'src/assets/player/utils' 3import { VideoJsPlayer } from 'video.js'
4import { PlatformLocation } from '@angular/common' 4import { PlatformLocation } from '@angular/common'
5import { Component, ElementRef, Inject, LOCALE_ID, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' 5import { Component, ElementRef, Inject, LOCALE_ID, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'
6import { ActivatedRoute, Router } from '@angular/router' 6import { ActivatedRoute, Router } from '@angular/router'
@@ -24,6 +24,7 @@ import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/sha
24import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' 24import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription'
25import { LiveVideoService } from '@app/shared/shared-video-live' 25import { LiveVideoService } from '@app/shared/shared-video-live'
26import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' 26import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
27import { isP2PEnabled } from '@root-helpers/video'
27import { timeToInt } from '@shared/core-utils' 28import { timeToInt } from '@shared/core-utils'
28import { 29import {
29 HTMLServerConfig, 30 HTMLServerConfig,
@@ -58,7 +59,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
58 @ViewChild('videoWatchPlaylist', { static: true }) videoWatchPlaylist: VideoWatchPlaylistComponent 59 @ViewChild('videoWatchPlaylist', { static: true }) videoWatchPlaylist: VideoWatchPlaylistComponent
59 @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent 60 @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent
60 61
61 player: any 62 player: VideoJsPlayer
62 playerElement: HTMLVideoElement 63 playerElement: HTMLVideoElement
63 playerPlaceholderImgSrc: string 64 playerPlaceholderImgSrc: string
64 theaterEnabled = false 65 theaterEnabled = false
@@ -418,8 +419,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
418 this.zone.runOutsideAngular(async () => { 419 this.zone.runOutsideAngular(async () => {
419 this.player = await PeertubePlayerManager.initialize(playerMode, playerOptions, player => this.player = player) 420 this.player = await PeertubePlayerManager.initialize(playerMode, playerOptions, player => this.player = player)
420 421
421 this.player.on('customError', ({ err }: { err: any }) => { 422 this.player.on('customError', (_e, data: any) => {
422 this.zone.run(() => this.handleGlobalError(err)) 423 this.zone.run(() => this.handleGlobalError(data.err))
423 }) 424 })
424 425
425 this.player.on('timeupdate', () => { 426 this.player.on('timeupdate', () => {
@@ -458,7 +459,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
458 459
459 suspended: () => { 460 suspended: () => {
460 return ( 461 return (
461 !isXPercentInViewport(this.player.el(), 80) || 462 !isXPercentInViewport(this.player.el() as HTMLElement, 80) ||
462 !document.getElementById('content').contains(document.activeElement) 463 !document.getElementById('content').contains(document.activeElement)
463 ) 464 )
464 } 465 }
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts
index 53b70cc47..955b0af18 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts
@@ -1,6 +1,6 @@
1import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils'
2import { environment } from 'src/environments/environment' 1import { environment } from 'src/environments/environment'
3import { Component, ElementRef, Input, OnInit } from '@angular/core' 2import { Component, ElementRef, Input, OnInit } from '@angular/core'
3import { buildVideoOrPlaylistEmbed } from '@root-helpers/video'
4import { buildPlaylistEmbedLink, buildVideoEmbedLink } from '@shared/core-utils' 4import { buildPlaylistEmbedLink, buildVideoEmbedLink } from '@shared/core-utils'
5import { CustomMarkupComponent } from './shared' 5import { CustomMarkupComponent } from './shared'
6 6
diff --git a/client/src/app/shared/shared-main/video/embed.component.ts b/client/src/app/shared/shared-main/video/embed.component.ts
index 4732efa44..123000834 100644
--- a/client/src/app/shared/shared-main/video/embed.component.ts
+++ b/client/src/app/shared/shared-main/video/embed.component.ts
@@ -1,7 +1,7 @@
1import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils'
2import { environment } from 'src/environments/environment' 1import { environment } from 'src/environments/environment'
3import { Component, Input, OnInit } from '@angular/core' 2import { Component, Input, OnInit } from '@angular/core'
4import { DomSanitizer, SafeHtml } from '@angular/platform-browser' 3import { DomSanitizer, SafeHtml } from '@angular/platform-browser'
4import { buildVideoOrPlaylistEmbed } from '@root-helpers/video'
5import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils' 5import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils'
6import { Video } from '@shared/models' 6import { Video } from '@shared/models'
7 7
diff --git a/client/src/app/shared/shared-share-modal/video-share.component.ts b/client/src/app/shared/shared-share-modal/video-share.component.ts
index 36a4d7520..2346f03e4 100644
--- a/client/src/app/shared/shared-share-modal/video-share.component.ts
+++ b/client/src/app/shared/shared-share-modal/video-share.component.ts
@@ -4,9 +4,9 @@ import { ServerService } from '@app/core'
4import { VideoDetails } from '@app/shared/shared-main' 4import { VideoDetails } from '@app/shared/shared-main'
5import { VideoPlaylist } from '@app/shared/shared-video-playlist' 5import { VideoPlaylist } from '@app/shared/shared-video-playlist'
6import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 6import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
7import { buildVideoOrPlaylistEmbed } from '@root-helpers/video'
7import { buildPlaylistLink, buildVideoLink, decoratePlaylistLink, decorateVideoLink } from '@shared/core-utils' 8import { buildPlaylistLink, buildVideoLink, decoratePlaylistLink, decorateVideoLink } from '@shared/core-utils'
8import { VideoCaption, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' 9import { VideoCaption, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models'
9import { buildVideoOrPlaylistEmbed } from '../../../assets/player/utils'
10 10
11type Customizations = { 11type Customizations = {
12 startAtCheckbox: boolean 12 startAtCheckbox: boolean
diff --git a/client/src/assets/player/index.ts b/client/src/assets/player/index.ts
index 92270476d..9b87afc4a 100644
--- a/client/src/assets/player/index.ts
+++ b/client/src/assets/player/index.ts
@@ -1,2 +1,2 @@
1export * from './peertube-player-manager' 1export * from './peertube-player-manager'
2export * from './manager-options/manager-options.model' 2export * from './types'
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts
index ddb521a52..1b2a67c77 100644
--- a/client/src/assets/player/peertube-player-manager.ts
+++ b/client/src/assets/player/peertube-player-manager.ts
@@ -1,35 +1,34 @@
1import '@peertube/videojs-contextmenu' 1import '@peertube/videojs-contextmenu'
2import './upnext/end-card' 2import './shared/upnext/end-card'
3import './upnext/upnext-plugin' 3import './shared/upnext/upnext-plugin'
4import './stats/stats-card' 4import './shared/stats/stats-card'
5import './stats/stats-plugin' 5import './shared/stats/stats-plugin'
6import './bezels/bezels-plugin' 6import './shared/bezels/bezels-plugin'
7import './peertube-plugin' 7import './shared/peertube/peertube-plugin'
8import './peertube-resolutions-plugin' 8import './shared/resolutions/peertube-resolutions-plugin'
9import './control-bar/next-previous-video-button' 9import './shared/control-bar/next-previous-video-button'
10import './control-bar/p2p-info-button' 10import './shared/control-bar/p2p-info-button'
11import './control-bar/peertube-link-button' 11import './shared/control-bar/peertube-link-button'
12import './control-bar/peertube-load-progress-bar' 12import './shared/control-bar/peertube-load-progress-bar'
13import './control-bar/theater-button' 13import './shared/control-bar/theater-button'
14import './settings/resolution-menu-button' 14import './shared/settings/resolution-menu-button'
15import './settings/resolution-menu-item' 15import './shared/settings/resolution-menu-item'
16import './settings/settings-dialog' 16import './shared/settings/settings-dialog'
17import './settings/settings-menu-button' 17import './shared/settings/settings-menu-button'
18import './settings/settings-menu-item' 18import './shared/settings/settings-menu-item'
19import './settings/settings-panel' 19import './shared/settings/settings-panel'
20import './settings/settings-panel-child' 20import './shared/settings/settings-panel-child'
21import './playlist/playlist-plugin' 21import './shared/playlist/playlist-plugin'
22import './mobile/peertube-mobile-plugin' 22import './shared/mobile/peertube-mobile-plugin'
23import './mobile/peertube-mobile-buttons' 23import './shared/mobile/peertube-mobile-buttons'
24import './hotkeys/peertube-hotkeys-plugin' 24import './shared/hotkeys/peertube-hotkeys-plugin'
25import videojs from 'video.js' 25import videojs from 'video.js'
26import { PluginsManager } from '@root-helpers/plugins-manager' 26import { PluginsManager } from '@root-helpers/plugins-manager'
27import { ManagerOptionsBuilder } from './manager-options/manager-options-builder' 27import { isMobile } from '@root-helpers/web-browser'
28import { CommonOptions, PeertubePlayerManagerOptions, PlayerMode } from './manager-options/manager-options.model'
29import { saveAverageBandwidth } from './peertube-player-local-storage' 28import { saveAverageBandwidth } from './peertube-player-local-storage'
30import { PlayerNetworkInfo } from './peertube-videojs-typings' 29import { ManagerOptionsBuilder } from './shared/manager-options'
31import { TranslationsManager } from './translations-manager' 30import { TranslationsManager } from './translations-manager'
32import { isMobile } from './utils' 31import { CommonOptions, PeertubePlayerManagerOptions, PlayerMode, PlayerNetworkInfo } from './types'
33 32
34// Change 'Playback Rate' to 'Speed' (smaller for our settings menu) 33// Change 'Playback Rate' to 'Speed' (smaller for our settings menu)
35(videojs.getComponent('PlaybackRateMenuButton') as any).prototype.controlText_ = 'Speed' 34(videojs.getComponent('PlaybackRateMenuButton') as any).prototype.controlText_ = 'Speed'
@@ -60,11 +59,11 @@ export class PeertubePlayerManager {
60 this.onPlayerChange = onPlayerChange 59 this.onPlayerChange = onPlayerChange
61 this.playerElementClassName = options.common.playerElement.className 60 this.playerElementClassName = options.common.playerElement.className
62 61
63 if (mode === 'webtorrent') await import('./webtorrent/webtorrent-plugin') 62 if (mode === 'webtorrent') await import('./shared/webtorrent/webtorrent-plugin')
64 if (mode === 'p2p-media-loader') { 63 if (mode === 'p2p-media-loader') {
65 const [ p2pMediaLoaderModule ] = await Promise.all([ 64 const [ p2pMediaLoaderModule ] = await Promise.all([
66 import('@peertube/p2p-media-loader-hlsjs'), 65 import('@peertube/p2p-media-loader-hlsjs'),
67 import('./p2p-media-loader/p2p-media-loader-plugin') 66 import('./shared/p2p-media-loader/p2p-media-loader-plugin')
68 ]) 67 ])
69 68
70 this.p2pMediaLoaderModule = p2pMediaLoaderModule 69 this.p2pMediaLoaderModule = p2pMediaLoaderModule
@@ -174,7 +173,7 @@ export class PeertubePlayerManager {
174 173
175 this.rebuildAndUpdateVideoElement(currentPlayer, options.common) 174 this.rebuildAndUpdateVideoElement(currentPlayer, options.common)
176 175
177 await import('./webtorrent/webtorrent-plugin') 176 await import('./shared/webtorrent/webtorrent-plugin')
178 177
179 const newPlayer = await this.buildPlayer('webtorrent', options) 178 const newPlayer = await this.buildPlayer('webtorrent', options)
180 this.onPlayerChange(newPlayer) 179 this.onPlayerChange(newPlayer)
diff --git a/client/src/assets/player/bezels/bezels-plugin.ts b/client/src/assets/player/shared/bezels/bezels-plugin.ts
index ca88bc1f9..ca88bc1f9 100644
--- a/client/src/assets/player/bezels/bezels-plugin.ts
+++ b/client/src/assets/player/shared/bezels/bezels-plugin.ts
diff --git a/client/src/assets/player/shared/bezels/index.ts b/client/src/assets/player/shared/bezels/index.ts
new file mode 100644
index 000000000..da861b07a
--- /dev/null
+++ b/client/src/assets/player/shared/bezels/index.ts
@@ -0,0 +1,2 @@
1export * from './bezels-plugin'
2export * from './pause-bezel'
diff --git a/client/src/assets/player/bezels/pause-bezel.ts b/client/src/assets/player/shared/bezels/pause-bezel.ts
index 315964311..e35c39a5f 100644
--- a/client/src/assets/player/bezels/pause-bezel.ts
+++ b/client/src/assets/player/shared/bezels/pause-bezel.ts
@@ -1,5 +1,5 @@
1import videojs from 'video.js' 1import videojs from 'video.js'
2import { isMobile } from '../utils' 2import { isMobile } from '@root-helpers/web-browser'
3 3
4function getPauseBezel () { 4function getPauseBezel () {
5 return ` 5 return `
diff --git a/client/src/assets/player/shared/common/index.ts b/client/src/assets/player/shared/common/index.ts
new file mode 100644
index 000000000..9c56149ef
--- /dev/null
+++ b/client/src/assets/player/shared/common/index.ts
@@ -0,0 +1 @@
export * from './utils'
diff --git a/client/src/assets/player/shared/common/utils.ts b/client/src/assets/player/shared/common/utils.ts
new file mode 100644
index 000000000..da7dda0c7
--- /dev/null
+++ b/client/src/assets/player/shared/common/utils.ts
@@ -0,0 +1,66 @@
1import { VideoFile } from '@shared/models'
2
3function toTitleCase (str: string) {
4 return str.charAt(0).toUpperCase() + str.slice(1)
5}
6
7// https://github.com/danrevah/ngx-pipes/blob/master/src/pipes/math/bytes.ts
8// Don't import all Angular stuff, just copy the code with shame
9const dictionaryBytes: Array<{max: number, type: string}> = [
10 { max: 1024, type: 'B' },
11 { max: 1048576, type: 'KB' },
12 { max: 1073741824, type: 'MB' },
13 { max: 1.0995116e12, type: 'GB' }
14]
15function bytes (value: number) {
16 const format = dictionaryBytes.find(d => value < d.max) || dictionaryBytes[dictionaryBytes.length - 1]
17 const calc = Math.floor(value / (format.max / 1024)).toString()
18
19 return [ calc, format.type ]
20}
21
22function videoFileMaxByResolution (files: VideoFile[]) {
23 let max = files[0]
24
25 for (let i = 1; i < files.length; i++) {
26 const file = files[i]
27 if (max.resolution.id < file.resolution.id) max = file
28 }
29
30 return max
31}
32
33function videoFileMinByResolution (files: VideoFile[]) {
34 let min = files[0]
35
36 for (let i = 1; i < files.length; i++) {
37 const file = files[i]
38 if (min.resolution.id > file.resolution.id) min = file
39 }
40
41 return min
42}
43
44function getRtcConfig () {
45 return {
46 iceServers: [
47 {
48 urls: 'stun:stun.stunprotocol.org'
49 },
50 {
51 urls: 'stun:stun.framasoft.org'
52 }
53 ]
54 }
55}
56
57// ---------------------------------------------------------------------------
58
59export {
60 getRtcConfig,
61 toTitleCase,
62
63 videoFileMaxByResolution,
64 videoFileMinByResolution,
65 bytes
66}
diff --git a/client/src/assets/player/shared/control-bar/index.ts b/client/src/assets/player/shared/control-bar/index.ts
new file mode 100644
index 000000000..db5b8938d
--- /dev/null
+++ b/client/src/assets/player/shared/control-bar/index.ts
@@ -0,0 +1,5 @@
1export * from './next-previous-video-button'
2export * from './p2p-info-button'
3export * from './peertube-link-button'
4export * from './peertube-load-progress-bar'
5export * from './theater-button'
diff --git a/client/src/assets/player/control-bar/next-previous-video-button.ts b/client/src/assets/player/shared/control-bar/next-previous-video-button.ts
index fe17ce2ce..b7b986806 100644
--- a/client/src/assets/player/control-bar/next-previous-video-button.ts
+++ b/client/src/assets/player/shared/control-bar/next-previous-video-button.ts
@@ -1,5 +1,5 @@
1import videojs from 'video.js' 1import videojs from 'video.js'
2import { NextPreviousVideoButtonOptions } from '../peertube-videojs-typings' 2import { NextPreviousVideoButtonOptions } from '../../types'
3 3
4const Button = videojs.getComponent('Button') 4const Button = videojs.getComponent('Button')
5 5
diff --git a/client/src/assets/player/control-bar/p2p-info-button.ts b/client/src/assets/player/shared/control-bar/p2p-info-button.ts
index 081dee1d3..36517e125 100644
--- a/client/src/assets/player/control-bar/p2p-info-button.ts
+++ b/client/src/assets/player/shared/control-bar/p2p-info-button.ts
@@ -1,6 +1,6 @@
1import videojs from 'video.js' 1import videojs from 'video.js'
2import { PeerTubeP2PInfoButtonOptions, PlayerNetworkInfo } from '../peertube-videojs-typings' 2import { PeerTubeP2PInfoButtonOptions, PlayerNetworkInfo } from '../../types'
3import { bytes } from '../utils' 3import { bytes } from '../common'
4 4
5const Button = videojs.getComponent('Button') 5const Button = videojs.getComponent('Button')
6class P2pInfoButton extends Button { 6class P2pInfoButton extends Button {
diff --git a/client/src/assets/player/control-bar/peertube-link-button.ts b/client/src/assets/player/shared/control-bar/peertube-link-button.ts
index c49cee566..6d83263cc 100644
--- a/client/src/assets/player/control-bar/peertube-link-button.ts
+++ b/client/src/assets/player/shared/control-bar/peertube-link-button.ts
@@ -1,6 +1,6 @@
1import videojs from 'video.js' 1import videojs from 'video.js'
2import { buildVideoLink, decorateVideoLink } from '@shared/core-utils' 2import { buildVideoLink, decorateVideoLink } from '@shared/core-utils'
3import { PeerTubeLinkButtonOptions } from '../peertube-videojs-typings' 3import { PeerTubeLinkButtonOptions } from '../../types'
4 4
5const Button = videojs.getComponent('Button') 5const Button = videojs.getComponent('Button')
6class PeerTubeLinkButton extends Button { 6class PeerTubeLinkButton extends Button {
diff --git a/client/src/assets/player/control-bar/peertube-load-progress-bar.ts b/client/src/assets/player/shared/control-bar/peertube-load-progress-bar.ts
index 623e70eb2..623e70eb2 100644
--- a/client/src/assets/player/control-bar/peertube-load-progress-bar.ts
+++ b/client/src/assets/player/shared/control-bar/peertube-load-progress-bar.ts
diff --git a/client/src/assets/player/control-bar/theater-button.ts b/client/src/assets/player/shared/control-bar/theater-button.ts
index f862ee224..56c349d6b 100644
--- a/client/src/assets/player/control-bar/theater-button.ts
+++ b/client/src/assets/player/shared/control-bar/theater-button.ts
@@ -1,5 +1,5 @@
1import videojs from 'video.js' 1import videojs from 'video.js'
2import { saveTheaterInStore, getStoredTheater } from '../peertube-player-local-storage' 2import { getStoredTheater, saveTheaterInStore } from '../../peertube-player-local-storage'
3 3
4const Button = videojs.getComponent('Button') 4const Button = videojs.getComponent('Button')
5class TheaterButton extends Button { 5class TheaterButton extends Button {
diff --git a/client/src/assets/player/shared/dock/index.ts b/client/src/assets/player/shared/dock/index.ts
new file mode 100644
index 000000000..16e70a9c1
--- /dev/null
+++ b/client/src/assets/player/shared/dock/index.ts
@@ -0,0 +1,2 @@
1export * from './peertube-dock-component'
2export * from './peertube-dock-plugin'
diff --git a/client/src/assets/player/dock/peertube-dock-component.ts b/client/src/assets/player/shared/dock/peertube-dock-component.ts
index 183c7a00f..183c7a00f 100644
--- a/client/src/assets/player/dock/peertube-dock-component.ts
+++ b/client/src/assets/player/shared/dock/peertube-dock-component.ts
diff --git a/client/src/assets/player/dock/peertube-dock-plugin.ts b/client/src/assets/player/shared/dock/peertube-dock-plugin.ts
index 245981692..245981692 100644
--- a/client/src/assets/player/dock/peertube-dock-plugin.ts
+++ b/client/src/assets/player/shared/dock/peertube-dock-plugin.ts
diff --git a/client/src/assets/player/shared/hotkeys/index.ts b/client/src/assets/player/shared/hotkeys/index.ts
new file mode 100644
index 000000000..cc99a1ea8
--- /dev/null
+++ b/client/src/assets/player/shared/hotkeys/index.ts
@@ -0,0 +1 @@
export * from './peertube-hotkeys-plugin'
diff --git a/client/src/assets/player/hotkeys/peertube-hotkeys-plugin.ts b/client/src/assets/player/shared/hotkeys/peertube-hotkeys-plugin.ts
index 5920450bd..5920450bd 100644
--- a/client/src/assets/player/hotkeys/peertube-hotkeys-plugin.ts
+++ b/client/src/assets/player/shared/hotkeys/peertube-hotkeys-plugin.ts
diff --git a/client/src/assets/player/manager-options/control-bar-options-builder.ts b/client/src/assets/player/shared/manager-options/control-bar-options-builder.ts
index 54e61c5d0..72a10eb26 100644
--- a/client/src/assets/player/manager-options/control-bar-options-builder.ts
+++ b/client/src/assets/player/shared/manager-options/control-bar-options-builder.ts
@@ -1,5 +1,10 @@
1import { NextPreviousVideoButtonOptions, PeerTubeLinkButtonOptions } from '../peertube-videojs-typings' 1import {
2import { CommonOptions, PeertubePlayerManagerOptions, PlayerMode } from './manager-options.model' 2 CommonOptions,
3 NextPreviousVideoButtonOptions,
4 PeerTubeLinkButtonOptions,
5 PeertubePlayerManagerOptions,
6 PlayerMode
7} from '../../types'
3 8
4export class ControlBarOptionsBuilder { 9export class ControlBarOptionsBuilder {
5 private options: CommonOptions 10 private options: CommonOptions
@@ -41,7 +46,7 @@ export class ControlBarOptionsBuilder {
41 muteToggle: {}, 46 muteToggle: {},
42 volumeControl: {}, 47 volumeControl: {},
43 48
44 settingsButton: this.getSettingsButton() 49 ...this.getSettingsButton()
45 }) 50 })
46 51
47 if (this.options.peertubeLink === true) { 52 if (this.options.peertubeLink === true) {
diff --git a/client/src/assets/player/manager-options/hls-options-builder.ts b/client/src/assets/player/shared/manager-options/hls-options-builder.ts
index 9de23561b..e7f664fd4 100644
--- a/client/src/assets/player/manager-options/hls-options-builder.ts
+++ b/client/src/assets/player/shared/manager-options/hls-options-builder.ts
@@ -1,13 +1,13 @@
1import { HybridLoaderSettings } from '@peertube/p2p-media-loader-core' 1import { HybridLoaderSettings } from '@peertube/p2p-media-loader-core'
2import { HlsJsEngineSettings } from '@peertube/p2p-media-loader-hlsjs' 2import { HlsJsEngineSettings } from '@peertube/p2p-media-loader-hlsjs'
3import { LiveVideoLatencyMode } from '@shared/models' 3import { LiveVideoLatencyMode } from '@shared/models'
4import { getAverageBandwidthInStore } from '../../peertube-player-local-storage'
5import { P2PMediaLoader, P2PMediaLoaderPluginOptions } from '../../types'
6import { PeertubePlayerManagerOptions } from '../../types/manager-options'
7import { getRtcConfig } from '../common'
4import { RedundancyUrlManager } from '../p2p-media-loader/redundancy-url-manager' 8import { RedundancyUrlManager } from '../p2p-media-loader/redundancy-url-manager'
5import { segmentUrlBuilderFactory } from '../p2p-media-loader/segment-url-builder' 9import { segmentUrlBuilderFactory } from '../p2p-media-loader/segment-url-builder'
6import { segmentValidatorFactory } from '../p2p-media-loader/segment-validator' 10import { segmentValidatorFactory } from '../p2p-media-loader/segment-validator'
7import { getAverageBandwidthInStore } from '../peertube-player-local-storage'
8import { P2PMediaLoader, P2PMediaLoaderPluginOptions } from '../peertube-videojs-typings'
9import { getRtcConfig } from '../utils'
10import { PeertubePlayerManagerOptions } from './manager-options.model'
11 11
12export class HLSOptionsBuilder { 12export class HLSOptionsBuilder {
13 13
diff --git a/client/src/assets/player/shared/manager-options/index.ts b/client/src/assets/player/shared/manager-options/index.ts
new file mode 100644
index 000000000..4934d8302
--- /dev/null
+++ b/client/src/assets/player/shared/manager-options/index.ts
@@ -0,0 +1 @@
export * from './manager-options-builder'
diff --git a/client/src/assets/player/manager-options/manager-options-builder.ts b/client/src/assets/player/shared/manager-options/manager-options-builder.ts
index 14bdb5d96..5dab1f7a9 100644
--- a/client/src/assets/player/manager-options/manager-options-builder.ts
+++ b/client/src/assets/player/shared/manager-options/manager-options-builder.ts
@@ -1,12 +1,13 @@
1import videojs from 'video.js' 1import videojs from 'video.js'
2import { copyToClipboard } from '@root-helpers/utils'
3import { buildVideoOrPlaylistEmbed } from '@root-helpers/video'
4import { isIOS, isSafari } from '@root-helpers/web-browser'
2import { buildVideoLink, decorateVideoLink } from '@shared/core-utils' 5import { buildVideoLink, decorateVideoLink } from '@shared/core-utils'
3import { isDefaultLocale } from '@shared/core-utils/i18n' 6import { isDefaultLocale } from '@shared/core-utils/i18n'
4import { copyToClipboard } from '../../../root-helpers/utils' 7import { VideoJSPluginOptions } from '../../types'
5import { VideoJSPluginOptions } from '../peertube-videojs-typings' 8import { CommonOptions, PeertubePlayerManagerOptions, PlayerMode } from '../../types/manager-options'
6import { buildVideoOrPlaylistEmbed, isIOS, isSafari } from '../utils'
7import { ControlBarOptionsBuilder } from './control-bar-options-builder' 9import { ControlBarOptionsBuilder } from './control-bar-options-builder'
8import { HLSOptionsBuilder } from './hls-options-builder' 10import { HLSOptionsBuilder } from './hls-options-builder'
9import { CommonOptions, PeertubePlayerManagerOptions, PlayerMode } from './manager-options.model'
10import { WebTorrentOptionsBuilder } from './webtorrent-options-builder' 11import { WebTorrentOptionsBuilder } from './webtorrent-options-builder'
11 12
12export class ManagerOptionsBuilder { 13export class ManagerOptionsBuilder {
diff --git a/client/src/assets/player/manager-options/webtorrent-options-builder.ts b/client/src/assets/player/shared/manager-options/webtorrent-options-builder.ts
index 303940b29..257cf1e05 100644
--- a/client/src/assets/player/manager-options/webtorrent-options-builder.ts
+++ b/client/src/assets/player/shared/manager-options/webtorrent-options-builder.ts
@@ -1,4 +1,4 @@
1import { PeertubePlayerManagerOptions } from './manager-options.model' 1import { PeertubePlayerManagerOptions } from '../../types'
2 2
3export class WebTorrentOptionsBuilder { 3export class WebTorrentOptionsBuilder {
4 4
diff --git a/client/src/assets/player/shared/mobile/index.ts b/client/src/assets/player/shared/mobile/index.ts
new file mode 100644
index 000000000..6f42b8db7
--- /dev/null
+++ b/client/src/assets/player/shared/mobile/index.ts
@@ -0,0 +1,2 @@
1export * from './peertube-mobile-buttons'
2export * from './peertube-mobile-plugin'
diff --git a/client/src/assets/player/mobile/peertube-mobile-buttons.ts b/client/src/assets/player/shared/mobile/peertube-mobile-buttons.ts
index 09cb98f2e..09cb98f2e 100644
--- a/client/src/assets/player/mobile/peertube-mobile-buttons.ts
+++ b/client/src/assets/player/shared/mobile/peertube-mobile-buttons.ts
diff --git a/client/src/assets/player/mobile/peertube-mobile-plugin.ts b/client/src/assets/player/shared/mobile/peertube-mobile-plugin.ts
index 91dda7f94..91dda7f94 100644
--- a/client/src/assets/player/mobile/peertube-mobile-plugin.ts
+++ b/client/src/assets/player/shared/mobile/peertube-mobile-plugin.ts
diff --git a/client/src/assets/player/p2p-media-loader/hls-plugin.ts b/client/src/assets/player/shared/p2p-media-loader/hls-plugin.ts
index ccee2d90f..d0105fa36 100644
--- a/client/src/assets/player/p2p-media-loader/hls-plugin.ts
+++ b/client/src/assets/player/shared/p2p-media-loader/hls-plugin.ts
@@ -3,7 +3,7 @@
3 3
4import Hlsjs, { ErrorData, HlsConfig, Level, LevelSwitchingData, ManifestParsedData } from 'hls.js' 4import Hlsjs, { ErrorData, HlsConfig, Level, LevelSwitchingData, ManifestParsedData } from 'hls.js'
5import videojs from 'video.js' 5import videojs from 'video.js'
6import { HlsjsConfigHandlerOptions, PeerTubeResolution, VideoJSTechHLS } from '../peertube-videojs-typings' 6import { HlsjsConfigHandlerOptions, PeerTubeResolution, VideoJSTechHLS } from '../../types'
7 7
8type ErrorCounts = { 8type ErrorCounts = {
9 [ type: string ]: number 9 [ type: string ]: number
diff --git a/client/src/assets/player/shared/p2p-media-loader/index.ts b/client/src/assets/player/shared/p2p-media-loader/index.ts
new file mode 100644
index 000000000..02fe71e73
--- /dev/null
+++ b/client/src/assets/player/shared/p2p-media-loader/index.ts
@@ -0,0 +1,5 @@
1export * from './hls-plugin'
2export * from './p2p-media-loader-plugin'
3export * from './redundancy-url-manager'
4export * from './segment-url-builder'
5export * from './segment-validator'
diff --git a/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts b/client/src/assets/player/shared/p2p-media-loader/p2p-media-loader-plugin.ts
index 1d7a39b4e..5c0f0021f 100644
--- a/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts
+++ b/client/src/assets/player/shared/p2p-media-loader/p2p-media-loader-plugin.ts
@@ -3,7 +3,7 @@ import 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'
5import { timeToInt } from '@shared/core-utils' 5import { timeToInt } from '@shared/core-utils'
6import { P2PMediaLoaderPluginOptions, PlayerNetworkInfo } from '../peertube-videojs-typings' 6import { P2PMediaLoaderPluginOptions, PlayerNetworkInfo } from '../../types'
7import { registerConfigPlugin, registerSourceHandler } from './hls-plugin' 7import { registerConfigPlugin, registerSourceHandler } from './hls-plugin'
8 8
9registerConfigPlugin(videojs) 9registerConfigPlugin(videojs)
diff --git a/client/src/assets/player/p2p-media-loader/redundancy-url-manager.ts b/client/src/assets/player/shared/p2p-media-loader/redundancy-url-manager.ts
index abab8aa99..abab8aa99 100644
--- a/client/src/assets/player/p2p-media-loader/redundancy-url-manager.ts
+++ b/client/src/assets/player/shared/p2p-media-loader/redundancy-url-manager.ts
diff --git a/client/src/assets/player/p2p-media-loader/segment-url-builder.ts b/client/src/assets/player/shared/p2p-media-loader/segment-url-builder.ts
index 9d324078a..9d324078a 100644
--- a/client/src/assets/player/p2p-media-loader/segment-url-builder.ts
+++ b/client/src/assets/player/shared/p2p-media-loader/segment-url-builder.ts
diff --git a/client/src/assets/player/p2p-media-loader/segment-validator.ts b/client/src/assets/player/shared/p2p-media-loader/segment-validator.ts
index f7f83a8a4..f7f83a8a4 100644
--- a/client/src/assets/player/p2p-media-loader/segment-validator.ts
+++ b/client/src/assets/player/shared/p2p-media-loader/segment-validator.ts
diff --git a/client/src/assets/player/shared/peertube/index.ts b/client/src/assets/player/shared/peertube/index.ts
new file mode 100644
index 000000000..ff4d5241b
--- /dev/null
+++ b/client/src/assets/player/shared/peertube/index.ts
@@ -0,0 +1 @@
export * from './peertube-plugin'
diff --git a/client/src/assets/player/peertube-plugin.ts b/client/src/assets/player/shared/peertube/peertube-plugin.ts
index 4ffc9ce3e..1dc3e3de0 100644
--- a/client/src/assets/player/peertube-plugin.ts
+++ b/client/src/assets/player/shared/peertube/peertube-plugin.ts
@@ -1,5 +1,6 @@
1import debug from 'debug' 1import debug from 'debug'
2import videojs from 'video.js' 2import videojs from 'video.js'
3import { isMobile } from '@root-helpers/web-browser'
3import { timeToInt } from '@shared/core-utils' 4import { timeToInt } from '@shared/core-utils'
4import { 5import {
5 getStoredLastSubtitle, 6 getStoredLastSubtitle,
@@ -9,10 +10,9 @@ import {
9 saveMuteInStore, 10 saveMuteInStore,
10 saveVideoWatchHistory, 11 saveVideoWatchHistory,
11 saveVolumeInStore 12 saveVolumeInStore
12} from './peertube-player-local-storage' 13} from '../../peertube-player-local-storage'
13import { PeerTubePluginOptions, UserWatching, VideoJSCaption } from './peertube-videojs-typings' 14import { PeerTubePluginOptions, UserWatching, VideoJSCaption } from '../../types'
14import { SettingsButton } from './settings/settings-menu-button' 15import { SettingsButton } from '../settings/settings-menu-button'
15import { isMobile } from './utils'
16 16
17const logger = debug('peertube:player:peertube') 17const logger = debug('peertube:player:peertube')
18 18
diff --git a/client/src/assets/player/shared/playlist/index.ts b/client/src/assets/player/shared/playlist/index.ts
new file mode 100644
index 000000000..0be6e4d3c
--- /dev/null
+++ b/client/src/assets/player/shared/playlist/index.ts
@@ -0,0 +1,4 @@
1export * from './playlist-button'
2export * from './playlist-menu-item'
3export * from './playlist-menu'
4export * from './playlist-plugin'
diff --git a/client/src/assets/player/playlist/playlist-button.ts b/client/src/assets/player/shared/playlist/playlist-button.ts
index a7996ec60..6cfaf4158 100644
--- a/client/src/assets/player/playlist/playlist-button.ts
+++ b/client/src/assets/player/shared/playlist/playlist-button.ts
@@ -1,5 +1,5 @@
1import videojs from 'video.js' 1import videojs from 'video.js'
2import { PlaylistPluginOptions } from '../peertube-videojs-typings' 2import { PlaylistPluginOptions } from '../../types'
3import { PlaylistMenu } from './playlist-menu' 3import { PlaylistMenu } from './playlist-menu'
4 4
5const ClickableComponent = videojs.getComponent('ClickableComponent') 5const ClickableComponent = videojs.getComponent('ClickableComponent')
diff --git a/client/src/assets/player/playlist/playlist-menu-item.ts b/client/src/assets/player/shared/playlist/playlist-menu-item.ts
index 2519a34c7..81b5acf30 100644
--- a/client/src/assets/player/playlist/playlist-menu-item.ts
+++ b/client/src/assets/player/shared/playlist/playlist-menu-item.ts
@@ -1,7 +1,7 @@
1import videojs from 'video.js' 1import videojs from 'video.js'
2import { secondsToTime } from '@shared/core-utils' 2import { secondsToTime } from '@shared/core-utils'
3import { VideoPlaylistElement } from '@shared/models' 3import { VideoPlaylistElement } from '@shared/models'
4import { PlaylistItemOptions } from '../peertube-videojs-typings' 4import { PlaylistItemOptions } from '../../types'
5 5
6const Component = videojs.getComponent('Component') 6const Component = videojs.getComponent('Component')
7 7
diff --git a/client/src/assets/player/playlist/playlist-menu.ts b/client/src/assets/player/shared/playlist/playlist-menu.ts
index a2583047b..1ec9ac804 100644
--- a/client/src/assets/player/playlist/playlist-menu.ts
+++ b/client/src/assets/player/shared/playlist/playlist-menu.ts
@@ -1,6 +1,6 @@
1import videojs from 'video.js' 1import videojs from 'video.js'
2import { VideoPlaylistElement } from '@shared/models' 2import { VideoPlaylistElement } from '@shared/models'
3import { PlaylistPluginOptions } from '../peertube-videojs-typings' 3import { PlaylistPluginOptions } from '../../types'
4import { PlaylistMenuItem } from './playlist-menu-item' 4import { PlaylistMenuItem } from './playlist-menu-item'
5 5
6const Component = videojs.getComponent('Component') 6const Component = videojs.getComponent('Component')
diff --git a/client/src/assets/player/playlist/playlist-plugin.ts b/client/src/assets/player/shared/playlist/playlist-plugin.ts
index b69d82e3c..44de0da5a 100644
--- a/client/src/assets/player/playlist/playlist-plugin.ts
+++ b/client/src/assets/player/shared/playlist/playlist-plugin.ts
@@ -1,5 +1,5 @@
1import videojs from 'video.js' 1import videojs from 'video.js'
2import { PlaylistPluginOptions } from '../peertube-videojs-typings' 2import { PlaylistPluginOptions } from '../../types'
3import { PlaylistButton } from './playlist-button' 3import { PlaylistButton } from './playlist-button'
4import { PlaylistMenu } from './playlist-menu' 4import { PlaylistMenu } from './playlist-menu'
5 5
@@ -20,7 +20,7 @@ class PlaylistPlugin extends Plugin {
20 }) 20 })
21 21
22 this.playlistMenu = new PlaylistMenu(player, options) 22 this.playlistMenu = new PlaylistMenu(player, options)
23 this.playlistButton = new PlaylistButton(player, Object.assign({}, options, { playlistMenu: this.playlistMenu })) 23 this.playlistButton = new PlaylistButton(player, { ...options, playlistMenu: this.playlistMenu })
24 24
25 player.addChild(this.playlistMenu, options) 25 player.addChild(this.playlistMenu, options)
26 player.addChild(this.playlistButton, options) 26 player.addChild(this.playlistButton, options)
diff --git a/client/src/assets/player/shared/resolutions/index.ts b/client/src/assets/player/shared/resolutions/index.ts
new file mode 100644
index 000000000..e56473f43
--- /dev/null
+++ b/client/src/assets/player/shared/resolutions/index.ts
@@ -0,0 +1 @@
export * from './peertube-resolutions-plugin'
diff --git a/client/src/assets/player/peertube-resolutions-plugin.ts b/client/src/assets/player/shared/resolutions/peertube-resolutions-plugin.ts
index cc36f18f3..e7899ac71 100644
--- a/client/src/assets/player/peertube-resolutions-plugin.ts
+++ b/client/src/assets/player/shared/resolutions/peertube-resolutions-plugin.ts
@@ -1,5 +1,5 @@
1import videojs from 'video.js' 1import videojs from 'video.js'
2import { PeerTubeResolution } from './peertube-videojs-typings' 2import { PeerTubeResolution } from '../../types'
3 3
4const Plugin = videojs.getPlugin('plugin') 4const Plugin = videojs.getPlugin('plugin')
5 5
diff --git a/client/src/assets/player/shared/settings/index.ts b/client/src/assets/player/shared/settings/index.ts
new file mode 100644
index 000000000..736d50c16
--- /dev/null
+++ b/client/src/assets/player/shared/settings/index.ts
@@ -0,0 +1,7 @@
1export * from './resolution-menu-button'
2export * from './resolution-menu-item'
3export * from './settings-dialog'
4export * from './settings-menu-button'
5export * from './settings-menu-item'
6export * from './settings-panel-child'
7export * from './settings-panel'
diff --git a/client/src/assets/player/settings/resolution-menu-button.ts b/client/src/assets/player/shared/settings/resolution-menu-button.ts
index 8bd5b4f03..8bd5b4f03 100644
--- a/client/src/assets/player/settings/resolution-menu-button.ts
+++ b/client/src/assets/player/shared/settings/resolution-menu-button.ts
diff --git a/client/src/assets/player/settings/resolution-menu-item.ts b/client/src/assets/player/shared/settings/resolution-menu-item.ts
index 6047f52f7..6047f52f7 100644
--- a/client/src/assets/player/settings/resolution-menu-item.ts
+++ b/client/src/assets/player/shared/settings/resolution-menu-item.ts
diff --git a/client/src/assets/player/settings/settings-dialog.ts b/client/src/assets/player/shared/settings/settings-dialog.ts
index 8cd98967f..8cd98967f 100644
--- a/client/src/assets/player/settings/settings-dialog.ts
+++ b/client/src/assets/player/shared/settings/settings-dialog.ts
diff --git a/client/src/assets/player/settings/settings-menu-button.ts b/client/src/assets/player/shared/settings/settings-menu-button.ts
index 6de390f4d..64866aab2 100644
--- a/client/src/assets/player/settings/settings-menu-button.ts
+++ b/client/src/assets/player/shared/settings/settings-menu-button.ts
@@ -1,9 +1,7 @@
1// Thanks to Yanko Shterev: https://github.com/yshterev/videojs-settings-menu
2import { SettingsMenuItem } from './settings-menu-item'
3import { toTitleCase } from '../utils'
4import videojs from 'video.js' 1import videojs from 'video.js'
5 2import { toTitleCase } from '../common'
6import { SettingsDialog } from './settings-dialog' 3import { SettingsDialog } from './settings-dialog'
4import { SettingsMenuItem } from './settings-menu-item'
7import { SettingsPanel } from './settings-panel' 5import { SettingsPanel } from './settings-panel'
8import { SettingsPanelChild } from './settings-panel-child' 6import { SettingsPanelChild } from './settings-panel-child'
9 7
diff --git a/client/src/assets/player/settings/settings-menu-item.ts b/client/src/assets/player/shared/settings/settings-menu-item.ts
index 31d42c456..8d1819a2d 100644
--- a/client/src/assets/player/settings/settings-menu-item.ts
+++ b/client/src/assets/player/shared/settings/settings-menu-item.ts
@@ -1,6 +1,5 @@
1import videojs from 'video.js' 1import videojs from 'video.js'
2// Thanks to Yanko Shterev: https://github.com/yshterev/videojs-settings-menu 2import { toTitleCase } from '../common'
3import { toTitleCase } from '../utils'
4import { SettingsDialog } from './settings-dialog' 3import { SettingsDialog } from './settings-dialog'
5import { SettingsButton } from './settings-menu-button' 4import { SettingsButton } from './settings-menu-button'
6import { SettingsPanel } from './settings-panel' 5import { SettingsPanel } from './settings-panel'
diff --git a/client/src/assets/player/settings/settings-panel-child.ts b/client/src/assets/player/shared/settings/settings-panel-child.ts
index 161420c38..161420c38 100644
--- a/client/src/assets/player/settings/settings-panel-child.ts
+++ b/client/src/assets/player/shared/settings/settings-panel-child.ts
diff --git a/client/src/assets/player/settings/settings-panel.ts b/client/src/assets/player/shared/settings/settings-panel.ts
index 28b579bdd..28b579bdd 100644
--- a/client/src/assets/player/settings/settings-panel.ts
+++ b/client/src/assets/player/shared/settings/settings-panel.ts
diff --git a/client/src/assets/player/shared/stats/index.ts b/client/src/assets/player/shared/stats/index.ts
new file mode 100644
index 000000000..017ec044c
--- /dev/null
+++ b/client/src/assets/player/shared/stats/index.ts
@@ -0,0 +1,2 @@
1export * from './stats-card'
2export * from './stats-plugin'
diff --git a/client/src/assets/player/stats/stats-card.ts b/client/src/assets/player/shared/stats/stats-card.ts
index e76a81a74..1bf631d2c 100644
--- a/client/src/assets/player/stats/stats-card.ts
+++ b/client/src/assets/player/shared/stats/stats-card.ts
@@ -1,7 +1,7 @@
1import videojs from 'video.js' 1import videojs from 'video.js'
2import { secondsToTime } from '@shared/core-utils' 2import { secondsToTime } from '@shared/core-utils'
3import { PlayerNetworkInfo as EventPlayerNetworkInfo } from '../peertube-videojs-typings' 3import { PlayerNetworkInfo as EventPlayerNetworkInfo } from '../../types'
4import { bytes } from '../utils' 4import { bytes } from '../common'
5 5
6interface StatsCardOptions extends videojs.ComponentOptions { 6interface StatsCardOptions extends videojs.ComponentOptions {
7 videoUUID: string 7 videoUUID: string
diff --git a/client/src/assets/player/stats/stats-plugin.ts b/client/src/assets/player/shared/stats/stats-plugin.ts
index 8aad80e8a..8aad80e8a 100644
--- a/client/src/assets/player/stats/stats-plugin.ts
+++ b/client/src/assets/player/shared/stats/stats-plugin.ts
diff --git a/client/src/assets/player/upnext/end-card.ts b/client/src/assets/player/shared/upnext/end-card.ts
index 61668e407..61668e407 100644
--- a/client/src/assets/player/upnext/end-card.ts
+++ b/client/src/assets/player/shared/upnext/end-card.ts
diff --git a/client/src/assets/player/shared/upnext/index.ts b/client/src/assets/player/shared/upnext/index.ts
new file mode 100644
index 000000000..c63c5fd83
--- /dev/null
+++ b/client/src/assets/player/shared/upnext/index.ts
@@ -0,0 +1,2 @@
1export * from './end-card'
2export * from './upnext-plugin'
diff --git a/client/src/assets/player/upnext/upnext-plugin.ts b/client/src/assets/player/shared/upnext/upnext-plugin.ts
index db969024d..db969024d 100644
--- a/client/src/assets/player/upnext/upnext-plugin.ts
+++ b/client/src/assets/player/shared/upnext/upnext-plugin.ts
diff --git a/client/src/assets/player/webtorrent/peertube-chunk-store.ts b/client/src/assets/player/shared/webtorrent/peertube-chunk-store.ts
index 81378c277..81378c277 100644
--- a/client/src/assets/player/webtorrent/peertube-chunk-store.ts
+++ b/client/src/assets/player/shared/webtorrent/peertube-chunk-store.ts
diff --git a/client/src/assets/player/webtorrent/video-renderer.ts b/client/src/assets/player/shared/webtorrent/video-renderer.ts
index 9b80fea2c..9b80fea2c 100644
--- a/client/src/assets/player/webtorrent/video-renderer.ts
+++ b/client/src/assets/player/shared/webtorrent/video-renderer.ts
diff --git a/client/src/assets/player/webtorrent/webtorrent-plugin.ts b/client/src/assets/player/shared/webtorrent/webtorrent-plugin.ts
index 4bcb2766a..b48203148 100644
--- a/client/src/assets/player/webtorrent/webtorrent-plugin.ts
+++ b/client/src/assets/player/shared/webtorrent/webtorrent-plugin.ts
@@ -1,10 +1,11 @@
1import videojs from 'video.js' 1import videojs from 'video.js'
2import * as WebTorrent from 'webtorrent' 2import * as WebTorrent from 'webtorrent'
3import { isIOS } from '@root-helpers/web-browser'
3import { timeToInt } from '@shared/core-utils' 4import { timeToInt } from '@shared/core-utils'
4import { VideoFile } from '@shared/models' 5import { VideoFile } from '@shared/models'
5import { getAverageBandwidthInStore, getStoredMute, getStoredVolume, saveAverageBandwidth } from '../peertube-player-local-storage' 6import { getAverageBandwidthInStore, getStoredMute, getStoredVolume, saveAverageBandwidth } from '../../peertube-player-local-storage'
6import { PeerTubeResolution, PlayerNetworkInfo, WebtorrentPluginOptions } from '../peertube-videojs-typings' 7import { PeerTubeResolution, PlayerNetworkInfo, WebtorrentPluginOptions } from '../../types'
7import { getRtcConfig, isIOS, videoFileMaxByResolution, videoFileMinByResolution } from '../utils' 8import { getRtcConfig, videoFileMaxByResolution, videoFileMinByResolution } from '../common'
8import { PeertubeChunkStore } from './peertube-chunk-store' 9import { PeertubeChunkStore } from './peertube-chunk-store'
9import { renderVideo } from './video-renderer' 10import { renderVideo } from './video-renderer'
10 11
diff --git a/client/src/assets/player/types/index.ts b/client/src/assets/player/types/index.ts
new file mode 100644
index 000000000..b73e0b3cb
--- /dev/null
+++ b/client/src/assets/player/types/index.ts
@@ -0,0 +1,2 @@
1export * from './manager-options'
2export * from './peertube-videojs-typings'
diff --git a/client/src/assets/player/manager-options/manager-options.model.ts b/client/src/assets/player/types/manager-options.ts
index 0b0f8b435..b3ad7e337 100644
--- a/client/src/assets/player/manager-options/manager-options.model.ts
+++ b/client/src/assets/player/types/manager-options.ts
@@ -1,6 +1,6 @@
1import { PluginsManager } from '@root-helpers/plugins-manager' 1import { PluginsManager } from '@root-helpers/plugins-manager'
2import { LiveVideoLatencyMode, VideoFile } from '@shared/models' 2import { LiveVideoLatencyMode, VideoFile } from '@shared/models'
3import { PlaylistPluginOptions, UserWatching, VideoJSCaption } from '../peertube-videojs-typings' 3import { PlaylistPluginOptions, UserWatching, VideoJSCaption } from './peertube-videojs-typings'
4 4
5export type PlayerMode = 'webtorrent' | 'p2p-media-loader' 5export type PlayerMode = 'webtorrent' | 'p2p-media-loader'
6 6
diff --git a/client/src/assets/player/peertube-videojs-typings.ts b/client/src/assets/player/types/peertube-videojs-typings.ts
index fcaa8a9c3..d9a388681 100644
--- a/client/src/assets/player/peertube-videojs-typings.ts
+++ b/client/src/assets/player/types/peertube-videojs-typings.ts
@@ -2,18 +2,18 @@ import { HlsConfig, Level } from 'hls.js'
2import videojs from 'video.js' 2import videojs from 'video.js'
3import { Engine } from '@peertube/p2p-media-loader-hlsjs' 3import { Engine } from '@peertube/p2p-media-loader-hlsjs'
4import { VideoFile, VideoPlaylist, VideoPlaylistElement } from '@shared/models' 4import { VideoFile, VideoPlaylist, VideoPlaylistElement } from '@shared/models'
5import { PeerTubeDockPluginOptions } from './dock/peertube-dock-plugin' 5import { PeerTubeDockPluginOptions } from '../shared/dock/peertube-dock-plugin'
6import { PlayerMode } from './manager-options/manager-options.model' 6import { Html5Hlsjs } from '../shared/p2p-media-loader/hls-plugin'
7import { Html5Hlsjs } from './p2p-media-loader/hls-plugin' 7import { P2pMediaLoaderPlugin } from '../shared/p2p-media-loader/p2p-media-loader-plugin'
8import { P2pMediaLoaderPlugin } from './p2p-media-loader/p2p-media-loader-plugin' 8import { RedundancyUrlManager } from '../shared/p2p-media-loader/redundancy-url-manager'
9import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager' 9import { PeerTubePlugin } from '../shared/peertube/peertube-plugin'
10import { PeerTubePlugin } from './peertube-plugin' 10import { PlaylistPlugin } from '../shared/playlist/playlist-plugin'
11import { PeerTubeResolutionsPlugin } from './peertube-resolutions-plugin' 11import { PeerTubeResolutionsPlugin } from '../shared/resolutions/peertube-resolutions-plugin'
12import { PlaylistPlugin } from './playlist/playlist-plugin' 12import { StatsCardOptions } from '../shared/stats/stats-card'
13import { StatsCardOptions } from './stats/stats-card' 13import { StatsForNerdsPlugin } from '../shared/stats/stats-plugin'
14import { StatsForNerdsPlugin } from './stats/stats-plugin' 14import { EndCardOptions } from '../shared/upnext/end-card'
15import { EndCardOptions } from './upnext/end-card' 15import { WebTorrentPlugin } from '../shared/webtorrent/webtorrent-plugin'
16import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin' 16import { PlayerMode } from './manager-options'
17 17
18declare module 'video.js' { 18declare module 'video.js' {
19 19
diff --git a/client/src/root-helpers/index.ts b/client/src/root-helpers/index.ts
index aa3b442dd..3b95b4b99 100644
--- a/client/src/root-helpers/index.ts
+++ b/client/src/root-helpers/index.ts
@@ -3,5 +3,6 @@ export * from './bytes'
3export * from './images' 3export * from './images'
4export * from './local-storage-utils' 4export * from './local-storage-utils'
5export * from './peertube-web-storage' 5export * from './peertube-web-storage'
6export * from './utils'
7export * from './plugins-manager' 6export * from './plugins-manager'
7export * from './utils'
8export * from './video'
diff --git a/client/src/root-helpers/video.ts b/client/src/root-helpers/video.ts
new file mode 100644
index 000000000..4290992aa
--- /dev/null
+++ b/client/src/root-helpers/video.ts
@@ -0,0 +1,33 @@
1import { HTMLServerConfig, Video } from '@shared/models'
2
3function buildVideoOrPlaylistEmbed (embedUrl: string, embedTitle: string) {
4 const iframe = document.createElement('iframe')
5
6 iframe.title = embedTitle
7 iframe.width = '560'
8 iframe.height = '315'
9 iframe.src = embedUrl
10 iframe.frameBorder = '0'
11 iframe.allowFullscreen = true
12 iframe.sandbox.add('allow-same-origin', 'allow-scripts', 'allow-popups')
13
14 return iframe.outerHTML
15}
16
17function isP2PEnabled (video: Video, config: HTMLServerConfig, userP2PEnabled: boolean) {
18 if (video.isLocal && config.tracker.enabled === false) return false
19 if (isWebRTCDisabled()) return false
20
21 return userP2PEnabled
22}
23
24export {
25 buildVideoOrPlaylistEmbed,
26 isP2PEnabled
27}
28
29// ---------------------------------------------------------------------------
30
31function isWebRTCDisabled () {
32 return !!((window as any).RTCPeerConnection || (window as any).mozRTCPeerConnection || (window as any).webkitRTCPeerConnection) === false
33}
diff --git a/client/src/root-helpers/web-browser.ts b/client/src/root-helpers/web-browser.ts
new file mode 100644
index 000000000..9dade20e8
--- /dev/null
+++ b/client/src/root-helpers/web-browser.ts
@@ -0,0 +1,24 @@
1function isIOS () {
2 if (/iPad|iPhone|iPod/.test(navigator.platform)) {
3 return true
4 }
5
6 // Detect iPad Desktop mode
7 return !!(navigator.maxTouchPoints &&
8 navigator.maxTouchPoints > 2 &&
9 navigator.platform.includes('MacIntel'))
10}
11
12function isSafari () {
13 return /^((?!chrome|android).)*safari/i.test(navigator.userAgent)
14}
15
16function isMobile () {
17 return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent)
18}
19
20export {
21 isIOS,
22 isSafari,
23 isMobile
24}
diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts
index 9e4d87911..55c26ec3b 100644
--- a/client/src/standalone/videos/embed.ts
+++ b/client/src/standalone/videos/embed.ts
@@ -1,6 +1,6 @@
1import './embed.scss' 1import './embed.scss'
2import '../../assets/player/dock/peertube-dock-component' 2import '../../assets/player/shared/dock/peertube-dock-component'
3import '../../assets/player/dock/peertube-dock-plugin' 3import '../../assets/player/shared/dock/peertube-dock-plugin'
4import videojs from 'video.js' 4import videojs from 'video.js'
5import { peertubeTranslate } from '../../../../shared/core-utils/i18n' 5import { peertubeTranslate } from '../../../../shared/core-utils/i18n'
6import { 6import {
@@ -17,15 +17,14 @@ import {
17 VideoPlaylistElement, 17 VideoPlaylistElement,
18 VideoStreamingPlaylistType 18 VideoStreamingPlaylistType
19} from '../../../../shared/models' 19} from '../../../../shared/models'
20import { P2PMediaLoaderOptions, PeertubePlayerManagerOptions, PlayerMode } from '../../assets/player' 20import { P2PMediaLoaderOptions, PeertubePlayerManagerOptions, PlayerMode, VideoJSCaption } from '../../assets/player'
21import { VideoJSCaption } from '../../assets/player/peertube-videojs-typings'
22import { TranslationsManager } from '../../assets/player/translations-manager' 21import { TranslationsManager } from '../../assets/player/translations-manager'
23import { isP2PEnabled } from '../../assets/player/utils'
24import { getBoolOrDefault } from '../../root-helpers/local-storage-utils' 22import { getBoolOrDefault } from '../../root-helpers/local-storage-utils'
25import { peertubeLocalStorage } from '../../root-helpers/peertube-web-storage' 23import { peertubeLocalStorage } from '../../root-helpers/peertube-web-storage'
26import { PluginsManager } from '../../root-helpers/plugins-manager' 24import { PluginsManager } from '../../root-helpers/plugins-manager'
27import { UserLocalStorageKeys, UserTokens } from '../../root-helpers/users' 25import { UserLocalStorageKeys, UserTokens } from '../../root-helpers/users'
28import { objectToUrlEncoded } from '../../root-helpers/utils' 26import { objectToUrlEncoded } from '../../root-helpers/utils'
27import { isP2PEnabled } from '../../root-helpers/video'
29import { RegisterClientHelpers } from '../../types/register-client-option.model' 28import { RegisterClientHelpers } from '../../types/register-client-option.model'
30import { PeerTubeEmbedApi } from './embed-api' 29import { PeerTubeEmbedApi } from './embed-api'
31 30