Skip to content

Latest commit

 

History

History
 
 

uapi

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

uapi.js

AKA, Unified player API

Simple iframe page writer, used for injecting generated html5 player-page iframes dynamically. Currently supports the following players:

Building

haxe build.hxml

See build.hxml for inline documentatation describing the different steps in the build process.

API documentation


uapi.getPlayers()

Will return an object with all supported players and configuration options, that may be passed to uapi.writePlayer

{
	"dashjs": {
		"drm_server_widevine": {
			"help": "com.widevine.alpha",
			"default_": "[default: CString(https://widevine-proxy.appspot.com/proxy)]"
		},
		"setSegmentOverlapToleranceTime": {
			"help": "Segment overlap tolorance threshold",
			"default_": "[default: CInt(4)]"
		},
		"drm_server_playready": {
			"help": "com.widevine.alpha",
			"default_": "[default: CString(https://playready.directtaps.net/pr/svc/rightsmanager.asmx?PlayRight=1&UseSimpleNonPersistentLicense=1&PlayEnablers=786627D8-C2A6-44BE-8F88-08AE255B01A7)]"
		}
	},
	"shaka": {
		"drm_server_widevine": {
			"help": "com.widevine.alpha",
			"default_": "[default: CString(https://widevine-proxy.appspot.com/proxy)]"
		},
		"setTextTrackVisibility": {
			"help": "Text Tracks visible",
			"default_": "[default: CIdent(true)]"
		},
		"drm_server_playready": {
			"help": "com.widevine.alpha",
			"default_": "[default: CString(https://playready.directtaps.net/pr/svc/rightsmanager.asmx?PlayRight=1&UseSimpleNonPersistentLicense=1&PlayEnablers=786627D8-C2A6-44BE-8F88-08AE255B01A7)]"
		}
	},
	"hasplayer": {
		"drm_server_widevine": {
			"help": "com.widevine.alpha",
			"default_": "[default: CString(https://widevine-proxy.appspot.com/proxy)]"
		},
		"drm_server_playready": {
			"help": "com.widevine.alpha",
			"default_": "[default: CString(https://playready.directtaps.net/pr/svc/rightsmanager.asmx?PlayRight=1&UseSimpleNonPersistentLicense=1&PlayEnablers=786627D8-C2A6-44BE-8F88-08AE255B01A7)]"
		}
	},
	"hlsjs": {
		"drm_server_widevine": {
			"help": "com.widevine.alpha",
			"default_": "[default: CString(https://widevine-proxy.appspot.com/proxy)]"
		}
	}
}

uapi.writePlayer(
	parent:js.html.Element, 
	uri:String, 
	player_version_string:String = "dashjs", 
	player_config:Dynamic = null, 
	?inject_head:String = null, 
	?inject_body:String = null):js.Promise<{
		reload:String->String->PlayerOptions->js.Promise<PlayerHandle>,
		frame:js.html.IFrameElement,
		player:Dynamic,
		video:js.html.VideoElement,
		controls_custom:js.html.DivElement
	}>

Writes player to target DOMElement

Adding new player versions

res/players contains json files with the supported versions and paths to each player

use this demo page to generate implementation code examples.