mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-14 04:10:00 +00:00
stream/manage: pass service name to internal stream
This commit is contained in:
parent
5f1dc89c42
commit
ec746f57a7
1 changed files with 9 additions and 2 deletions
|
@ -79,6 +79,7 @@ export function createInternalStream(obj = {}) {
|
|||
const streamID = nanoid();
|
||||
internalStreamCache[streamID] = {
|
||||
url: obj.url,
|
||||
service: obj.service,
|
||||
controller: new AbortController()
|
||||
};
|
||||
|
||||
|
@ -117,10 +118,16 @@ export function verifyStream(id, hmac, exp, secret, iv) {
|
|||
}
|
||||
|
||||
if (typeof streamInfo.originalUrls === 'string') {
|
||||
streamInfo.urls = createInternalStream({ url: streamInfo.originalUrls });
|
||||
streamInfo.urls = createInternalStream({
|
||||
url: streamInfo.originalUrls,
|
||||
...streamInfo
|
||||
});
|
||||
} else if (Array.isArray(streamInfo.originalUrls)) {
|
||||
for (const idx in streamInfo.originalUrls) {
|
||||
streamInfo.originalUrls[idx] = createInternalStream({ url: streamInfo.originalUrls[idx] });
|
||||
streamInfo.originalUrls[idx] = createInternalStream({
|
||||
url: streamInfo.originalUrls[idx],
|
||||
...streamInfo
|
||||
});
|
||||
}
|
||||
} else throw 'invalid urls';
|
||||
|
||||
|
|
Loading…
Reference in a new issue