Skip to content

Commit

Permalink
feat: 브라우저 Audio permission 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellol77 committed Aug 27, 2024
1 parent a12a658 commit 77cc6af
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions frontend/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ import Input from "./components/input";
import Menu from "./components/menu/menu";
import MenuController from "./controller/menuController";

window.onload = function () {
navigator.mediaDevices
.getUserMedia({ audio: true })
.then(() => {
AudioContext = window.AudioContext || window.webkitAudioContext;
audioContext = new AudioContext();
})
.catch((e) => {
console.error(`Audio permissions denied: ${e}`);
});
};

class App {
constructor() {
this.body = document.querySelector("body");
Expand Down

0 comments on commit 77cc6af

Please sign in to comment.