Brightcove Media API

1.2.2

Brightcove Media API は、JSON ベースの Brightcove Media API を採用するための Cocoa/Objective-C ライブラリです。Media API は、Brightcove の動画やプレイリスト API に対して Cocoa/Objective-C インタフェースを提供します。

Brightcove Media API

Brightcove Media API は、カスタムアプリケーションの開発を通して Brightcove コンテンツにアクセスするための JSON サービス一式を提供します。これについては Brightcove のサイトにドキュメント化されています。

http://docs.brightcove.com/en/media/

Brightcove Media API を使用するには、Brightcove サポートが提供するデベロッパ readToken が必要です。本ライブラリのどの呼び出しも、有効な readToken なしでは成功しません。

BCMediaAPI

BCMediaAPI クラスは Brightcove Media API 呼び出しすべてに対するファサードです。これによりデベロッパはインスタンスを 1 度作成し、すべての呼び出しに再利用できます。

 BCMediaAPI *bc = [[BCMediaAPI alloc] initWithReadToken:@"MyReadToken"];

呼び出しは Cocoa スタイルのエラーポインタを採用するため、すべての呼び出しは以下と同じようなパターンになります。

 NSError *err;
 BCVideo *video = [bc findVideoById:1234 error:&err];
 
 if (!video)
 {
        // if the result is nil, and we sent the optional error argument,
        // then the error will be populated by all underlying errors reported
        // by the Brightcove server. We can use this convenience method to dump
        // the NSError's userInfo, where the underlying errors are reported, to 
        // an NSString for logging or other purposes:
 
        NSString *errStr = [bc getErrorsAsString:err];
        NSLog(errStr);
 }

サポートされているメソッドについては BCMediaAPIクラスドキュメンテーションあるいはヘッダーファイルをご覧ください。


© 2009 Brightcove, Inc., All Rights Reserved