You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Function signature of the `on_disconnected` callback.
80
+
81
+
* If `recorder` was passed to `attach/2`, the second argument contains the result of calling `ExWebRTC.Recorder.end_tracks/2`.
82
+
See `t:ExWebRTC.Recorder.end_tracks_ok_result/0` for more info.
83
+
* Otherwise, the second argument is `nil` and can be ignored.
84
+
"""
85
+
@typeon_disconnected::(publisher_id::String.t(),
86
+
ExWebRTC.Recorder.end_tracks_ok_result()
87
+
|nil->
88
+
any())
89
+
90
+
@typeon_packet::
77
91
(publisher_id::String.t(),
78
92
packet_type:::audio|:video,
79
93
packet::ExRTP.Packet.t(),
80
94
socket::Phoenix.LiveView.Socket.t()->
81
95
packet::ExRTP.Packet.t())
82
96
83
-
@typet()::struct()
97
+
@typet::struct()
84
98
85
99
defstructid: nil,
86
100
pc: nil,
87
101
streaming?: false,
102
+
record?: false,
88
103
audio_track_id: nil,
89
104
video_track_id: nil,
90
105
on_packet: nil,
91
106
on_connected: nil,
107
+
on_disconnected: nil,
92
108
pubsub: nil,
109
+
recorder: nil,
93
110
ice_servers: nil,
94
111
ice_ip_filter: nil,
95
112
ice_port_range: nil,
@@ -125,8 +142,11 @@ defmodule LiveExWebRTC.Publisher do
125
142
Options:
126
143
* `id` - publisher id. This is typically your user id (if there is users database).
127
144
It is used to identify live view and generated HTML elements.
128
-
* `pubsub` - a pubsub that publisher live view will use for broadcasting audio and video packets received from a browser. See module doc for more.
145
+
* `pubsub` - a pubsub that publisher live view will use for broadcasting audio and video packets received from a browser. See module doc for more info.
146
+
* `recorder` - optional `ExWebRTC.Recorder` instance that publisher live view will use for recording the stream.
147
+
See module doc and `t:on_disconnected/0` for more info.
129
148
* `on_connected` - callback called when the underlying peer connection changes its state to the `:connected`. See `t:on_connected/0`.
149
+
* `on_disconnected` - callback called when the underlying peer connection process terminates. See `t:on_disconnected/0`.
130
150
* `on_packet` - callback called for each audio and video RTP packet. Can be used to modify the packet before publishing it on a pubsub. See `t:on_packet/0`.
131
151
* `ice_servers` - a list of `t:ExWebRTC.PeerConnection.Configuration.ice_server/0`,
0 commit comments