-
Notifications
You must be signed in to change notification settings - Fork 46
Integration
Dag Wieers edited this page Aug 28, 2019
·
11 revisions
Below is an example of how to integrate InputStream Helper in your add-on.
import sys
import xbmcgui
import xbmcplugin
import inputstreamhelper
PROTOCOL = 'mpd'
DRM = 'com.widevine.alpha'
STREAM_URL = 'https://demo.unified-streaming.com/video/tears-of-steel/tears-of-steel-dash-widevine.ism/.mpd'
LICENSE_URL = 'https://cwip-shaka-proxy.appspot.com/no_auth'
def play():
is_helper = inputstreamhelper.Helper(PROTOCOL, drm=DRM)
if is_helper.check_inputstream():
playitem = xbmcgui.ListItem(path=STREAM_URL)
playitem.setProperty('inputstreamaddon', is_helper.inputstream_addon)
playitem.setProperty('inputstream.adaptive.manifest_type', PROTOCOL)
playitem.setProperty('inputstream.adaptive.license_type', DRM)
playitem.setProperty('inputstream.adaptive.license_key', LICENSE_URL + '||R{SSM}|')
xbmcplugin.setResolvedUrl(handle=sys.argv[1], succeeded=True, listitem=play_item)
if __name__ == '__main__':
play()
The Helper class takes two arguments: protocol (the media streaming protocol) and the optional argument 'drm'.
It is recommended to not add your InputStream add-on as a dependency in addon.xml. It can cause confusion with users not being able to install your add-on because the InputStream add-on is disabled. InputStream Helper addresses issues such as these and helps the user to install/enable required InputStream components.
- mpd -- MPEG-DASH
- ism -- Microsoft Smooth Streaming
- hls -- HTTP Live Streaming from Apple
- rtmp -- Real-Time Messaging Protocol
- widevine
- com.widevine.alpha
Feel free to add to or improve this Wiki space. Questions can be asked by opening an issue.