recit player fadeout bug fix #2240
This commit is contained in:
parent
bf4f4dcc04
commit
af84d7c27c
@ -106,7 +106,7 @@ export default {
|
|||||||
|
|
||||||
// use the paper.view mousemouve to removed mappopup
|
// use the paper.view mousemouve to removed mappopup
|
||||||
this.paper.view.onMouseMove = function(event) {
|
this.paper.view.onMouseMove = function(event) {
|
||||||
console.log("view onMouseMove", event.target);
|
// console.log("view onMouseMove", event.target);
|
||||||
if(event.target._id === "paper-view-0") {
|
if(event.target._id === "paper-view-0") {
|
||||||
this.setHoverElmt(null);
|
this.setHoverElmt(null);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
plyr_options: {
|
plyr_options: {
|
||||||
controls: ['play', 'progress', 'current-time', 'mute', 'volume']
|
controls: ['play', 'progress', 'current-time', 'mute', 'volume']
|
||||||
}
|
},
|
||||||
|
fadeOutInterval: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -27,74 +28,69 @@ export default {
|
|||||||
|
|
||||||
this.recit_plyr_player.volume = 0.6;
|
this.recit_plyr_player.volume = 0.6;
|
||||||
if (this.opened_recit) {
|
if (this.opened_recit) {
|
||||||
this.recit_plyr_player.play();
|
if (!this.fadeOutInterval) {
|
||||||
|
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){
|
this.recitTransition(n,o);
|
||||||
let fadeInterval = setInterval(()=>{
|
|
||||||
if (this.recit_plyr_player.volume > 0.05) {
|
|
||||||
console.log(`recitPlayer fading volume:${this.recit_plyr_player.volume}`);
|
|
||||||
this.recit_plyr_player.volume *= 0.9;
|
|
||||||
}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 = 0.6;
|
|
||||||
this.recit_plyr_player.play();
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
this.recit_plyr_player.volume = 0.6;
|
|
||||||
this.recit_plyr_player.stop();
|
|
||||||
}
|
|
||||||
clearInterval(fadeInterval);
|
|
||||||
}
|
|
||||||
}, 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 = 0.6;
|
|
||||||
this.recit_plyr_player.play();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(ConcernementsStore, ['setOpenedRecit', 'setRecitPlayer']),
|
...mapActions(ConcernementsStore, ['setOpenedRecit', 'setRecitPlayer']),
|
||||||
//
|
recitTransition(n, o){
|
||||||
// onLeave(el, done){
|
|
||||||
// console.log('onLeave', el, done);
|
|
||||||
// setTimeout(() => {
|
if(o){
|
||||||
// console.log('onLeave timeout done', done);
|
this.fadeOutInterval = setInterval(()=>{
|
||||||
// done();
|
if (this.recit_plyr_player.volume > 0.05) {
|
||||||
// }, 5000);
|
// console.log(`recitPlayer fading volume:${this.recit_plyr_player.volume}`);
|
||||||
// }
|
this.recit_plyr_player.volume *= 0.9;
|
||||||
|
}else{
|
||||||
|
this.recit_plyr_player.volume = 0.6;
|
||||||
|
this.recit_plyr_player.stop();
|
||||||
|
clearInterval(this.fadeOutInterval);
|
||||||
|
|
||||||
|
// if during the the fadeout we opened an other recit, play it
|
||||||
|
if (this.opened_recit) {
|
||||||
|
this.recit_plyr_player.source = {
|
||||||
|
type: 'audio',
|
||||||
|
sources: [
|
||||||
|
{
|
||||||
|
src: this.opened_recit.file.url,
|
||||||
|
type: this.opened_recit.file.filemine,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
this.recit_plyr_player.volume = 0.6;
|
||||||
|
this.recit_plyr_player.play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 1);
|
||||||
|
}
|
||||||
|
if (n && !this.fadeOutInterval) { // if new and we are not in in a fadeout
|
||||||
|
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 = 0.6;
|
||||||
|
this.recit_plyr_player.play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user