import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
import { ServerConfig, ServerErrorCode, UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '@shared/models'
-import { cleanupVideoWatch, getStoredP2PEnabled, getStoredTheater, getStoredVideoWatchHistory } from '../../../assets/player/peertube-player-local-storage'
+import {
+ cleanupVideoWatch,
+ getStoredP2PEnabled,
+ getStoredTheater,
+ getStoredVideoWatchHistory
+} from '../../../assets/player/peertube-player-local-storage'
import {
CustomizationOptions,
P2PMediaLoaderOptions,
}
showSupportModal () {
- // Check video was playing before opening support modal
- const isVideoPlaying = this.isPlaying()
-
- this.pausePlayer()
-
- const modalRef = this.supportModal.show()
-
- modalRef.result.then(() => {
- if (isVideoPlaying) {
- this.resumePlayer()
- }
- })
+ this.supportModal.show()
}
showShareModal () {
- this.pausePlayer()
-
this.videoShareModal.show(this.currentTime, this.videoWatchPlaylist.currentPlaylistPosition)
}
}
}
- onModalOpened () {
- this.pausePlayer()
- }
-
onVideoRemoved () {
this.redirectService.redirectToHomepage()
}
this.loadVideo(videoId)
}
+ displayOtherVideosAsRow () {
+ // Use the same value as in the SASS file
+ return this.screenService.getWindowInnerWidth() <= 1100
+ }
+
private loadVideo (videoId: string) {
// Video did not change
if (this.video && this.video.uuid === videoId) return
return { playerMode: mode, playerOptions: options }
}
- private pausePlayer () {
- if (!this.player) return
-
- this.player.pause()
- }
-
- private resumePlayer () {
- if (!this.player) return
-
- this.player.play()
- }
-
- private isPlaying () {
- if (!this.player) return
-
- return !this.player.paused()
- }
-
private async subscribeToLiveEventsIfNeeded (oldVideo: VideoDetails, newVideo: VideoDetails) {
if (!this.liveVideosSub) {
this.liveVideosSub = this.buildLiveEventsSubscription()