Livekitex.Grants.VideoGrant (livekitex v0.1.0)

Video-related permissions for LiveKit access tokens.

Summary

Functions

Creates a VideoGrant from a map/hash.

Creates a new VideoGrant with the specified permissions.

Converts a VideoGrant to a map for JWT encoding.

Types

t()

@type t() :: %Livekitex.Grants.VideoGrant{
  can_publish: boolean() | nil,
  can_publish_data: boolean() | nil,
  can_publish_sources: list() | nil,
  can_subscribe: boolean() | nil,
  can_update_own_metadata: boolean() | nil,
  hidden: boolean() | nil,
  ingress_admin: boolean() | nil,
  recorder: boolean() | nil,
  room: String.t() | nil,
  room_admin: boolean() | nil,
  room_create: boolean() | nil,
  room_join: boolean() | nil,
  room_list: boolean() | nil,
  room_record: boolean() | nil
}

Functions

from_map(map)

Creates a VideoGrant from a map/hash.

new(opts \\ [])

Creates a new VideoGrant with the specified permissions.

Parameters

  • opts: A keyword list of video permissions.

Examples

iex> Livekitex.Grants.VideoGrant.new(room_join: true, can_publish: true)
%Livekitex.Grants.VideoGrant{room_join: true, can_publish: true}

to_map(grant)

Converts a VideoGrant to a map for JWT encoding.