From e2eac2a19c87e02e6adc01f98fd30a38cb25ee2d Mon Sep 17 00:00:00 2001 From: Siroco Date: Sat, 31 Oct 2020 20:35:06 +0100 Subject: [PATCH] Fix FullScreen Vimeo Player on Play --- src/app/player.service.ts | 3 +-- src/app/slide/slide.component.ts | 10 ++++++++-- src/assets/playlist.json | 8 ++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/app/player.service.ts b/src/app/player.service.ts index 9cd35c8..41ecaca 100644 --- a/src/app/player.service.ts +++ b/src/app/player.service.ts @@ -84,8 +84,7 @@ export class PlayerService { } playUrl(url,title) { - console.log(title) - console.log(this.audio_title) + //if (title==this.audio_title) this.playList(); this.audio.src = url; diff --git a/src/app/slide/slide.component.ts b/src/app/slide/slide.component.ts index 8eef2f9..9774bf7 100644 --- a/src/app/slide/slide.component.ts +++ b/src/app/slide/slide.component.ts @@ -78,14 +78,20 @@ export class SlideComponent implements OnInit { showVideoVimeo(id:string) { - var options = {loop: false, id: id}; + var options = {loop: false, id: id, responsive: true, autoplay: true}; if (this.videoPlayer && this.getVideoId() != id) { this.videoPlayer = this.videoPlayer.destroy();} + else if ( this.getVideoId() == id ) { this.videoPlayer.requestFullscreen(); } this.videoPlayer = new Player('video-player-content', options); this.showVideo = "flex" - this.videoPlayer.on('play', () => { this._videoID = id}); + this.videoPlayer.on('play', () => { + this._videoID = id; + this.videoPlayer.getFullscreen().then( (f) => { if (!f) { this.videoPlayer.requestFullscreen(); } }); + } + ); this.videoPlayer.on('ended', () => { this.stopVideo(); }); + this.videoPlayer.on('fullscreenchange', (data) => { if (!data.fullscreen) { this.stopVideo(); } }) } stopVideo() { diff --git a/src/assets/playlist.json b/src/assets/playlist.json index 42369b7..5350ea9 100644 --- a/src/assets/playlist.json +++ b/src/assets/playlist.json @@ -1,7 +1,7 @@ { "data" : [ - {"title":"Traktorea", "url":"http://www.soinumapa.net/wp-content/uploads/2020/10/20201017_TRACTOR_ARANDO.mp3"}, - {"title":"Kanpaiak", "url":"http://www.soinumapa.net/wp-content/uploads/2020/10/20201017_BEIRE_CAMPANAS_EDIT.mp3"}, - {"title":"Erlezaintza", "url":"http://www.soinumapa.net/wp-content/uploads/2020/10/20200909_ABEJAS_COMER_APICULTOR_DIA_BEIRE_ARGUEDAS.mp3"}, - {"title":"Uxue Santutegia", "url":"http://www.soinumapa.net/wp-content/uploads/2020/10/20200912_INTERIOR_IGLESIA_PUERTA_UJUE_EDITED.mp3"} + {"title":"Traktorea", "url":"https://www.soinumapa.net/wp-content/uploads/2020/10/20201017_TRACTOR_ARANDO.mp3"}, + {"title":"Kanpaiak", "url":"https://www.soinumapa.net/wp-content/uploads/2020/10/20201017_BEIRE_CAMPANAS_EDIT.mp3"}, + {"title":"Erlezaintza", "url":"https://www.soinumapa.net/wp-content/uploads/2020/10/20200909_ABEJAS_COMER_APICULTOR_DIA_BEIRE_ARGUEDAS.mp3"}, + {"title":"Uxue Santutegia", "url":"https://www.soinumapa.net/wp-content/uploads/2020/10/20200912_INTERIOR_IGLESIA_PUERTA_UJUE_EDITED.mp3"} ] }