Skip to content

Commit 5c1a316

Browse files
committed
Create jupyter.py
1 parent 4c562be commit 5c1a316

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

livekit-rtc/livekit/rtc/jupyter.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import atexit
2+
import contextlib
3+
from IPython.core.display import HTML
4+
from importlib.resources import as_file, files
5+
6+
_resource_stack = contextlib.ExitStack()
7+
atexit.register(_resource_stack.close)
8+
9+
10+
def display_room() -> HTML:
11+
index_path = files("livekit.rtc.resources") / "jupyter-html" / "index.html"
12+
index_path = _resource_stack.enter_context(as_file(index_path))
13+
return HTML(index_path.read_text())

0 commit comments

Comments
 (0)