************************************ movianDRM plugin example: drmTEST plugin: https://movian.eu/repo/drmTEST.zip ************************************ Here is some basic information on how you can call movianDRM from a plugin - for a single or multiple/playlist titles: First it is a good thing to subscribe to two properties to get information into your plugin if movianDRM is installed and about the subtitle formatting: var movianDRM = -1; /* -1=No information/Not Android, 0=Not installed, 1=Installed */ prop.subscribeValue(prop.global.androidTV.movianDRM, function(value) { if(typeof value === 'number') { movianDRM = value; } }); var subtitle_format = "default"; /* default nobox android custom18-aaaaaa000000bf0064 */ prop.subscribeValue(prop.global.androidTV.subtitle_format, function(value) { if(typeof value === 'string') { subtitle_format = value; } }); You can see the information in the log file during Movian startup: 00:00:00.071: movianDRM [DEBUG]:Movian DRM Installed: Yes 00:00:00.071: movianDRM [DEBUG]:Subtitle Format: custom18-aaaaaa000000bf0064 The subtitle format contains 4 values, prefixed with "custom18-" - as in the example above: text-color(6)/outline-color(6)/box-opacity%(2)/size%(4) (size=30-500% -> 001e-01f4) custom18-aaaaaa000000bf0064 custom18-aaaaaa 000000 bf 0064 text-color : aaaaaa outline-color : 000000 bounding-box : bf (00-ff = 0-100%, bf = 75% (75/100*255=191(dec)=bf(hex))) subtitle-size : 0064 (0064 hex = 100% dec) The old way of calling movianDRM by putting all data in the :: separated fields (supports only one video-title): page.redirect("movianDRM:dash:"+url+"::"+encodeURIComponent(title)+"::::sub_title="+encodeURIComponent(description)+"::::artwork_uri="+encodeURIComponent(icon)+"::::subtitle_formatting=custom18-aaaaaa000000bf0064::close"); The supported fields are: ::title= (This is the main title) ::sub_title= (This is the description text under the title) ::artwork_uri= (URL/https link to an image/icon to show to the left of the description) ::subtitle_formatting= (can be default nobox android custom18-xxxx as described above) ::close A better way to call movianDRM for single/multiple video-titles is to use a json string. var mDRM = []; // You can push multiple definitions mDRM.push({ uri: 'https://address_of_the_video', name: encodeURIComponent(title), sub_title: encodeURIComponent(description.substr(0, 512)), artwork_uri: encodeURIComponent('https://address_of_the_icon') }); page.redirect('movianDRM:dash:'+encodeURIComponent('json://'+JSON.stringify(mDRM))+'::::title=Playlist::::subtitle_formatting=default::::sub_title=SubTitle::close'); You can use movianDRM:dash: or movianDRM:hls: page routes. ************************************ Calling movianDRM with custom headers and complete configuration: Requires movianDRM 5.1.752 or later and Movian 5.0.752 or later. /* headers: array object to push headers to scope: all - headers added to all HTTP requests drm - headers added only to license requests clr - headers added only to non-drm requests name: header name value: header value */ function add_header(headers, scope, name, value) { if(!name || !value) return headers; var suffix; if(scope == "drm" || scope == "clr") suffix = "_" + scope; else suffix = ""; var tmp = {}; tmp["hdr" + suffix] = name; tmp["val" + suffix] = value; headers.push(tmp); return headers; } var mDRM = []; var headers = []; // the following header names and values are just EXAMPLES // you can add as many headers as you need with whatever names/values you decide // next two headers only for DRM/key session headers = add_header(headers, "drm", "X-Custom-drm-1", "Value 1-drm"); headers = add_header(headers, "drm", "X-Custom-drm-2", "Value 2-drm"); // next two headers only for clear/non-DRM requests headers = add_header(headers, "clr", "X-Custom-clr-1", "Value 1-clr"); headers = add_header(headers, "clr", "X-Custom-clr-2", "Value 2-clr"); // next four headers are used all the time headers = add_header(headers, "all", "X-Custom-all-1", "Value 1-all"); headers = add_header(headers, "all", "X-Custom-all-2", "Value 2-all"); headers = add_header(headers, "all", "User-Agent", "customUA/1.0.0"); headers = add_header(headers, "all", "Cookie", "customCookie=mDRM_cookie"); // First entry in mDRM object should be the headers (optional) mDRM.push({ headers: JSON.stringify(headers) }); // Add one or more media definitions // [uri] field is mandatory, all other fields are optional mDRM.push({ uri: 'https://address_of_the_video_manifest', canonical_url: 'myplugin:video:some_id', // if present DRM7 will update M7 with playback progress name: encodeURIComponent(title), sub_title: encodeURIComponent(description.substr(0, 512)), artwork_uri: encodeURIComponent('https://address_of_the_icon'), extension: 'mpd', // mpd or m3u8 mime_type: 'application/dash+xml', // application/dash+xml or application/x-mpegURL drm_scheme: 'widevine', // DRM scheme if protected (widevine, playready, clearkey) drm_license_uri: 'https://drm_license_uri', }); page.redirect('movianDRM:dash:'+encodeURIComponent('json://'+JSON.stringify(mDRM))+'::close'); ************************************