@@ -86,10 +86,15 @@ defmodule ExWebRTC.Recorder.Converter do
8686 @ type options :: [ option ( ) ]
8787
8888 @ doc """
89- Loads the recording manifest from file, then proceeds with `convert_manifest!/2`.
89+ Converts the saved dumps of tracks in the manifest to WEBM files.
90+
91+ If passed a path as the first argument, loads the recording manifest from file.
9092 """
91- @ spec convert_path! ( Path . t ( ) , options ( ) ) :: __MODULE__ . Manifest . t ( ) | no_return ( )
92- def convert_path! ( recorder_manifest_path , options \\ [ ] ) do
93+ @ spec convert! ( Path . t ( ) | Recorder.Manifest . t ( ) , options ( ) ) ::
94+ __MODULE__ . Manifest . t ( ) | no_return ( )
95+ def convert! ( recorder_manifest_or_path , options \\ [ ] )
96+
97+ def convert! ( recorder_manifest_path , options ) when is_binary ( recorder_manifest_path ) do
9398 recorder_manifest_path =
9499 recorder_manifest_path
95100 |> Path . expand ( )
@@ -106,17 +111,10 @@ defmodule ExWebRTC.Recorder.Converter do
106111 |> Jason . decode! ( )
107112 |> Recorder.Manifest . from_json! ( )
108113
109- convert_manifest !( recorder_manifest , options )
114+ convert !( recorder_manifest , options )
110115 end
111116
112- @ doc """
113- Converts the saved dumps of tracks in the manifest to WEBM files.
114- """
115- @ spec convert_manifest! ( Recorder.Manifest . t ( ) , options ( ) ) ::
116- __MODULE__ . Manifest . t ( ) | no_return ( )
117- def convert_manifest! ( recorder_manifest , options \\ [ ] )
118-
119- def convert_manifest! ( manifest , options ) when map_size ( manifest ) > 0 do
117+ def convert! ( recorder_manifest , options ) when map_size ( recorder_manifest ) > 0 do
120118 thumbnails_ctx =
121119 case Keyword . get ( options , :thumbnails_ctx , nil ) do
122120 nil ->
@@ -143,7 +141,7 @@ defmodule ExWebRTC.Recorder.Converter do
143141 end
144142
145143 output_manifest =
146- manifest
144+ recorder_manifest
147145 |> fetch_remote_files! ( download_path , download_config )
148146 |> do_convert_manifest! ( output_path , thumbnails_ctx )
149147
@@ -170,7 +168,7 @@ defmodule ExWebRTC.Recorder.Converter do
170168 result_manifest
171169 end
172170
173- def convert_manifest !( _empty_manifest , _options ) , do: % { }
171+ def convert !( _empty_manifest , _options ) , do: % { }
174172
175173 defp fetch_remote_files! ( manifest , dl_path , dl_config ) do
176174 Map . new ( manifest , fn { track_id , % { location: location } = track_data } ->
0 commit comments