Spaces:
Paused
Paused
Download api/src/stream/stream.js from playingapi/cobalt: direct link, hf CLI and curl.
- Browser
- Download file 847 Bytes
-
https://huggingface.co/spaces/playingapi/cobalt/resolve/main/api/src/stream/stream.js
- Command line
-
hf download hf://spaces/playingapi/cobalt/api/src/stream/stream.js
-
curl -L -o stream.js https://huggingface.co/spaces/playingapi/cobalt/resolve/main/api/src/stream/stream.js
847 Bytes
| 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 internalStream(streamInfo.data, res); | |
| case "merge": | |
| return stream.merge(streamInfo, res); | |
| case "remux": | |
| case "mute": | |
| return stream.remux(streamInfo, res); | |
| case "audio": | |
| return stream.convertAudio(streamInfo, res); | |
| case "gif": | |
| return stream.convertGif(streamInfo, res); | |
| } | |
| closeResponse(res); | |
| } catch { | |
| closeResponse(res); | |
| } | |
| } | |