Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for track subscription permissions #354

Merged
merged 7 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions examples/publish_hue.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,28 @@ async def main(room: rtc.Room):

asyncio.ensure_future(draw_color_cycle(source))

# uncomment the below to test Track Subscription Permissions
# https://docs.livekit.io/home/client/tracks/publish/#subscription-permissions
# await asyncio.sleep(10)

# logging.info(
# "setting track subscription permissions to False, no one can subscribe to the track"
# )
# room.local_participant.set_track_subscription_permissions(allow_all_participants=False)

# await asyncio.sleep(10)

# logging.info("allowing user to subscribe to the track")
# room.local_participant.set_track_subscription_permissions(
# allow_all_participants=False,
# participant_permissions=[
# rtc.ParticipantTrackPermission(
# participant_identity="allowed-user-identity",
# allow_all=True,
# )
# ],
# )


async def draw_color_cycle(source: rtc.VideoSource):
argb_frame = bytearray(WIDTH * HEIGHT * 4)
Expand Down
8 changes: 7 additions & 1 deletion livekit-rtc/livekit/rtc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@
TrackPublishOptions,
VideoEncoding,
)
from ._proto.track_pb2 import StreamState, TrackKind, TrackSource
from ._proto.track_pb2 import (
StreamState,
TrackKind,
TrackSource,
ParticipantTrackPermission,
)
from ._proto.video_frame_pb2 import VideoBufferType, VideoCodec, VideoRotation
from .audio_frame import AudioFrame
from .audio_source import AudioSource
Expand Down Expand Up @@ -97,6 +102,7 @@
"StreamState",
"TrackKind",
"TrackSource",
"ParticipantTrackPermission",
"VideoBufferType",
"VideoRotation",
"stats",
Expand Down
40 changes: 20 additions & 20 deletions livekit-rtc/livekit/rtc/_proto/ffi_pb2.py

Large diffs are not rendered by default.

20 changes: 14 additions & 6 deletions livekit-rtc/livekit/rtc/_proto/ffi_pb2.pyi

Large diffs are not rendered by default.

20 changes: 13 additions & 7 deletions livekit-rtc/livekit/rtc/_proto/track_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions livekit-rtc/livekit/rtc/_proto/track_pb2.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading