【问题标题】:The pusher notification sound is not working in the Chrome browser推送通知声音在 Chrome 浏览器中不起作用
【发布时间】:2021-03-29 17:08:14
【问题描述】:

推送通知声音在 Chrome 浏览器中不起作用。 我知道 order play() 策略已经改变。但是如何绕过它并使用通知声音? 我正在使用 Laravel 7 Pictures of chrome browser error

Here is my Vue js code

<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>


    

【问题讨论】:

  • 能否请您在帖子中添加代码而不是代码编辑器的Imgae。
  • 我已经添加了vue js代码。请看帖子

标签: javascript php laravel vue.js pusher


【解决方案1】:

【讨论】:

  • 是的。它工作正常,但我需要 JavaScript 绕过通知
猜你喜欢
  • 1970-01-01
  • 2023-04-03
  • 2016-12-26
  • 2012-05-08
  • 1970-01-01
  • 2020-11-10
  • 1970-01-01
  • 2019-02-14
  • 2019-05-28
相关资源
最近更新 更多