stremio-addon-sdk icon indicating copy to clipboard operation
stremio-addon-sdk copied to clipboard

Multiple Stream Requests

Open jaruba opened this issue 5 years ago • 0 comments

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] })
    }
})

jaruba avatar Jul 29 '20 15:07 jaruba