Skip to main content

OdinMedia

public class OdinMedia: Hashable, ObservableObject

Class to handle ODIN media.

A media represents an audio stream that was added to an ODIN room by a peer.

Properties

streamHandle

public internal(set) var streamHandle: OdinMediaStreamHandle

The underlying media stream handle to interact with.

audioNode

public internal(set) var audioNode: AVAudioNode!

The underlying object that supplies/receives audio data on the media stream.

activityStatus

@Published public internal(set) var activityStatus: Bool = false

Indicates for whether or not the media stream is sending/receiving data.

id

public var id: UInt16

The ID of the media stream.

peerId

public var peerId: UInt64

The ID of the peer that owns the media stream.

Note: This will always be 0 if the media is owned by your own peer.

remote

public var remote: Bool

Indicates whether or not this media is owned by a remote peer.

type

public var type: OdinMediaStreamType

The type of the specified media stream.

Methods

deinit

deinit

Destroys the media stream if necessary.

hash(into:)

public func hash(into hasher: inout Hasher)

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

==(_:_:)

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

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