boxcast-sdk-tvos
The BoxCast SDK for tvOS/TVML video playback allows you to develop your own tvOS TVML applications to watch content from your BoxCast account.
The SDK provides a set of Promise-based methods for querying data from your account and a method of attaching to a native tvOS Player in order to provide viewer analytics back to your BoxCast account.
Installation
npm install boxcast-sdk-tvos --save
Usage
Import the module and initialize constants.
const BoxCastData BoxCastPlayer = ; const YOUR_CHANNEL_ID = ' TODO: fill in from dashboard ';const YOUR_APP_NAME = ' TODO: unique identifier used for analytics ';
List broadcasts that are currently live...
var api = ;api;
... or VOD.
api;
When ready to watch a broadcast, simply initialize a player for the broadcast and call the present
method, which will request the playlist from the BoxCast API and present a native tvOS player if available.
var player = broadcast HOSTNAME: YOUR_APP_NAME;player ;
The SDK also exposes vendor libraries (Bluebird Promise polyfill, fetch polyfill) for your use as needed.
const vendor = ;const Promise fetch = vendor;
Known Limitations
- This SDK is for viewing and querying of broadcasts on accounts that do not protect their content with pay-per-view ticketing, host restrictions, geoblocking, passwords, or other authentication means. The BoxCast API will reject requests for such content, so you should be prepared to handle errors using the
.catch((err) => { ... })
method of the data promises.
Changelog
- v1.0.0: Initial version
- v1.1.0: Add shortcut for initializing Player for broadcast with metrics service already attached
- v1.1.3: Fix build so modules can be imported properly into TVML runtime