Packages
membrane_rtc_engine
0.14.2
0.25.0
0.24.0
0.23.0
0.22.0
0.21.0
0.20.0
0.19.0
0.18.0
0.17.1
0.17.0
0.16.0
0.15.1
0.15.0
0.14.2
0.14.1
0.14.0
0.13.0
0.12.1
0.12.0
0.11.0
0.10.3
0.10.2
0.10.1
0.10.0
0.9.1
0.9.0
0.8.2
0.8.1
0.8.0
0.7.0
0.6.0
0.5.1
0.5.0
0.4.1
0.4.0
0.3.2
0.3.1
0.3.0
0.2.0
0.1.0
0.1.0-alpha.2
0.1.0-alpha.1
0.1.0-alpha
Membrane RTC Engine and its client library
Current section
Files
Jump to
Current section
Files
lib/membrane_rtc_engine/notifications/track_notification.ex
defmodule Membrane.RTC.Engine.Notifications.TrackNotification do
@moduledoc """
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.
```elixir
notification = %#{inspect(__MODULE__)}{
track_id: "trackID_1",
notification: :hello_world
}
{{:ok, notify: {:publish, notification}}, state}
```
"""
alias Membrane.RTC.Engine.Track
@enforce_keys [:track_id, :notification]
defstruct @enforce_keys
@typedoc """
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
"""
@type t() :: %__MODULE__{
track_id: Track.id(),
notification: term()
}
end