Brightcove Player SDK for iOS Samples
Learn more about the Brightcove Native Player SDKs.
ios-player-samples.git is a collection of sample applications for the Brightcove Player SDKs for iOS and tvOS, organized by subject area. An installation of CocoaPods 1.0.0 or higher is required to download the sample dependencies.
- CocoaPods 1.0+
- Xcode 11.0+
- iOS 11.0+ or tvOS 11.0+
An Apple Developer Program account is required to run any sample app on a physical device. In order to provision your device, edit the sample app bundle identifier to make it unique to your organization.
To ensure you are using the latest releases of the Brightcove software components, update your Podspec repository before building any of the sample applications by running the following on the command line:
pod repo update
The Swift sample apps are written in Swift language version 4.2.
Unless otherwise instructed, samples can be run by following these steps:
- From the project directory, run
- Open the corresponding
- Where the Podfile's pod directives do not specify that a dynamic framework is being installed, there is some additional setup required to build and run the project:
- Locate the
bcovpuiiconfont.ttffile in the Pods/Brightcove-Player-SDK/ios/BrightcovePlayerSDK.framework folder.
- Add this file to your Xcode project listing so that the font file is copied into the app bundle.
- In the built app's bundle, the font file should end up at the same level as the app's Info.plist file.
- The font file supplies some of the BrightcovePlayerUI interface elements, but it does not need to be listed in the plist itself.
- Locate the
- There are README.md files in several of the samples that provide additional setup steps that are specific to those examples.
Note: If you intend to use these samples offline, be sure to run Cocoapods before going offline in order to download the required dependencies.
FairPlay samples demonstrate how to play protected videos using FairPlay plugin that is integrated into the core BrightcovePlayerSDK framework.
To see an example of using FairPlay with Google Interactive Media Ads (IMA), refer to the FairPlayIMAPlayer sample app in the IMA folder.
A note about the FairPlay sample apps
In both of the FairPlay sample apps, there are references to
FairPlayApplicationId. These terms refer to FairPlay credentials that Brightcove does not provide, which are instead acquired through Apple directly.
iOS does not allow FairPlay-protected video to display in a simulator so it's important to develop on an actual device.
FreeWheel samples demonstrate how to play ads managed by FreeWheel. These are intended to cover the basic configuration to retrieve linear and companion ads.
GoogleCast samples demonstrate how to extend your app to direct its streaming video to a Chromecast device using the Google Cast plugin. The
BasicCastPlayer app is intended to cover use of a custom cast manager and BCOVGoogleCastManager. The
BrightcoveCastReceiver app supports more features such DRM protected videos, SSAI and HLSv3 or superior.
IMA samples demonstrate how to play ads managed by Google Interactive Media Ads (IMA). These are intended to cover use cases like VMAP, VAST, Server Side Ad rules, and advanced ad topics.
Offline samples demonstrate downloading offline-enabled HLS videos and playing them back with or without a network connection.
iOS does not allow video downloads to a simulator so it's important to develop on an actual device.
Omniture sample demonstrates how to track analytics using the Omniture plugin.
Player samples demonstrate how to use the core SDK. These are intended to cover use cases like custom controls, analytics, and playback.
PlayerUI samples demonstrate how to customize the player look and feel. These are intended to cover the modification of the BCOVPlayerUI, the customization of VoiceOver properties for accessibility and the use of the view strategy.
Pulse samples demonstrate how to play ads managed by INVIDI Technologies Pulse. These are intended to cover different configurations for the content.
SidecarSubtitles sample demonstrates how to add WebVTT subtitles to an HLS manifest from within an iOS/tvOS app using SidecarSubtitles plugin that is integrated into the core BrightcovePlayerSDK framework.
SSAI samples demonstrate how to use the SSAI plugin. These are intended to cover playback of Dynamic Delivery with or without Server-Side Ad Insertion, and play pre-rolls using Google IMA for SSAI Live Streams.
- An example of creating a
BCOVPlaybackSessionConsumercan be found in the
- Picture-in-Picture functionality can be found in the
- An example of setting up lock screen playback controls can be found in the
- An example of creation a
BCOVPlaybackControllerusing a view strategy can be found in the