stremio-addon-sdk
stremio-addon-sdk copied to clipboard
Multiple Stream Requests
Scenario: your addon needs to fetch from a lot of sources, so it needs to wait for all of them to reply so it can respond to a stream request
Solution: Stremio does multiple stream requests to the same addon
Proposed SDK solution:
/manifest.json:
{
...
"sources": ['first','second']
...
}
/stream/{type}/{videoID}/{source}.json:
builder.defineStreamHandler(function(args) {
if (args.source == 'first') {
// serve one stream to big buck bunny
const stream = { url: 'http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4' }
return Promise.resolve({ streams: [stream] })
}
})