- if (commonOptions.enableHotkeys === true) {
- PeertubePlayerManager.addHotkeysOptions(plugins)
- }
-
- if (mode === 'p2p-media-loader') {
- const { hlsjs } = PeertubePlayerManager.addP2PMediaLoaderOptions(plugins, options, p2pMediaLoaderModule)
-
- html5 = hlsjs.html5
- }
-
- if (mode === 'webtorrent') {
- PeertubePlayerManager.addWebTorrentOptions(plugins, options)
-
- // WebTorrent plugin handles autoplay, because we do some hackish stuff in there
- autoplay = false
- }
-
- const videojsOptions = {
- html5,
-
- // We don't use text track settings for now
- textTrackSettings: false as any, // FIXME: typings
- controls: commonOptions.controls !== undefined ? commonOptions.controls : true,
- loop: commonOptions.loop !== undefined ? commonOptions.loop : false,
-
- muted: commonOptions.muted !== undefined
- ? commonOptions.muted
- : undefined, // Undefined so the player knows it has to check the local storage
-
- autoplay: this.getAutoPlayValue(autoplay),
-
- poster: commonOptions.poster,
- inactivityTimeout: commonOptions.inactivityTimeout,
- playbackRates: [ 0.5, 0.75, 1, 1.25, 1.5, 2 ],
-
- plugins,
-
- controlBar: {
- children: this.getControlBarChildren(mode, {
- captions: commonOptions.captions,
- peertubeLink: commonOptions.peertubeLink,
- theaterButton: commonOptions.theaterButton,
- nextVideo: commonOptions.nextVideo
- }) as any // FIXME: typings