mirror of
https://github.com/imputnet/cobalt.git
synced 2025-01-06 15:16:06 +00:00
stream/manage: pass service name to internal stream
This commit is contained in:
parent
5f1dc89c42
commit
ec746f57a7
|
@ -79,6 +79,7 @@ export function createInternalStream(obj = {}) {
|
||||||
const streamID = nanoid();
|
const streamID = nanoid();
|
||||||
internalStreamCache[streamID] = {
|
internalStreamCache[streamID] = {
|
||||||
url: obj.url,
|
url: obj.url,
|
||||||
|
service: obj.service,
|
||||||
controller: new AbortController()
|
controller: new AbortController()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -117,10 +118,16 @@ export function verifyStream(id, hmac, exp, secret, iv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof streamInfo.originalUrls === 'string') {
|
if (typeof streamInfo.originalUrls === 'string') {
|
||||||
streamInfo.urls = createInternalStream({ url: streamInfo.originalUrls });
|
streamInfo.urls = createInternalStream({
|
||||||
|
url: streamInfo.originalUrls,
|
||||||
|
...streamInfo
|
||||||
|
});
|
||||||
} else if (Array.isArray(streamInfo.originalUrls)) {
|
} else if (Array.isArray(streamInfo.originalUrls)) {
|
||||||
for (const idx in 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';
|
} else throw 'invalid urls';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue