推送通知声音在 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>
答案 0 :(得分:0)