Skip to main content

OdinPeer

public class OdinPeer: Hashable, ObservableObject

Class to handle ODIN peers.

A peer represents a client that has joined an ODIN room.

Properties

id

public internal(set) var id: UInt64

The ID of the peer.

userId

public internal(set) var userId: String

The user identifier of the peer specified during authentication.

userData

@Published public internal(set) var userData: [UInt8]

A byte array with arbitrary user data attached to the peer.

medias

@Published public internal(set) var medias: [OdinMediaStreamHandle: OdinMedia] = [:]

An array of current medias of the peer.

activeMedias

public var activeMedias: [OdinMediaStreamHandle: OdinMedia]

An array of current active medias of the peer.

Methods

hash(into:)

public func hash(into hasher: inout Hasher)

Hashes the essential components of the peer by feeding them into the given hasher.

==(_:_:)

public static func ==(lhs: OdinPeer, rhs: OdinPeer) -> Bool

Returns a value indicating whether two type-erased hashable instances wrap the same peer.