Moved portAdded support for rear and front camera
This commit is contained in:
parent
8af2650aca
commit
e854cdf234
@ -8,14 +8,27 @@
|
||||
</head>
|
||||
<body>
|
||||
<h1>LOLED</h1>
|
||||
<button id="stream-camera">Use your Camera</button>
|
||||
<button id="stream-camera">Use rear Camera</button>
|
||||
<button id="stream-front-camera">Use front Camera</button>
|
||||
<script type="module">
|
||||
import {connectSomeStream} from "/js/rtc.js"
|
||||
|
||||
document.getElementById("stream-camera")
|
||||
.addEventListener("click", async () => {
|
||||
let stream = await navigator.mediaDevices.getUserMedia({
|
||||
video: true
|
||||
video: {
|
||||
facingMode: 'environment'
|
||||
}
|
||||
})
|
||||
await connectSomeStream(stream)
|
||||
})
|
||||
|
||||
document.getElementById("stream-front-camera")
|
||||
.addEventListener("click", async () => {
|
||||
let stream = await navigator.mediaDevices.getUserMedia({
|
||||
video: {
|
||||
facingMode: 'user'
|
||||
}
|
||||
})
|
||||
await connectSomeStream(stream)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user