File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -223,3 +223,22 @@ export async function convertAudioToMp3ViaMediaServer(
223223 const arrayBuffer = await response . arrayBuffer ( ) ;
224224 return Buffer . from ( arrayBuffer ) ;
225225}
226+
227+ export async function fetchConvertedVideoViaMediaServer (
228+ videoUrl : string ,
229+ inputExtension ?: string ,
230+ ) : Promise < Response > {
231+ const mediaServerUrl = serverEnv ( ) . MEDIA_SERVER_URL ;
232+ if ( ! mediaServerUrl ) {
233+ throw new Error ( "MEDIA_SERVER_URL is not configured" ) ;
234+ }
235+
236+ return await fetchWithRetry ( `${ mediaServerUrl } /video/convert` , {
237+ method : "POST" ,
238+ headers : { "Content-Type" : "application/json" } ,
239+ body : JSON . stringify ( {
240+ videoUrl,
241+ ...( inputExtension ? { inputExtension } : { } ) ,
242+ } ) ,
243+ } ) ;
244+ }
You can’t perform that action at this time.
0 commit comments