View Source Membrane.RTC.Engine.Notifications.TrackNotification (Membrane RTC Engine v0.23.0)

Struct describing a track notification sent to the instance of Membrane.RTC.Engine by Endpoints.

TrackNotification command indicates that the engine should forward a notification about the specified track to all endpoints subscribed to that track. Receivers can choose to ignore the notification.

The same struct will appear in handle_other/3 callback on the receiver side.

Publishing the notification

Endpoint can publish a TrackNotification about any of the tracks it publishes, making the following pattern.

notification = %Membrane.RTC.Engine.Notifications.TrackNotification{
  track_id: "trackID_1",
  notification: :hello_world
}

{{:ok, notify: {:publish, notification}}, state}

Summary

Types

t()

Type describing track notification struct

Types

@type t() :: %Membrane.RTC.Engine.Notifications.TrackNotification{
  notification: term(),
  track_id: Membrane.RTC.Engine.Track.id()
}

Type describing track notification struct

  • track_id - id of the track that this notification is about. This the id of the track that was assigned to the track when publishing it to the engine.
  • notification - payload of the notification. Can be anything