Search in sources :

Example 1 with ExoPlayerVideoDisplayComponent

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");
    }
}
Also used : Video(com.brightcove.player.model.Video) Event(com.brightcove.player.event.Event) List(java.util.List) EventListener(com.brightcove.player.event.EventListener) Id3Frame(com.google.android.exoplayer.metadata.id3.Id3Frame) ExoPlayerVideoDisplayComponent(com.brightcove.player.display.ExoPlayerVideoDisplayComponent)

Aggregations

ExoPlayerVideoDisplayComponent (com.brightcove.player.display.ExoPlayerVideoDisplayComponent)1 Event (com.brightcove.player.event.Event)1 EventListener (com.brightcove.player.event.EventListener)1 Video (com.brightcove.player.model.Video)1 Id3Frame (com.google.android.exoplayer.metadata.id3.Id3Frame)1 List (java.util.List)1