This sample shows how to integrate Flutter with the Brightcove Player SDKs for iOS. The reader is expected to be familiar with both Flutter and the Brightcove SDK; this is not a Flutter tutorial and Brightcove cannot provide support for Flutter. An installation of Flutter is required.
This sample uses CocoaPods (see the CocoaPods note in the root README).
- Platform: iOS.
- Minimum OS: iOS 14.0.
- Toolchain: Flutter SDK, CocoaPods 1.11+, Xcode 15.0+.
- Extra SDKs: the Brightcove SDK via CocoaPods (the
Brightcove-Player-IMApod, which pulls inBrightcove-Player-Core).
- In
flutter_bcov, runflutter pub get. - Run
pod install(inFlutter/). - Open
FlutterPlayer.xcworkspaceand run on a simulator or device.
To hot-reload the Flutter widgets, run flutter attach -d '<device-id>' --app-id <your-bundle-id> (the bundle id is com.brightcove.player.samples.FlutterPlayer by default).
The native Brightcove player is embedded as a platform view. On the native side (FlutterPlayer/), a plugin registers a platform-view factory under the view type bcov.flutter/player_view; on the Dart side (flutter_bcov/), a UiKitView hosts that native view with Flutter-drawn controls on top — see the flutter_bcov README. The two sides communicate over a method channel (Dart → native) and an event channel (native → Dart).
The project is configured to support the IMA plugin. The IMA-related code is commented out by default so the project builds without exercising the IMA dependency; uncomment it to enable IMA ads.