/// <summary> /// Creates an API object for read/write API access for a specific region and with a custom "media delivery" format. /// </summary> /// <param name="readToken">The authentication token provided to authorize read access to the Media APIs.</param> /// <param name="writeToken">The authentication token provided to authorize write access to the Media APIs.</param> /// <param name="mediaDelivery">The format for media delivery. Specify "http" to retrieve URLs for downloading /// audio & video files, rather than streaming them.</param> /// <param name="region">The region of the video publishing.</param> /// <returns>A configured BrightcoveApi object</returns> public static BrightcoveApi CreateApi(string readToken, string writeToken, string mediaDelivery, BrightcoveRegion region) { BrightcoveApiConfig apiConfig = new BrightcoveApiConfig(readToken, writeToken, region); if (!String.IsNullOrEmpty(mediaDelivery)) { apiConfig.MediaDelivery = mediaDelivery; } BrightcoveApiConnector apiConnector = new BrightcoveApiConnector(apiConfig); return new BrightcoveApi(apiConnector); }
/// <summary> /// A read/write configuration for the specified region. /// </summary> /// <param name="readToken">The authentication token provided to authorize read access to the Media APIs.</param> /// <param name="writeToken">The authentication token provided to authorize write access to the Media APIs.</param> /// <param name="region">The region of the video publishing.</param> public BrightcoveApiConfig(string readToken, string writeToken, BrightcoveRegion region) { ReadToken = readToken; WriteToken = writeToken; string domain = region == BrightcoveRegion.Japan ? "co.jp" : "com"; const string apiStem = "http://api.brightcove.{0}/services/{1}"; ApiReadUrl = String.Format(apiStem, domain, "library"); ApiWriteUrl = String.Format(apiStem, domain, "post"); RequestTimeout = 100000; // .NET default Encoding = Encoding.UTF8; UserAgent = "Brightcove .NET MAPI Wrapper"; }
/// <summary> /// A read/write configuration for the specified region. /// </summary> /// <param name="readToken">The authentication token provided to authorize read access to the Media APIs.</param> /// <param name="writeToken">The authentication token provided to authorize write access to the Media APIs.</param> /// <param name="region">The region of the video publishing.</param> public BrightcoveApiConfig(string readToken, string writeToken, BrightcoveRegion region) { ReadToken = readToken; WriteToken = writeToken; string domain = region == BrightcoveRegion.Japan ? "co.jp" : "com"; const string apiStem = "http://api.brightcove.{0}/services/{1}"; ApiReadUrl = String.Format(apiStem, domain, "library"); ApiWriteUrl = String.Format(apiStem, domain, "post"); RequestTimeout = 100000; // .NET default Encoding = Encoding.UTF8; UserAgent = "Brightcove .NET MAPI Wrapper"; }
/// <summary> /// Creates an API object for read/write API access for a specific region. /// </summary> /// <param name="readToken">The authentication token provided to authorize read access to the Media APIs.</param> /// <param name="writeToken">The authentication token provided to authorize write access to the Media APIs.</param> /// <param name="region">The region of the video publishing.</param> /// <returns>A configured BrightcoveApi object</returns> public static BrightcoveApi CreateApi(string readToken, string writeToken, BrightcoveRegion region) { return CreateApi(readToken, writeToken, null, region); }
/// <summary> /// A read-only configuration for the specified region. /// </summary> /// <param name="readToken">The authentication token provided to authorize read access to the Media APIs.</param> /// <param name="region">The region of the video publishing.</param> public BrightcoveApiConfig(string readToken, BrightcoveRegion region): this(readToken, null, region) { }
/// <summary> /// A read-only configuration for the specified region. /// </summary> /// <param name="readToken">The authentication token provided to authorize read access to the Media APIs.</param> /// <param name="region">The region of the video publishing.</param> public BrightcoveApiConfig(string readToken, BrightcoveRegion region) : this(readToken, null, region) { }
/// <summary> /// Creates an API object for read/write API access for a specific region and with a custom "media delivery" format. /// </summary> /// <param name="readToken">The authentication token provided to authorize read access to the Media APIs.</param> /// <param name="writeToken">The authentication token provided to authorize write access to the Media APIs.</param> /// <param name="mediaDelivery">The format for media delivery. Specify "http" to retrieve URLs for downloading /// audio & video files, rather than streaming them.</param> /// <param name="region">The region of the video publishing.</param> /// <returns>A configured BrightcoveApi object</returns> public static BrightcoveApi CreateApi(string readToken, string writeToken, string mediaDelivery, BrightcoveRegion region) { BrightcoveApiConfig apiConfig = new BrightcoveApiConfig(readToken, writeToken, region); if (!String.IsNullOrEmpty(mediaDelivery)) { apiConfig.MediaDelivery = mediaDelivery; } BrightcoveApiConnector apiConnector = new BrightcoveApiConnector(apiConfig); return(new BrightcoveApi(apiConnector)); }
/// <summary> /// Creates an API object for read/write API access for a specific region. /// </summary> /// <param name="readToken">The authentication token provided to authorize read access to the Media APIs.</param> /// <param name="writeToken">The authentication token provided to authorize write access to the Media APIs.</param> /// <param name="region">The region of the video publishing.</param> /// <returns>A configured BrightcoveApi object</returns> public static BrightcoveApi CreateApi(string readToken, string writeToken, BrightcoveRegion region) { return(CreateApi(readToken, writeToken, null, region)); }