Skip to content

Commit

Permalink
USDEV-14
Browse files Browse the repository at this point in the history
  • Loading branch information
nemeseri-ibm committed Jun 22, 2017
1 parent ae26a8a commit 6516737
Show file tree
Hide file tree
Showing 28 changed files with 963 additions and 806 deletions.
16 changes: 8 additions & 8 deletions Overview.md
@@ -1,12 +1,12 @@
# Overview
Ustream allows third-party clients to access Ustream users' resources (data) via a HTTP-based (RESTful) API. It also provides a Broadcaster Library that is capable of broadcasting to a user's channel. Both the REST API and the Broadcaster Library uses the OAuth 2.0 protocol for authentication and authorization.
IBM Cloud Video allows third-party clients to access IBM Cloud Video users' resources (data) via a HTTP-based (RESTful) API. It also provides a Broadcaster Library that is capable of broadcasting to a user's channel. Both the REST API and the Broadcaster Library uses the OAuth 2.0 protocol for authentication and authorization.

## Basic workflow
The basic workflow of a third-party Client is the following:

1. **Authorize the user:** Obtain and validate the user's credentials (username and password). The client must never store these credentials, only pass it to the server for authorization.
2. **Obtain an access token:** If the user's credentials were entered correctly, the third-party client can obtain an access token. Once this token is received, it can be used to access the user's resources until the token expires or the user revokes it on the Ustream website.
3. **Access the user's resources:** The client can use Ustream's REST API or the Ustream Broadcasting Library to access the user's resources (data) or to broadcast to the user's channel. The client authorizes itself using the access token, with methods described by the OAuth 2.0 Protocol Draft.
2. **Obtain an access token:** If the user's credentials were entered correctly, the third-party client can obtain an access token. Once this token is received, it can be used to access the user's resources until the token expires or the user revokes it on the IBM Cloud Video website.
3. **Access the user's resources:** The client can use Ustream's REST API or the IBM Cloud Video Broadcasting Library to access the user's resources (data) or to broadcast to the user's channel. The client authorizes itself using the access token, with methods described by the OAuth 2.0 Protocol Draft.

### Authorization Flows
The OAuth 2.0 protocol provides several flows (workflows) for the first two phases. It depends on the type and architecture of the client which flow is the most suitable. The following flows are supported:
Expand All @@ -15,21 +15,21 @@ The OAuth 2.0 protocol provides several flows (workflows) for the first two phas
* **Authorization code flow:** Suitable for third-party websites which contain a client and a server component. The user enters its credentials to a secure login webpage. After logging in, the browser is redirected to a special URL (defined by the client), passing an authorization code in the URL. The third-party server obtains the access token with another HTTP request in the background, using the authorization code. This method is more secure than the implicit flow if the third-party client has a client+server model. See the OAuth2 Draft for details.

### Endpoints
The webpages and HTTP services invoked in during this authorization process are called Endpoints. Ustream has the following endpoints:
The webpages and HTTP services invoked in during this authorization process are called Endpoints. IBM Cloud Video has the following endpoints:

* **Authorization endpoint:** this is the webpage where the user enters his/her credentials.
* **Token endpoint:** this is the HTTP service where the access token can be obtained in an authorization code flow (when using the implicit flow, the access token can be obtained directly from the authorization endpoint).

### Access tokens
There are two types of access tokens: **Bearer tokens** and **MAC tokens.** They are equivalent in the sense that they can access the same resources on the Ustream REST API. The difference is that while bearer tokens can be only used on encrypted channels (HTTPS), MAC tokens are suitable on non-encrypted channels as well.
There are two types of access tokens: **Bearer tokens** and **MAC tokens.** They are equivalent in the sense that they can access the same resources on the IBM Cloud Video REST API. The difference is that while bearer tokens can be only used on encrypted channels (HTTPS), MAC tokens are suitable on non-encrypted channels as well.

If the client uses the Ustream Broadcasting Library, it must use MAC tokens: the broadcasting is done on the RTMP protocol, which is unencrypted. If the client only uses the REST API, the bearer tokens are preferred because their usage is very simple and lightweight.
If the client uses the IBM Cloud Video Broadcasting Library, it must use MAC tokens: the broadcasting is done on the RTMP protocol, which is unencrypted. If the client only uses the REST API, the bearer tokens are preferred because their usage is very simple and lightweight.

Bearer tokens and MAC tokens can be obtained in the same way: the authorization endpoint has a token type parameter, so the client can specify what kind of token it wants to create.

### Token scopes, expiration
By default, access tokens have a limited lifetime (they expire in a day) and can access only a limited amount of resources. In the authorization process the client can request extra permissions (scopes) from the user to overcome these limitations. These requests are shown to the user on the authorization endpoint. Ustream currently supports the following scopes:
By default, access tokens have a limited lifetime (they expire in a day) and can access only a limited amount of resources. In the authorization process the client can request extra permissions (scopes) from the user to overcome these limitations. These requests are shown to the user on the authorization endpoint. IBM Cloud Video currently supports the following scopes:

* **Offline scope:** If this scope is enabled, the access token never expires.
* **Broadcaster scope:** If this Scope is enabled, the access token can be used for broadcasting with the Ustream Broadcasting Library. This scope are enabled only for MAC tokens.
* **Broadcaster scope:** If this Scope is enabled, the access token can be used for broadcasting with the IBM Cloud Video Broadcasting Library. This scope are enabled only for MAC tokens.

2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
Ustream Enterprise Broadcasting API Documentation
IBM Cloud Video Enterprise Channel API Documentation
=======

http://ustream.github.io/api-docs/
6 changes: 3 additions & 3 deletions _config.yml
@@ -1,11 +1,11 @@
# Name of your blog (this will show up at the top of your page and in the RSS feed)
name: Ustream Developers
name: IBM Cloud Video Developers

# Short description (goes below the title; it will also be used in the RSS feed)
description: Customize and control the viewing experience for your audience or create your own streaming applications with the Ustream open video platform and Application Programming Interfaces (APIs) and Software Development Kits (SDKs).
description: Customize and control the viewing experience for your audience or create your own streaming applications with the IBM Cloud Video open video platform and Application Programming Interfaces (APIs) and Software Development Kits (SDKs).

# Your name, as you want it to appear underneath each post and in the footer
author: Ustream
author: IBM Cloud Video

# Your email if you want it to be linked on the contact page
author_email: admin@ustream.tv
Expand Down
4 changes: 2 additions & 2 deletions _data/categories.yml
@@ -1,5 +1,5 @@
broadcasting-api:
name: Broadcasting API
channel-api:
name: Channel API
player-api:
name: Player API
player-sdk:
Expand Down
16 changes: 12 additions & 4 deletions _includes/footer.html
Expand Up @@ -10,10 +10,7 @@
<div class="row gutter-20">
<div class="bottom column column-12">
<ul class='footer-copy clear'>
<li><span class="copyright">© {{ site.time | date: '%Y' }} Ustream, Inc. an IBM Company. All rights reserved.</span></li>
<li><a class="copyright-policy" href="http://www.ustream.tv/copyright-policy?itm_source=footer_saas&amp;itm_medium=onsite&amp;itm_content=Copyright_policy&amp;itm_campaign=footer">Copyright Policy</a></li>
<li><a class="privacy-policy" href="http://www.ustream.tv/privacy-policy?itm_source=footer_saas&amp;itm_medium=onsite&amp;itm_content=Privacy_policy&amp;itm_campaign=footer">Privacy Policy</a></li>
<li><a class="terms-of-service" href="http://www.ustream.tv/terms?itm_source=footer_saas&amp;itm_medium=onsite&amp;itm_content=Terms_of_service&amp;itm_campaign=footer">Terms of Service</a></li>
<li><span class="copyright">© Copyright IBM Corporation {{ site.time | date: '%Y' }}. Licensed Materials – Property of IBM Corp.</span></li>
</ul>
<ul class='social clear'>
<li><a href='http://www.facebook.com/ustream'><i class="glyphicon icon-facebook"></i></a></li>
Expand All @@ -22,5 +19,16 @@
</ul>
</div>
</div>
<div class="footer__secondary row gutter-20">
<ul>
<li><a href="https://www.ustream.tv/contact-us?itm_source=footer&amp;itm_medium=onsite&amp;itm_content=Contact_us&amp;itm_campaign=contact_us_link">Contact</a></li>
<li><a href="http://www.ibm.com/privacy/us/en/" target="_blank">Privacy</a></li>
<li><a href="http://www.ibm.com/legal/us/en/" target="_blank">Terms of use</a></li>
<li><a href="http://www.ibm.com/accessibility/us/en/" target="_blank">Accessibility</a></li>
<li><a href="https://www.ustream.tv/copyright-policy?itm_source=footer&amp;itm_medium=onsite&amp;itm_content=Copyright_policy&amp;itm_campaign=copyright_policy_link">Copyright Policy</a></li>
<li><a href="https://www.ustream.tv/acceptableusepolicy">Acceptable use policy</a></li>
</ul>

</div>
</div>
</footer>
32 changes: 30 additions & 2 deletions _includes/nav.html
@@ -1,4 +1,32 @@
<nav id="Nav">
<nav>
<div id="upper-header">
<div class="row">
<a href="http://www.ustream.tv/" class="ibm-strip__logo ibm-strip__link">
<svg viewBox="0 0 60 23" width="60px" height="23px" xmlns="http://www.w3.org/2000/svg" fill="#000000" fill-rule="nonzero" stroke="none">
<path d="M0,0 L0,2 L12,2 L12,0 L0,0 Z M13,0 L13,2 L30,2 C29.9999994,2 28.263544,0 25.9636672,0 L13,0 Z M33,0 L33,2 L43,2 L42.4064244,0 L33,0 Z M50.5990135,0 L50,2 L60,2 L60,0 L50.5990135,0 Z M0,3 L0,5 L12,5 L12,3 L0,3 Z M13,3 L13,5 L32,5 C32,5.00000088 31.7780893,3.45853037 31.3910407,3 L13,3 Z M33,3 L33,5 L44,5 L43.4554221,3 L33,3 Z M49.5467565,3 L49,5 L60,5 L60,3 L49.5467565,3 Z M3,6 L3,8 L8,8 L8,6 L3,6 Z M17,6 L17,8 L22,8 L22,6 L17,6 Z M27,6 L27,8 L31.7015252,8 C31.7015257,8 32,6.94379683 32,6 L27,6 Z M36,6 L36,8 L45,8 L44.4001567,6 L36,6 Z M48.5992198,6 L48,8 L57,8 L57,6 L48.5992198,6 Z M3,9 L3,11 L8,11 L8,9 L3,9 Z M17,9 L17,11 L29.6091509,11 C29.6091514,10.9999993 30.6639268,9.97377935 31,9 L17,9 Z M36,9 L36,11 L41.2984915,11 L41.2984915,9.88668534 L41.6348645,11 L51.3405824,11 L51.7015085,9.88668534 L51.7015085,11 L57,11 L57,9 L47.0536651,9 L46.52578,10.694051 L45.9954404,9 L36,9 Z M3,12 L3,14 L8,14 L8,12 L3,12 Z M17,12 L17,14 L31,14 C30.6638542,13.0293938 29.6091509,12 29.6091509,12 L17,12 Z M36,12 L36,14 L41,14 L41,12 L36,12 Z M42,12 L42.676361,14 L50.357328,14 L51,12 L42,12 Z M52,12 L52,14 L57,14 L57,12 L52,12 Z M3,15 L3,17 L8,17 L8,15 L3,15 Z M17,15 L17,17 L22,17 L22,15 L17,15 Z M27,15 L27,17 L32,17 C32.0000011,16.0561377 31.7015252,15 31.7015252,15 L27,15 Z M36,15 L36,17 L41,17 L41,15 L36,15 Z M43,15 L43.7098202,17 L49.284569,17 L50,15 L43,15 Z M52,15 L52,17 L57,17 L57,15 L52,15 Z M0,18 L0,20 L12,20 L12,18 L0,18 Z M13,18 L13,20 L31.3910407,20 C31.7780893,19.5420428 32,18 32,18 L13,18 Z M33,18 L33,20 L41,20 L41,18 L33,18 Z M44,18 L44.8580858,20 L48.1947195,20 L49,18 L44,18 Z M52,18 L52,20 L60,20 L60,18 L52,18 Z M0,21 L0,23 L12,23 L12,21 L0,21 Z M13,21 L13,23 L25.9636672,23 C28.2635433,22.9999985 30,21 30,21 L13,21 Z M33,21 L33,23 L41,23 L41,21 L33,21 Z M45,21 L46.3711157,22.9971619 L46.6069464,23 L48,21 L45,21 Z M52,21 L52,23 L60,23 L60,21 L52,21 Z"></path>
</svg>
</a>
</div>
</div>
<div id="lower-header">
<div class="row">
<a href="http://www.ustream.tv/" class="ibm-strip__link unit-name">IBM Cloud Video</a>

<a class="nav-toggle ibm-strip__link">
<span></span>
</a>

<ul class="nav">
{% for c in site.data.categories %}
<li {% if c[0] == page.category %} class="selected" {% endif %}>
<a href="{{ site.baseurl }}/{{ c[0] }}/" class="ibm-strip__link">{{ c[1].name }}</i></a></li>
{% endfor %}
<li><a href="http://www.ustream.tv/" class="ibm-strip__link">Back to IBM Cloud Video</a></li>
</ul>
</div>
</div>
</nav>
<!-- <nav id="Nav">
<div class="row">
<div class="nav-toggle">
<span class="bar"></span>
Expand All @@ -15,4 +43,4 @@
<li><a href="http://www.ustream.tv">Back to ustream.tv</a></li>
</ul>
</div>
</nav>
</nav> -->
3 changes: 2 additions & 1 deletion _layouts/default.html
Expand Up @@ -22,8 +22,9 @@
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,300' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://static-cdn2.ustream.tv/v5/css/reset.css" type="text/css" media="screen">
<link rel="stylesheet" href="{{site.baseurl}}/css/snorky_46.0.css" type="text/css" media="screen">
<link rel="stylesheet" href="{{site.baseurl}}/css/helvetica-for-ibm.css" type="text/css" media="screen">
<link rel="stylesheet" href="{{site.baseurl}}/css/apidocs.css" type="text/css" media="screen">
<link rel="shortcut icon" href="{{site.baseurl}}/favicon.ico" />
<link rel="shortcut icon" href="{{site.baseurl}}/faviconibm.ico" />
</head>
<body {% if page.id %}id="{{ page.id }}"{% endif %}>
<!-- Google Tag Manager -->
Expand Down
13 changes: 13 additions & 0 deletions _layouts/redirected.html
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<link rel="canonical" href="{{ page.redirect_to }}"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="0;url={{ page.redirect_to }}" />
</head>
<body>
<h1>Redirecting...</h1>
<a href="{{ page.redirect_to }}">Click here if you are not redirected.<a>
<script>location='{{ page.redirect_to }}'</script>
</body>
</html>
12 changes: 6 additions & 6 deletions _posts/2015-09-01-android.html
Expand Up @@ -15,7 +15,7 @@

<section>
<h2>Introduction</h2>
<p>The Ustream Player SDK lets you play Ustream live and recorded videos in your native applications.
<p>The IBM Cloud Video Player SDK lets you play IBM Cloud Video live and recorded videos in your native applications.
Using the native SDK gives you full control over the Player, including a customizable native user interface, callbacks on status changes, and many more.
(Note: if you need none of the above, you may use the HTML-based <a href="https://github.com/ustream/embedapi/blob/master/README.md">Player API</a> instead)</p>
<p>This document describes the basic steps to make a mobile app using the Player SDK for Android.</p>
Expand All @@ -28,7 +28,7 @@ <h3 id="step0-ustreamreq">Account prerequisites</h3>
<p>Before going into details, please note that document assumes the following:</p>
<ul>
<li>you have a registered user at <a href="http://ustream.tv">ustream.tv</a></li>
<li>your Ustream user is entitled to use the Player SDK specifically (if you have questions, please <a href="https://www.ustream.tv/enterprise-video/contact">contact us</a>)</li>
<li>your IBM Cloud Video user is entitled to use the Player SDK specifically (if you have questions, please <a href="https://www.ustream.tv/enterprise-video/contact">contact us</a>)</li>
</ul>
<h3 id="step0-devreq">Development prerequisites</h3>
<h4>IDE</h4>
Expand Down Expand Up @@ -70,12 +70,12 @@ <h4>Import from local repo</h4>

<section>
<h2>Step 4: Register your app at Ustream</h2>
<p>The SDK requires the use of a <em>Ustream API key</em>, which is validated whenever the SDK communicates with Ustream streaming servers.
<p>The SDK requires the use of a <em>IBM Cloud Video API key</em>, which is validated whenever the SDK communicates with IBM Cloud Video streaming servers.
The sample application contains a sample API key which you can use for testing. The sample API key can only be used to play content on the test channel(s) also used in the sample app.</p>
<p>Note: Although there is a provided API key for the sample app's sample content, you still need to register your identifier at Ustream. This will ensure that you can build the sample project using your own certificates.</p>
<p>Before you can start using the Player SDK for playing content from your own channel(s), you will need to:</p>
<ul>
<li>get a valid <strong>Ustream API key</strong> owned by the Ustream user that owns the content you would like to play</li>
<li>get a valid <strong>IBM Cloud Video API key</strong> owned by the IBM Cloud Video user that owns the content you would like to play</li>
<li>register the <strong>application identifier(s)</strong> - of every app in which you will integrate the Player SDK in - at Ustream</li>
</ul>
<p>The application identifier uses:</p>
Expand Down Expand Up @@ -106,7 +106,7 @@ <h4>Obtaining your identifiers</h4>
<p>Lets call the generated file <em>example-debug.key</em>. Now you can encode it using the following command:</p><code>openssl dgst -sha1 -binary example-debug.key | base64</code>
<p><br>Generate the indentifier for your release certificate's public key, and every other debug certificates that your developers will use.</p>

<p>Every time you initialise an instance of the Player Library you have to configure it with your <strong>Ustream API key</strong>. More details on this in the next chapter.</p>
<p>Every time you initialise an instance of the Player Library you have to configure it with your <strong>IBM Cloud Video API key</strong>. More details on this in the next chapter.</p>
</section>

<section>
Expand Down Expand Up @@ -182,7 +182,7 @@ <h4>Changing content</h4>
<section>

<h2>Step 7: Handle Player callbacks</h2>
<p><strong>Note:</strong> Ustream Android player library version: <strong>0.3.0</strong> introduced user facing API changes around the callback system. See the current state of the API below.</p>
<p><strong>Note:</strong> IBM Cloud Video Android player library version: <strong>0.3.0</strong> introduced user facing API changes around the callback system. See the current state of the API below.</p>
<h3 id="step7-stateflow">State flow diagram</h3>
<p>This diagram represents the state flow of the library, the nodes are the states reported by the player, the named edges are events that can be sent to the player. There is a decision in the flow that happens automatically based on the content selected (live or recorded).</p>
<img src="../images/android-state-flow-diagram.png">
Expand Down

0 comments on commit 6516737

Please sign in to comment.