入門
Brightcoveの再生認証サービス (PAS) は、DRM で保護された HTTP ライブストリーミング暗号化 (HLSE) コンテンツでダイナミック配信を使用する場合に、さらに高度なセキュリティを提供します。
PAS では、ライセンス要求は署名付き JSON Web トークン (JWT) を使用して認証されます。
ビデオがプレーヤーにロードされ、ソースが選択されると、ビデオライセンスを要求するときに使用されます。
PASの詳細については、概要:再生認証サービス付きDRM ドキュメント。
Androidの実装
Android用のネイティブSDKは現在、HLSeおよびWidevineDASHソースのPASをサポートしています。単一のビデオまたはプレイリストに対するBrightcoveカタログリクエストの一部として認証トークンを提供します。
PASを使用してBrightcoveカタログ要求を行うには、次の手順に従います。
- 
        
作成する
HttpRequestConfigオブジェクトを作成し、次のようにBrightcove認証トークンを設定します。HttpRequestConfig httpRequestConfig = new HttpRequestConfig.Builder() .setBrightcoveAuthorizationToken(myToken) .build();Authorizationトークンの値は、JSONWebトークンの値になります。
 - 
        
作成したら
HttpRequestConfigオブジェクトの場合、次のいずれかのカタログメソッドに渡すことができます。ビデオリクエストの場合は、次のいずれかを使用します。
findVideoByID(String, HttpRequestConfig, VideoListener)findVideoByReferenceID(String, HttpRequestConfig, VideoListener)プレイリストリクエストの場合は、次のいずれかを使用します。
findPlaylistByID(String, HttpRequestConfig, PlaylistListener)findPlaylistByReferenceID(String, HttpRequestConfig, PlaylistListener)HLSeおよびWidevineライセンス取得のトークン使用の詳細は、SDKによって処理されます。
 
コード例
次の例は、カタログリクエストを行うときに認証トークンを渡す方法を示しています。
String myToken = "...";
HttpRequestConfig httpRequestConfig = new HttpRequestConfig.Builder()
       .setBrightcoveAuthorizationToken(myToken)
       .build();
…
Catalog catalog = new Catalog(eventEmitter, accountId, policyKey, playbackApiBaseUrl);
catalog.findVideoByReferenceID(videoReferenceId, httpRequestConfig, new VideoListener(){...});
    オフライン再生
      オフラインカタログfindVideo、requestPurchaseLicenseそしてrequestRentalLicenseすべてのメソッドはHttpRequestConfig引数として。
    
private HttpRequestConfig httpRequestConfig;
private String pasToken = "YOUR_PAS_TOKEN";
...
HttpRequestConfig.Builder httpRequestConfigBuilder = new HttpRequestConfig.Builder();
httpRequestConfigBuilder.setBrightcoveAuthorizationToken(pasToken);
httpRequestConfig = httpRequestConfigBuilder.build();
playlist.findPlaylist(catalog, httpRequestConfig, new PlaylistListener() {
    @Override
    public void onPlaylist(Playlist playlist) {
        videoListAdapter.setVideoList(playlist.getVideos());
        onVideoListUpdated(false);
        brightcoveVideoView.addAll(playlist.getVideos());
    }
    @Override
    public void onError(String error) {
        String message = showToast("Failed to find playlist[%s]: %s", playlist.displayName, error);
        Log.w(TAG, message);
        onVideoListUpdated(true);
    }
});
    詳細については、オフライン再生サンプルアプリを参照してください。
回答
PAS には、次の応答が関連付けられています。
- 200-ライセンスの続行が許可されています
 - 401-ライセンス提供は続行できません
 
制約事項
現在のリリースには制限があります。
- Chromecastは再生認証ではサポートされていません。
 
iOSの実装
BrightcoveのPlaybackAuthorization Serviceを使用する場合は、認証トークンを渡すことができる再生サービスメソッドを使用する必要があります。
ビデオリクエストの場合は、次のいずれかを使用します。
- (void)findVideoWithVideoID:(NSString *)videoID authToken:(NSString *)authToken parameters:(NSDictionary *)parameters completion:(void (^)(BCOVVideo *video, NSDictionary *jsonResponse, NSError *error))completionHandler;
    - (void)findVideoWithReferenceID:(NSString *)referenceID authToken:(NSString *)authToken parameters:(NSDictionary *)parameters completion:(void (^)(BCOVVideo *video, NSDictionary *jsonResponse, NSError *error))completionHandler;
    プレイリストリクエストの場合は、次のいずれかを使用します。
- (void)findPlaylistWithPlaylistID:(NSString *)playlistID authToken:(NSString *)authToken parameters:(NSDictionary *)parameters completion:(void (^)(BCOVPlaylist *playlist, NSDictionary *jsonResponse, NSError *error))completionHandler;
    - (void)findPlaylistWithReferenceID:(NSString *)referenceID authToken:(NSString *)authToken parameters:(NSDictionary *)parameters completion:(void (^)(BCOVPlaylist *playlist, NSDictionary *jsonResponse, NSError *error))completionHandler;
    HLSeおよびFairPlayライセンス取得のトークン使用の詳細は、SDKによって処理されます。
詳細については、再生認証サービス iOS用ネイティブSDKリファレンスのセクション。
オフライン再生
オフライン再生で再生認証サービスを使用している場合、認証トークンを受け入れるFairPlayライセンスを更新するための新しい方法があります。
// Request license renewal
    [BCOVOfflineVideoManager.sharedManager renewFairPlayLicense:offlineVideoToken
        video:video // recent video from Playback API or Playback Service class
        authToken: authToken
        Parameters: parameters
        completion:^(BCOVOfflineVideoToken offlineVideoToken, NSError *error)
    {
        // handle errors
    }];
    
      ライセンスの更新が完了すると、渡されたのと同じオフラインビデオトークンを使用して完了ブロックが呼び出されます。アンNSError発生した問題を示します(エラーがない場合はnil)。
    
詳細については、 FairPlayライセンスの更新 iOS用ネイティブSDKリファレンスのセクション。
回答
PAS には、次の応答が関連付けられています。
- 200-ライセンスの続行が許可されています
 - 401-ライセンス提供は続行できません