File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 55import contextlib
66import os
77from IPython .core .display import HTML , JSON
8+ from IPython .display import display
89from importlib .resources import as_file , files
910
1011_resource_stack = contextlib .ExitStack ()
1112atexit .register (_resource_stack .close )
1213
1314
14- def display_room (url : str | None = None , token : str | None = None ) -> HTML :
15+ def room_html (url : str | None = None , token : str | None = None ) -> HTML :
1516 """
1617 Display a LiveKit room in Jupyter or Google Colab.
1718
@@ -56,3 +57,18 @@ def create_join_token():
5657 index_path = _resource_stack .enter_context (as_file (index_path ))
5758
5859 return HTML (index_path .read_text ())
60+
61+
62+ def display_room (url : str | None = None , token : str | None = None ) -> None :
63+ """
64+ Display a LiveKit room in Jupyter or Google Colab.
65+
66+ Args:
67+ url (str | None): The LiveKit room URL. If None, the function attempts
68+ to use the LIVEKIT_JUPYTER_URL environment variable in a local or
69+ Colab environment.
70+ token (str | None): The LiveKit join token. If None, the function
71+ attempts to use the LIVEKIT_JUPYTER_URL environment variable in a
72+ local or Colab environment.
73+ """
74+ display (room_html (url , token ))
You can’t perform that action at this time.
0 commit comments