Answer the question
In order to leave comments, you need to log in
Play audio signal on push notification?
How to make, when displaying push notifications on the site, so that there is an audio signal, such as in VK?
const app = new Vue({
el: '#app',
data: function() {
return {
}
},
mounted(){
window.Echo.private('user_notif')
.listen('UserNotification', (e) => {
console.log(e);
});
},
methods: {
}
});
Answer the question
In order to leave comments, you need to log in
I decided
const app = new Vue({
el: '#app',
data: function() {
return {
}
},
mounted(){
window.Echo.private('user_notif')
.listen('UserNotification', (e) => {
var audio = new Audio('/sounds/push.mp3'); // path to file
audio.play();
console.log(e);
});
},
methods: {
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question