Search in sources :

Example 1 with OnceUxComponent

use of com.brightcove.onceux.OnceUxComponent in project android-player-samples by BrightcoveOS.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    // When extending the BrightcovePlayer, we must assign brightcoveVideoView before
    // entering the superclass.  This allows for some stock video player lifecycle
    // management.
    setContentView(R.layout.onceux_activity_main);
    brightcoveVideoView = (BrightcoveExoPlayerVideoView) findViewById(R.id.brightcove_video_view);
    super.onCreate(savedInstanceState);
    // Setup the event handlers for the OnceUX plugin, set the companion ad container,
    // register the VMAP data URL inside the plugin and start the video.  The plugin will
    // detect that the video has been started and pause it until the ad data is ready or an
    // error condition is detected.  On either event the plugin will continue playing the
    // video.
    registerEventHandlers();
    plugin = new OnceUxComponent(this, brightcoveVideoView);
    View view = findViewById(R.id.ad_frame);
    if (view != null && view instanceof ViewGroup) {
        plugin.addCompanionContainer((ViewGroup) view);
    }
    plugin.processVideo(onceUxAdDataUrl);
}
Also used : ViewGroup(android.view.ViewGroup) OnceUxComponent(com.brightcove.onceux.OnceUxComponent) BrightcoveExoPlayerVideoView(com.brightcove.player.view.BrightcoveExoPlayerVideoView) View(android.view.View)

Aggregations

View (android.view.View)1 ViewGroup (android.view.ViewGroup)1 OnceUxComponent (com.brightcove.onceux.OnceUxComponent)1 BrightcoveExoPlayerVideoView (com.brightcove.player.view.BrightcoveExoPlayerVideoView)1