1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-30 13:58:08 +00:00

fix now.sh → vercel.app

This commit is contained in:
Nebel 2021-07-07 10:17:04 +09:00
parent 511cedbb3a
commit 03cc81b026
3 changed files with 10 additions and 4 deletions

1
media/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.vercel

View file

@ -19,12 +19,17 @@
あるいは、次のSQLをプロファイルディレクトリ以下のpermissions.sqliteファイル
に対して発行する。
</p>
<pre>
<pre class="sql">
insert into moz_perms (origin, type, permission, expireType, expireTime, modificationTime)
values ("https://media-example.kou029w.now.sh", "camera", 1, 0, 0, 0);
values ("https://media-example.kou029w.vercel.app", "camera", 1, 0, 0, 0);
</pre>
</section>
<script>
const sql = `insert into moz_perms (origin, type, permission, expireType, expireTime, modificationTime)
values ("${window.location.origin}", "camera", 1, 0, 0, 0);`;
const sqlDisplay = document.querySelector(".sql");
if (sqlDisplay) sqlDisplay.textContent = sql;
(async () => {
const devices = (await navigator.mediaDevices.enumerateDevices()).filter(
({ kind }) => kind === "videoinput"
@ -42,10 +47,10 @@ insert into moz_perms (origin, type, permission, expireType, expireTime, modific
list.appendChild(a);
});
})();
const play = async deviceId => {
const play = async (deviceId) => {
const player = document.getElementById("player");
player.srcObject = await navigator.mediaDevices.getUserMedia({
video: { deviceId }
video: { deviceId },
});
};
play(location.hash.slice(1));

Binary file not shown.