@@ -48,6 +48,22 @@ defmodule ExWebRTC.Recorder do
48
48
{ :upload_complete , S3 . upload_task_ref ( ) , __MODULE__ . Manifest . t ( ) }
49
49
| { :upload_failed , S3 . upload_task_ref ( ) , __MODULE__ . Manifest . t ( ) } }
50
50
51
+ @ typedoc """
52
+ Tuple returned on successful call to `end_tracks/2`.
53
+
54
+ Contains the part of the recording manifest that's relevant to the freshly ended tracks.
55
+ See `t:ExWebRTC.Recorder.Manifest.t/0` for more info.
56
+
57
+ If uploads are configured:
58
+ * Contains the reference to the upload task that was spawned.
59
+ * Recorder will send the `:upload_complete`/`:upload_failed` message with this reference
60
+ to its controlling process when the task finishes.
61
+
62
+ Note that the manifest returned by `end_tracks/2` always contains local paths to files.
63
+ The updated manifest with `s3://` scheme URLs is sent in the aforementioned message.
64
+ """
65
+ @ type end_tracks_ok_result :: { :ok , __MODULE__ . Manifest . t ( ) , S3 . upload_task_ref ( ) | nil }
66
+
51
67
# Necessary to start Recorder under a supervisor using `{Recorder, [recorder_opts, gen_server_opts]}`
52
68
@ doc false
53
69
@ spec child_spec ( list ( ) ) :: Supervisor . child_spec ( )
@@ -126,19 +142,10 @@ defmodule ExWebRTC.Recorder do
126
142
@ doc """
127
143
Finishes the recording for the given tracks and optionally uploads the result files.
128
144
129
- Returns the part of the recording manifest that's relevant to the freshly ended tracks.
130
- See `t:ExWebRTC.Recorder.Manifest.t/0` for more info.
131
-
132
- If uploads are configured:
133
- * Returns the reference to the upload task that was spawned.
134
- * Will send the `:upload_complete`/`:upload_failed` message with this reference
135
- to the controlling process when the task finishes.
136
-
137
- Note that the manifest returned by this function always contains local paths to files.
138
- The updated manifest with `s3://` scheme URLs is sent in the aforementioned message.
145
+ See `t:end_tracks_ok_result/0` for the success typing.
139
146
"""
140
147
@ spec end_tracks ( recorder ( ) , [ MediaStreamTrack . id ( ) ] ) ::
141
- { :ok , __MODULE__ . Manifest . t ( ) , S3 . upload_task_ref ( ) | nil } | { :error , :tracks_not_found }
148
+ end_tracks_ok_result ( ) | { :error , :tracks_not_found }
142
149
def end_tracks ( recorder , track_ids ) do
143
150
GenServer . call ( recorder , { :end_tracks , track_ids } )
144
151
end
0 commit comments