File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 11import atexit
22import contextlib
3+ import os
34from IPython .core .display import HTML
45from importlib .resources import as_file , files
56
89
910
1011def display_room () -> HTML :
12+ try :
13+ from google .colab import secrets
14+
15+ LIVEKIT_JUPYTER_URL = secrets .get ("LIVEKIT_JUPYTER_URL" )
16+ except ImportError :
17+ LIVEKIT_JUPYTER_URL = os .environ .get ("LIVEKIT_JUPYTER_URL" )
18+
19+ if not LIVEKIT_JUPYTER_URL :
20+ raise ValueError (
21+ "LIVEKIT_JUPYTER_URL must be set via Google Colab secrets or as an environment variable."
22+ )
23+
1124 index_path = files ("livekit.rtc.resources" ) / "jupyter-html" / "index.html"
1225 index_path = _resource_stack .enter_context (as_file (index_path ))
13- return HTML (index_path .read_text ())
26+ html_text = index_path .read_text ()
27+
28+ return HTML (html_text )
You can’t perform that action at this time.
0 commit comments