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` and the "Record stream?" checkbox ticked,
82
+
the second argument contains the result of calling `ExWebRTC.Recorder.end_tracks/2`.
83
+
See `t:ExWebRTC.Recorder.end_tracks_ok_result/0` for more info.
84
+
* Otherwise, the second argument is `nil` and can be ignored.
85
+
"""
86
+
@typeon_disconnected::(publisher_id::String.t(),
87
+
ExWebRTC.Recorder.end_tracks_ok_result()
88
+
|nil->
89
+
any())
90
+
91
+
@typeon_packet::
77
92
(publisher_id::String.t(),
78
93
packet_type:::audio|:video,
79
94
packet::ExRTP.Packet.t(),
80
95
socket::Phoenix.LiveView.Socket.t()->
81
96
packet::ExRTP.Packet.t())
82
97
83
-
@typet()::struct()
98
+
@typet::struct()
84
99
85
100
defstructid: nil,
86
101
pc: nil,
87
102
streaming?: false,
103
+
record?: false,
88
104
audio_track_id: nil,
89
105
video_track_id: nil,
90
106
on_packet: nil,
91
107
on_connected: nil,
108
+
on_disconnected: nil,
92
109
pubsub: nil,
110
+
recorder: nil,
93
111
ice_servers: nil,
94
112
ice_ip_filter: nil,
95
113
ice_port_range: nil,
@@ -125,8 +143,11 @@ defmodule LiveExWebRTC.Publisher do
125
143
Options:
126
144
* `id` - publisher id. This is typically your user id (if there is users database).
127
145
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.
146
+
* `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.
147
+
* `recorder` - optional `ExWebRTC.Recorder` instance that publisher live view will use for recording the stream.
148
+
See module doc and `t:on_disconnected/0` for more info.
129
149
* `on_connected` - callback called when the underlying peer connection changes its state to the `:connected`. See `t:on_connected/0`.
150
+
* `on_disconnected` - callback called when the underlying peer connection process terminates. See `t:on_disconnected/0`.
130
151
* `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
152
* `ice_servers` - a list of `t:ExWebRTC.PeerConnection.Configuration.ice_server/0`,
0 commit comments