2022-04-29 22:25:31 +00:00
|
|
|
import { createSession } from "./watch-session.mjs?v=bfdcf2";
|
2021-11-11 17:26:30 +00:00
|
|
|
|
|
|
|
export const setupCreateSessionForm = () => {
|
|
|
|
const form = document.querySelector("#create-session-form");
|
|
|
|
const videoUrl = form.querySelector("#create-session-video");
|
|
|
|
const subsUrl = form.querySelector("#create-session-subs");
|
|
|
|
const subsName = form.querySelector("#create-session-subs-name");
|
|
|
|
|
|
|
|
form.addEventListener("submit", (event) => {
|
|
|
|
event.preventDefault();
|
|
|
|
|
|
|
|
let subs = [];
|
|
|
|
if (subsUrl.value) {
|
|
|
|
subs.push({ url: subsUrl.value, name: subsName.value || "default" });
|
|
|
|
}
|
|
|
|
createSession(videoUrl.value, subs);
|
|
|
|
});
|
|
|
|
};
|