Fix #2200 - Cleaned up manual tests + added media back (#2201)

This commit is contained in:
Andrea Giammarchi
2024-10-01 12:51:31 +02:00
committed by GitHub
parent 386966ebd2
commit 6fab9a1c26
37 changed files with 132 additions and 38 deletions

View File

@@ -1,9 +1,8 @@
from pyodide.ffi import create_proxy
from pyscript import display, document, when, window
from pyweb import media, pydom
from pyscript import display, document, media, when, window
from pyscript.web import page
devicesSelect = pydom["#devices"][0]
video = pydom["video"][0]
devicesSelect = page["#devices"][0]
video = page["video"][0]
devices = {}
@@ -20,7 +19,7 @@ async def list_media_devices(event=None):
async def connect_to_device(e):
"""Connect to the selected device."""
device = devices[devicesSelect.value]
video._js.srcObject = await device.get_stream()
video.srcObject = await device.get_stream()
@when("click", "#snap")