Skip to content

Commit

Permalink
Merge branch 'master' of github.com:boxcast/boxcast-sdk-tvos
Browse files Browse the repository at this point in the history
  • Loading branch information
bikegriffith committed May 12, 2017
2 parents 0f0733f + 18c8eb7 commit 19b021a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# boxcast-sdk-tvos
<a href="https://www.boxcast.com" target="_blank"><img src="https://www.boxcast.com/hs-fs/hub/484866/file-2483746126-png/Logos/NewBoxCastLogo.png?t=1494524438771" height="25"></a>&nbsp;<a href="https://developer.apple.com/go/?id=apple-tv-markup-language-reference" target="_blank"><img src="https://developer.apple.com/library/content/Resources/1260/Images/apple_developer_header_2x.png" height="25"></a>

[![Build Status](https://travis-ci.org/boxcast/boxcast-sdk-tvos.svg?branch=master)](https://travis-ci.org/boxcast/boxcast-sdk-tvos)
[![Build Status](https://travis-ci.org/boxcast/boxcast-sdk-tvos.svg?branch=master)](https://travis-ci.org/boxcast/boxcast-sdk-tvos)&nbsp;[![npm version](https://badge.fury.io/js/boxcast-sdk-tvos.svg)](https://badge.fury.io/js/boxcast-sdk-tvos)

# boxcast-sdk-tvos

The [BoxCast](https://www.boxcast.com) SDK for tvOS/TVML video playback allows you to develop your own tvOS TVML applications to watch content from your BoxCast account.

Expand All @@ -15,16 +16,16 @@ npm install boxcast-sdk-tvos --save

## Usage

Import the module and initialize constants
```
Import the module and initialize constants.
```javascript
import { BoxCastData, BoxCastPlayer } from 'boxcast-sdk-tvos';

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...
```
```javascript
var api = new BoxCastData();
api.getLiveBroadcasts(YOUR_CHANNEL_ID).then((broadcasts) => {
...
Expand All @@ -33,8 +34,8 @@ api.getLiveBroadcasts(YOUR_CHANNEL_ID).then((broadcasts) => {
});
```

... or VOD
```
... or VOD.
```javascript
api.getArchivedBroadcasts(YOUR_CHANNEL_ID).then((broadcasts) => {
...
// for each broadcast in broadcasts, note the
Expand All @@ -44,15 +45,15 @@ api.getArchivedBroadcasts(YOUR_CHANNEL_ID).then((broadcasts) => {

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.
```
```javascript
var player = new BoxCastPlayer(broadcast, {HOSTNAME: YOUR_APP_NAME});
player.present()
.then((tvOSPlayerInstance) => { ... })
.catch((errorMessage) => { ... });
```

The SDK also exposes vendor libraries (Bluebird Promise polyfill, fetch polyfill) for your use as needed.
```
```javascript
import { vendor } from 'boxcast-sdk-tvos';
const { Promise, fetch } = vendor;
```
Expand Down

0 comments on commit 19b021a

Please sign in to comment.