UNPKG

on-codemerge

Version:

A WYSIWYG editor for on-codemerge is a user-friendly interface that allows users to edit and view their code in real time, exactly as it will appear in the final product

25 lines (24 loc) 657 B
import { createInputField as o } from "../../../utils/helpers.mjs"; class n { async selectFile() { return new Promise((i) => { const r = o("file", "Select File", "", () => { var e; const l = ((e = r.files) == null ? void 0 : e[0]) || null; i(l); }); r.accept = "video/*", r.click(); }); } readFileAsDataUrl(i) { return new Promise((r, l) => { const e = new FileReader(); e.onload = () => { typeof e.result == "string" ? r(e.result) : l(new Error("Failed to read file")); }, e.onerror = () => l(e.error), e.readAsDataURL(i); }); } } export { n as VideoUploader };