Introduction
Brightcove provides a solution for delivering video to China from outside the country. The solution is comprised of two parts:
- A proxy server hosted within China
- A connected China-specific CDN
The proxy routes non-video traffic (Playback API requests, Analytics beacons, and the web player itself) to and from viewers in China to Brightcove infrastructure located outside.
The CDN is connected to the proxy and handles the video and image content.
Requirements
The following requirements are needed for China Delivery with the Brightcove Native SDKs:
Setup
-
There are setup requirements in addition to configuring your player
For details, see Overview: China Delivery
Device OS version
- The current SDK requires iOS 12.0 or newer for manual XCFramework or CocoaPods installations, or iOS 14.0 or newer with Swift Package Manager. See the SDK overview for installation requirements.
Brightcove SDK version
- The Android Native SDK is not supported
- Native SDK for iOS 6.5.0 and newer
iOS Implementation
The BCOVGlobalConfiguration class allows you to set custom configurations for the Native SDK for iOS.
Within this class, set the chinaProxyDomain property to a custom, fully qualified domain name (FQDN) for the Playback API, metrics and analytics collection services.
@property (nonatomic, copy, nullable) NSString *chinaProxyDomain;
To use China Delivery, follow these steps
Swift
-
Review the VideoCloudBasicPlayer sample.
-
In
ViewController.swift, setchinaProxyDomaininside the initializer closure forsharedSDKManager, before callingsharedManager(). Configure the domain before creating any playback controllers or playback services:import UIKit import BrightcovePlayerSDK class ViewController: UIViewController { let sharedSDKManager: BCOVPlayerSDKManager = { BCOVGlobalConfiguration.sharedConfig.chinaProxyDomain = "your host domain" return BCOVPlayerSDKManager.sharedManager() }() }
Objective-C
-
Review the Objective-C simple video app tutorial.
-
In
ViewController.m, setchinaProxyDomainbefore callingsetup, which creates the SDK objects:- (instancetype)initWithCoder:(NSCoder *)coder { self = [super initWithCoder:coder]; if (self) { BCOVGlobalConfiguration.sharedConfig.chinaProxyDomain = @"your host domain"; [self setup]; } return self; }
Custom players
To support Brightcove China Delivery with a custom player, you must update how it connects to Brightcove from within China Delivery.
The Playback API endpoint hostname must be changed from edge.api.brightcove.com to yourdomain.cn. Here is an example:
The following endpoint:
https://edge.api.brightcove.com/playback/v1/accounts/123450001/videos/543210001
Would become:
https://videos.yourdomain.cn/playback/v1/accounts/123450001/videos/543210001
The Data Collection API hostname must be changed from metrics.brightcove.com to yourdomain.cn. Here is an example:
The following endpoint:
https://metrics.brightcove.com/v2/tracker?event=video_view&domain=videocloud&account=123&video=789
Would become:
https://videos.yourdomain.cn/v2/tracker?event=video_view&domain=videocloud&account=123&video=789
In the examples shown above videos.yourdomain.cn is the ICP-licensed and active hostname configured for the China Delivery account.
Limitations
For details about the limitations for this feature, see the Overview: China Delivery document.