Skip to content

Commit

Permalink
fix: e2ee demo (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
theomonnom authored Oct 29, 2023
1 parent 531052d commit bdd5c80
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/e2ee.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE5MDY2MTMyODgsImlzcyI6IkFQSVRzRWZpZFpqclFvWSIsIm5hbWUiOiJuYXRpdmUiLCJuYmYiOjE2NzI2MTMyODgsInN1YiI6Im5hdGl2ZSIsInZpZGVvIjp7InJvb20iOiJ0ZXN0Iiwicm9vbUFkbWluIjp0cnVlLCJyb29tQ3JlYXRlIjp0cnVlLCJyb29tSm9pbiI6dHJ1ZSwicm9vbUxpc3QiOnRydWV9fQ.uSNIangMRu8jZD5mnRYoCHjcsQWCrJXgHCs0aNIgBFY" # noqa

# ("livekitrocks") this is our shared key, it must match the one used by your clients
SHARED_KEY = b"liveitrocks"
SHARED_KEY = b"livekitrocks"


async def draw_cube(source: rtc.VideoSource):
Expand Down Expand Up @@ -45,8 +45,8 @@ async def draw_cube(source: rtc.VideoSource):
[3, 7],
]

frame = rtc.ArgbFrame(rtc.VideoFormatType.FORMAT_ARGB, W, H)
arr = np.ctypeslib.as_array(frame.data)
frame = rtc.ArgbFrame.create(rtc.VideoFormatType.FORMAT_ARGB, W, H)
arr = np.frombuffer(frame.data, dtype=np.uint8)
angle = 0

while True:
Expand Down Expand Up @@ -95,7 +95,7 @@ async def draw_cube(source: rtc.VideoSource):


async def main(room: rtc.Room):
@room.listens_to("e2ee_state_changed")
@room.on("e2ee_state_changed")
def on_e2ee_state_changed(
participant: rtc.Participant, state: rtc.EncryptionState
) -> None:
Expand Down

0 comments on commit bdd5c80

Please sign in to comment.