Don't pause video upon modal open (#3909)
* client: dont pause video upon modal open closes #3816 * client(video/watch): remove obsolete code * gitignore: add vscode and vim swp files
This commit is contained in:
parent
97c116edf9
commit
ca87329289
|
@ -30,9 +30,11 @@ yarn-error.log
|
||||||
# IDE
|
# IDE
|
||||||
/*.sublime-project
|
/*.sublime-project
|
||||||
/*.sublime-workspace
|
/*.sublime-workspace
|
||||||
|
/*.vscode
|
||||||
/**/.idea
|
/**/.idea
|
||||||
/dist
|
/dist
|
||||||
/PeerTube.iml
|
/PeerTube.iml
|
||||||
|
*.swp
|
||||||
|
|
||||||
# Zanata
|
# Zanata
|
||||||
/.zanata-cache
|
/.zanata-cache
|
||||||
|
|
|
@ -142,7 +142,7 @@
|
||||||
<ng-container *ngIf="isUserLoggedIn()">
|
<ng-container *ngIf="isUserLoggedIn()">
|
||||||
<my-video-actions-dropdown
|
<my-video-actions-dropdown
|
||||||
placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions"
|
placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions"
|
||||||
[displayOptions]="videoActionsOptions" (videoRemoved)="onVideoRemoved()" (modalOpened)="onModalOpened()"
|
[displayOptions]="videoActionsOptions" (videoRemoved)="onVideoRemoved()"
|
||||||
></my-video-actions-dropdown>
|
></my-video-actions-dropdown>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -284,23 +284,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
showSupportModal () {
|
showSupportModal () {
|
||||||
// Check video was playing before opening support modal
|
this.supportModal.show()
|
||||||
const isVideoPlaying = this.isPlaying()
|
|
||||||
|
|
||||||
this.pausePlayer()
|
|
||||||
|
|
||||||
const modalRef = this.supportModal.show()
|
|
||||||
|
|
||||||
modalRef.result.then(() => {
|
|
||||||
if (isVideoPlaying) {
|
|
||||||
this.resumePlayer()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
showShareModal () {
|
showShareModal () {
|
||||||
this.pausePlayer()
|
|
||||||
|
|
||||||
this.videoShareModal.show(this.currentTime, this.videoWatchPlaylist.currentPlaylistPosition)
|
this.videoShareModal.show(this.currentTime, this.videoWatchPlaylist.currentPlaylistPosition)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,10 +310,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onModalOpened () {
|
|
||||||
this.pausePlayer()
|
|
||||||
}
|
|
||||||
|
|
||||||
onVideoRemoved () {
|
onVideoRemoved () {
|
||||||
this.redirectService.redirectToHomepage()
|
this.redirectService.redirectToHomepage()
|
||||||
}
|
}
|
||||||
|
@ -884,24 +867,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
return { playerMode: mode, playerOptions: options }
|
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) {
|
private async subscribeToLiveEventsIfNeeded (oldVideo: VideoDetails, newVideo: VideoDetails) {
|
||||||
if (!this.liveVideosSub) {
|
if (!this.liveVideosSub) {
|
||||||
this.liveVideosSub = this.buildLiveEventsSubscription()
|
this.liveVideosSub = this.buildLiveEventsSubscription()
|
||||||
|
|
Loading…
Reference in New Issue