mirror of
https://github.com/imputnet/cobalt.git
synced 2025-12-13 19:55:20 +00:00
Some checks failed
Run tests / check lockfile correctness (push) Has been cancelled
Run tests / web sanity check (push) Has been cancelled
Run tests / api sanity check (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
Run service tests / test service functionality (push) Has been cancelled
Run service tests / test service: ${{ matrix.service }} (push) Has been cancelled
34 lines
877 B
JavaScript
34 lines
877 B
JavaScript
import stream from "./types.js";
|
|
|
|
import { closeResponse } from "./shared.js";
|
|
import { internalStream } from "./internal.js";
|
|
|
|
export default async function(res, streamInfo) {
|
|
try {
|
|
switch (streamInfo.type) {
|
|
case "proxy":
|
|
return await stream.proxy(streamInfo, res);
|
|
|
|
case "internal":
|
|
return await internalStream(streamInfo.data, res);
|
|
|
|
case "merge":
|
|
return await stream.merge(streamInfo, res);
|
|
|
|
case "remux":
|
|
case "mute":
|
|
return await stream.remux(streamInfo, res);
|
|
|
|
case "audio":
|
|
return await stream.convertAudio(streamInfo, res);
|
|
|
|
case "gif":
|
|
return await stream.convertGif(streamInfo, res);
|
|
}
|
|
|
|
closeResponse(res);
|
|
} catch {
|
|
closeResponse(res);
|
|
}
|
|
}
|