mirror of
https://github.com/kou029w/_.git
synced 2025-01-30 22:08:02 +00:00
fix now.sh → vercel.app
This commit is contained in:
parent
511cedbb3a
commit
03cc81b026
3 changed files with 10 additions and 4 deletions
1
media/.gitignore
vendored
Normal file
1
media/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.vercel
|
|
@ -19,12 +19,17 @@
|
||||||
あるいは、次のSQLをプロファイルディレクトリ以下のpermissions.sqliteファイル
|
あるいは、次のSQLをプロファイルディレクトリ以下のpermissions.sqliteファイル
|
||||||
に対して発行する。
|
に対して発行する。
|
||||||
</p>
|
</p>
|
||||||
<pre>
|
<pre class="sql">
|
||||||
insert into moz_perms (origin, type, permission, expireType, expireTime, modificationTime)
|
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>
|
</pre>
|
||||||
</section>
|
</section>
|
||||||
<script>
|
<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 () => {
|
(async () => {
|
||||||
const devices = (await navigator.mediaDevices.enumerateDevices()).filter(
|
const devices = (await navigator.mediaDevices.enumerateDevices()).filter(
|
||||||
({ kind }) => kind === "videoinput"
|
({ kind }) => kind === "videoinput"
|
||||||
|
@ -42,10 +47,10 @@ insert into moz_perms (origin, type, permission, expireType, expireTime, modific
|
||||||
list.appendChild(a);
|
list.appendChild(a);
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
const play = async deviceId => {
|
const play = async (deviceId) => {
|
||||||
const player = document.getElementById("player");
|
const player = document.getElementById("player");
|
||||||
player.srcObject = await navigator.mediaDevices.getUserMedia({
|
player.srcObject = await navigator.mediaDevices.getUserMedia({
|
||||||
video: { deviceId }
|
video: { deviceId },
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
play(location.hash.slice(1));
|
play(location.hash.slice(1));
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue