From 4f10e7cfcc3a66c143841bbdaa2b6863b72ec9de Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 9 Mar 2022 21:53:51 +0100 Subject: [PATCH] [DEBUG] correct buttom play and fullscreen (add auto fullscreen --- front/src/app/scene/video/video.ts | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/front/src/app/scene/video/video.ts b/front/src/app/scene/video/video.ts index 5c995af..b9def2d 100644 --- a/front/src/app/scene/video/video.ts +++ b/front/src/app/scene/video/video.ts @@ -305,12 +305,18 @@ export class VideoScene implements OnInit { this.startHideTimer(); this.playVideo = false; this.displayVolumeMenu = false; + /* + if(this.isFullScreen == true) { + this.isFullScreen = false; + } + */ } - //https://www.w3schools.com/tags/ref_av_dom.asp - changeStateToPlay() { this.isPlaying = true; + if (this.isFullScreen === true) { + this.onFullscreen(); + } } changeStateToPause() { this.isPlaying = false; @@ -339,14 +345,14 @@ export class VideoScene implements OnInit { return out; } - changeTimeupdate(currentTime:any) { + changeTimeupdate(currentTime: any) { //console.log("time change "); //console.log(" ==> " + this.videoPlayer.currentTime); this.currentTime = this.videoPlayer.currentTime; this.currentTimeDisplay = this.convertIndisplayTime(this.currentTime); //console.log(" ==> " + this.currentTimeDisplay); } - changeDurationchange(duration:any) { + changeDurationchange(duration: any) { console.log("duration change "); console.log(" ==> " + this.videoPlayer.duration); this.duration = this.videoPlayer.duration; @@ -373,19 +379,15 @@ export class VideoScene implements OnInit { console.log("error element: " + this.videoPlayer); return; } + this.videoPlayer.pause(); } + onPauseToggle() { - console.log("pause toggle"); - this.startHideTimer(); - if (this.videoPlayer === null - || this.videoPlayer === undefined) { - console.log("error element: " + this.videoPlayer); - return; - } + console.log("pause toggle ..."); if (this.isPlaying == true) { - this.videoPlayer.pause(); + this.onPause(); } else { - this.videoPlayer.play(); + this.onPlay(); } }