fixed recit player transition #2183
This commit is contained in:
parent
c9b226f649
commit
0507cfcdcb
@ -443,6 +443,9 @@ body{
|
|||||||
// border: #fff 1px solid;
|
// border: #fff 1px solid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&:not(.visible){
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#map-popup{
|
#map-popup{
|
||||||
|
@ -181,7 +181,8 @@ export default {
|
|||||||
...mapActions(ConcernementsStore,['openCloseConcernements',
|
...mapActions(ConcernementsStore,['openCloseConcernements',
|
||||||
'hideShowConcernement',
|
'hideShowConcernement',
|
||||||
'setBesoinPaperId',
|
'setBesoinPaperId',
|
||||||
'setOpenedDoleanceField']),
|
'setOpenedDoleanceField',
|
||||||
|
'setOpenedRecit']),
|
||||||
|
|
||||||
// getResponsiveRay(){
|
// getResponsiveRay(){
|
||||||
// return Math.min(this.canvas.width, this.canvas.height) * 0.08;
|
// return Math.min(this.canvas.width, this.canvas.height) * 0.08;
|
||||||
@ -1356,6 +1357,8 @@ export default {
|
|||||||
|
|
||||||
this.handlePaperVisibilityOnBeforeClose();
|
this.handlePaperVisibilityOnBeforeClose();
|
||||||
|
|
||||||
|
// this.setOpenedRecit(null);
|
||||||
|
|
||||||
this.tween = new Tween.Tween({s: this.scale, o: 1})
|
this.tween = new Tween.Tween({s: this.scale, o: 1})
|
||||||
.to({s: 1, o: 0}, 500)
|
.to({s: 1, o: 0}, 500)
|
||||||
.onUpdate((obj) => {
|
.onUpdate((obj) => {
|
||||||
|
@ -1058,7 +1058,7 @@ export default {
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<RecitPlayer v-if="opened_recit" />
|
<RecitPlayer />
|
||||||
<ConcernementMapPopup
|
<ConcernementMapPopup
|
||||||
v-if="hover_elmt && hover_elmt.type !== 'doleance_step' && !hover_elmt.no_popup"
|
v-if="hover_elmt && hover_elmt.type !== 'doleance_step' && !hover_elmt.no_popup"
|
||||||
:infos="hover_elmt"
|
:infos="hover_elmt"
|
||||||
|
@ -18,24 +18,30 @@ export default {
|
|||||||
// ...mapState(CommonStore,['hover_elmt'])
|
// ...mapState(CommonStore,['hover_elmt'])
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log('RecitPlayer mounted', this.$refs);
|
console.log('RecitPlayer mounted', this.$refs, this.opened_recit);
|
||||||
this.setRecitPlayer(this.$refs.plyr_player.player);
|
this.setRecitPlayer(this.$refs.plyr_player.player);
|
||||||
|
|
||||||
this.recit_plyr_player.on('ended', ()=>{
|
this.recit_plyr_player.on('ended', ()=>{
|
||||||
this.setOpenedRecit(null);
|
this.setOpenedRecit(null);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.recit_plyr_player.volume = 1;
|
||||||
|
if (this.opened_recit) {
|
||||||
this.recit_plyr_player.play();
|
this.recit_plyr_player.play();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
opened_recit: {
|
opened_recit: {
|
||||||
handler (n,o){
|
handler (n,o){
|
||||||
console.log('recitPlayer watch opened_recit o, n', o, n);
|
console.log('recitPlayer watch opened_recit o, n', o, n);
|
||||||
|
if(o){
|
||||||
let fadeInterval = setInterval(()=>{
|
let fadeInterval = setInterval(()=>{
|
||||||
if (this.recit_plyr_player.volume > 0) {
|
if (this.recit_plyr_player.volume > 0.05) {
|
||||||
// console.log(`fading volume:${this.recit_plyr_player.volume}`);
|
console.log(`recitPlayer fading volume:${this.recit_plyr_player.volume}`);
|
||||||
this.recit_plyr_player.volume -= 0.8;
|
this.recit_plyr_player.volume *= 0.9;
|
||||||
}else{
|
}else{
|
||||||
|
if(n){
|
||||||
|
if(n.file.url){
|
||||||
// console.log(`switching source`);
|
// console.log(`switching source`);
|
||||||
this.recit_plyr_player.source = {
|
this.recit_plyr_player.source = {
|
||||||
type: 'audio',
|
type: 'audio',
|
||||||
@ -48,16 +54,47 @@ export default {
|
|||||||
}
|
}
|
||||||
this.recit_plyr_player.volume = 1;
|
this.recit_plyr_player.volume = 1;
|
||||||
this.recit_plyr_player.play();
|
this.recit_plyr_player.play();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.recit_plyr_player.volume = 1;
|
||||||
|
this.recit_plyr_player.stop();
|
||||||
|
}
|
||||||
clearInterval(fadeInterval);
|
clearInterval(fadeInterval);
|
||||||
}
|
}
|
||||||
}, 1);
|
}, 1);
|
||||||
|
} else {
|
||||||
|
if (n) {
|
||||||
|
if(n.file.url){
|
||||||
|
// console.log(`switching source`);
|
||||||
|
this.recit_plyr_player.source = {
|
||||||
|
type: 'audio',
|
||||||
|
sources: [
|
||||||
|
{
|
||||||
|
src: n.file.url,
|
||||||
|
type: n.file.filemine,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
this.recit_plyr_player.volume = 1;
|
||||||
|
this.recit_plyr_player.play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(ConcernementsStore, ['setOpenedRecit', 'setRecitPlayer'])
|
...mapActions(ConcernementsStore, ['setOpenedRecit', 'setRecitPlayer']),
|
||||||
|
//
|
||||||
|
// onLeave(el, done){
|
||||||
|
// console.log('onLeave', el, done);
|
||||||
|
// setTimeout(() => {
|
||||||
|
// console.log('onLeave timeout done', done);
|
||||||
|
// done();
|
||||||
|
// }, 5000);
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -65,13 +102,19 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<!-- <Transition
|
||||||
|
@leave="onLeave"
|
||||||
|
> -->
|
||||||
<aside
|
<aside
|
||||||
|
:class="{visible: opened_recit}"
|
||||||
id="recit-player">
|
id="recit-player">
|
||||||
<vue-plyr ref="plyr_player" :options="plyr_options">
|
<vue-plyr ref="plyr_player" :options="plyr_options">
|
||||||
<audio playsinline>
|
<audio playsinline>
|
||||||
<source :src="opened_recit.file.url" :type="opened_recit.file.filemime" />
|
<source v-if="opened_recit" :src="opened_recit.file.url" :type="opened_recit.file.filemime" />
|
||||||
</audio>
|
</audio>
|
||||||
</vue-plyr>
|
</vue-plyr>
|
||||||
</aside>
|
</aside>
|
||||||
|
<!-- </Transition> -->
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
@ -238,6 +238,8 @@ export const ConcernementsStore = defineStore({
|
|||||||
openCloseConcernements (id) {
|
openCloseConcernements (id) {
|
||||||
console.log(`openCloseConcernements id: ${id}`);
|
console.log(`openCloseConcernements id: ${id}`);
|
||||||
var state;
|
var state;
|
||||||
|
this.opened_concernement = null;
|
||||||
|
this.opened_recit = null;
|
||||||
this.concernements.forEach((c, i) => {
|
this.concernements.forEach((c, i) => {
|
||||||
state = id === c.id;
|
state = id === c.id;
|
||||||
// console.log(`openCloseConcernements foreach id: ${id}, c.id: ${c.id}, state: ${state}`, id, c.id);
|
// console.log(`openCloseConcernements foreach id: ${id}, c.id: ${c.id}, state: ${state}`, id, c.id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user