use of com.brightcove.player.display.ExoPlayerVideoDisplayComponent in project android-player-samples by BrightcoveOS.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
brightcoveVideoView.getEventEmitter().on(EventType.DID_SET_SOURCE, new EventListener() {
@Override
public void processEvent(Event event) {
ExoPlayerVideoDisplayComponent exoPlayerVideoDisplayComponent = (ExoPlayerVideoDisplayComponent) brightcoveVideoView.getVideoDisplay();
exoPlayerVideoDisplayComponent.setMetadataListener(new ExoPlayerVideoDisplayComponent.Id3MetadataListener() {
@Override
public void onId3Metadata(List<Id3Frame> list) {
for (Id3Frame id3Frame : list) {
Log.v(TAG, "id3 Frame id: " + id3Frame.id);
}
}
});
}
});
Video video = Video.createVideo("https://s3.amazonaws.com/as-zencoder/hls-timed-metadata/test.m3u8");
brightcoveVideoView.add(video);
brightcoveVideoView.start();
// Log whether or not instance state in non-null.
if (savedInstanceState != null) {
Log.v(TAG, "Restoring saved position");
} else {
Log.v(TAG, "No saved state");
}
}
Aggregations