vcs-controller/ui/static/index.js
2024-09-11 01:17:41 +00:00

22 lines
734 B
JavaScript

import { invoke } from "./@tauri-apps/api/index.js";
import { rtc_init } from "./rtc.js";
function call_camera_connect() {
invoke("connect_to_camera", {})
.then(() => {
let cam_button = document.getElementById("camera_connect_button");
cam_button.innerText = "Connecting to Camera";
cam_button.classList.remove("text-semibold");
cam_button.classList.remove("text-white");
cam_button.classList.add("text-neutral-400")
})
.catch((e) => console.error(e));
}
async function init() {
console.log("Setting up");
document.getElementById("camera_connect_button").addEventListener("click", call_camera_connect);
await rtc_init();
}
export { init };