- Introduction to Data
- Track your video engagement and performance
- HTML5 video element
- HLS.js
- AVPlayer
- ExoPlayer
- Dash.js
- Video.js
- React native video
- Kaltura (Web)
- Kaltura (iOS)
- Kaltura (Android)
- JW Player (Web)
- JW Player (iOS)
- Android MediaPlayer
- Bitmovin player
- Bitmovin player (Android)
- Akamai media player
- NexPlayer
- Ooyala player
- Shaka player
- Azure media player
- THEOplayer (Web)
- THEOplayer (iOS)
- THEOplayer (Android)
- Flowplayer
- Brightcove (Web)
- Brightcove (iOS)
- Brightcove (Android)
- CTS PDK
- Chromecast
- Roku
- Samsung Tizen
- LG
- Agnoplay player
- Make API requests
- Set up alerts
- Make your data actionable with metadata
- Track autoplaying videos
- Extend Data with custom metadata
- Track CDN for request metrics
- See how many people are watching
- Build a custom integration
- Understand metric definitions
- Export raw video view data
- Ensure privacy compliance
- Mux Data FAQs
Brightcove (Android)
This guide walks through integration with Brightcove's Android player to collect video performance metrics with Mux data.
Brightcove's native SDK for Android has support for both the native MediaPlayer
as well as ExoPlayer
. In the case that you utilize ExoPlayer
(via a class such as BrightcoveExoPlayerVideoView
), monitoring basic video playback is relatively simple.
Requirements
- Brightcove SDK for Android 6.x
- ExoPlayer-based Brightcove Player (e.g.
BrightcoveExoPlayerVideoView
)
Integration Instructions
Brightcove's SDK for Android encapsulates an underlying SimpleExoPlayer
instance. In order to integrate, you need to create an instance of MuxStats
for each new video loaded into the player. This is best done by listening for the didSetVideo
event that the EventEmitter
emits.
Brightcove's current Android SDK (6.2.x) uses ExoPlayer r2.7.x, so you should include the appropriate AAR file from our releases page and in our Monitor ExoPlayer guide.
Note: didSetVideo
is used in order to get the updated Video
in the case that a playlist of Video
objects, so that you can retrieve the updated metadata.
// MainFragment.java (or MainActivity.java, wherever // you have access to your `BrightcoveExoPlayerVideoView` import com.mux.stats.sdk.core.model.CustomerPlayerData; import com.mux.stats.sdk.core.model.CustomerVideoData; import com.mux.stats.sdk.muxstats.MuxStatsExoPlayer; public class MainFragment extends BrightcovePlayerFragment implements EventListener { public static final String TAG = MainFragment.class.getSimpleName(); private MuxStatsExoPlayer muxStatsExoPlayer; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View result = inflater.inflate(R.layout.fragment_main, container, false); baseVideoView = (BrightcoveExoPlayerVideoView) result.findViewById(R.id.brightcove_video_view); super.onCreateView(inflater, container, savedInstanceState); baseVideoView.getEventEmitter().on("didSetVideo", this); // Set up your videos for playback here Video video = Video.createVideo("https://path/to/video.mp4", DeliveryType.HLS); baseVideoView.add(video); baseVideoView.start(); return result; } @Override public void processEvent(Event event) { ExoPlayerVideoDisplayComponent videoDisplayComponent = (ExoPlayerVideoDisplayComponent) baseVideoView.getVideoDisplay(); Video video = baseVideoView.getCurrentVideo(); SimpleExoPlayer exoPlayer = (SimpleExoPlayer) videoDisplayComponent.getExoPlayer(); CustomerPlayerData customerPlayerData = new CustomerPlayerData(); customerPlayerData.setPropertyKey("EXAMPLE_PROPERTY_KEY"); CustomerVideoData customerVideoData = new CustomerVideoData(); customerVideoData.setVideoTitle(video.getId()); if (muxStatsExoPlayer != null) { muxStatsExoPlayer.release(); muxStatsExoPlayer = null; } muxStatsExoPlayer = new MuxStatsExoPlayer(exoPlayer, "demo-player", customerPlayerData, customerVideoData); Point size = new Point(); ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getSize(size); muxStatsExoPlayer.setScreenSize(size.x, size.y); muxStatsExoPlayer.setPlayerView(baseVideoView); } }
Known Issues
- Due to the implementation of the various listeners within ExoPlayer (e.g. the lack of chaining) and Brightcove listening for certain events, there will be no Video Quality metrics calculated. This is being investigated, but will require an additional update from Brightcove.
Refer to the detailed guide for ExoPlayer to finish setup.