From 034ca059935297de4c60da65c12d982546162720 Mon Sep 17 00:00:00 2001 From: Mike Griffith Date: Thu, 11 May 2017 19:48:46 -0400 Subject: [PATCH 1/2] add npm badge --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e23419..8081f92 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # boxcast-sdk-tvos +   -[![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) [![npm version](https://badge.fury.io/js/boxcast-sdk-tvos.svg)](https://badge.fury.io/js/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. From 18c8eb7c13fe97ea1f2c7fc7a0dfbae65b8bf006 Mon Sep 17 00:00:00 2001 From: Mike Griffith Date: Thu, 11 May 2017 19:52:38 -0400 Subject: [PATCH 2/2] Update README.md --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8081f92..e827552 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# boxcast-sdk-tvos -   [![Build Status](https://travis-ci.org/boxcast/boxcast-sdk-tvos.svg?branch=master)](https://travis-ci.org/boxcast/boxcast-sdk-tvos) [![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. The SDK provides a set of [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)-based methods for querying data from your account and a method of attaching to a native [tvOS Player](https://developer.apple.com/reference/tvmljs/player) in order to provide viewer analytics back to your BoxCast account. @@ -16,8 +16,8 @@ npm install boxcast-sdk-tvos --save ## Usage -Import the module and initialize constants -``` +Import the module and initialize constants. +```javascript import { BoxCastData, BoxCastPlayerMetrics } from 'boxcast-sdk-tvos'; const YOUR_CHANNEL_ID = ' TODO: fill in from dashboard '; @@ -25,7 +25,7 @@ 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) => { ... @@ -34,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 @@ -44,7 +44,7 @@ api.getArchivedBroadcasts(YOUR_CHANNEL_ID).then((broadcasts) => { ``` When ready to watch a broadcast, grab the "view" that will contain a playlist for live or on-demand content. Note: the `view.playlist` will not exist for future content or for broadcasts that were missed. -``` +```javascript api.getBroadcastView(broadcast.id).then((view) => { var player = new Player(), playlist = new Playlist(), @@ -60,7 +60,7 @@ api.getBroadcastView(broadcast.id).then((view) => { ``` 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; ```