如何解决推送通知声音在 Chrome 浏览器中不起作用
推送通知声音在 Chrome 浏览器中不起作用。 我知道 order play() 策略已更改。但是如何绕过它并使用通知声音? 我正在使用 Laravel 7 Pictures of chrome browser error
<script>
export default {
props: ["dataAuthUser"],data() {
return {
unreadNotifications: "",// readNotifications: "",user: JSON.parse(this.dataAuthUser),alart: new Audio("/alert/alert.mp3"),};
},created() {
axios
.get("/admin/vue-notify")
.then((res) => {
// console.log(res);
this.unreadNotifications = res.data.unreadNotifications;
// this.readNotifications = res.data.readNotifications;
// this.playSound();
})
.catch((err) => {});
console.error(err);
},mounted() {
Echo.private("App.User." + this.user.id).notification((notification) => {
this.unreadNotifications.unshift(notification);
return this.alart.play();
});
},methods: {},watch: {},};
</script>
解决方法
我认为这种方法会对您有所帮助。First of all click the site information tab of your specific site
then go to the site settings and allow the Sound of that site
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。