Search in sources :

Example 1 with VMAPComponent

use of com.brightcove.vmap.VMAPComponent in project android-player-samples by BrightcoveOS.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    setContentView(R.layout.activity_main);
    brightcoveVideoView = (BrightcoveVideoView) findViewById(R.id.brightcove_video_view);
    super.onCreate(savedInstanceState);
    vmapComponent = new VMAPComponent(brightcoveVideoView);
    View view = findViewById(R.id.ad_frame);
    if ((view != null) && (view instanceof ViewGroup)) {
        vmapComponent.addCompanionContainer((ViewGroup) view);
    } else {
        Log.e(TAG, "Companion container must be an instance of a ViewGroup");
    }
    Video video = Video.createVideo("http://media.w3.org/2010/05/sintel/trailer.mp4", DeliveryType.MP4);
    video.getProperties().put(VMAPComponent.VMAP_URL, "http://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&cmsid=496&vid=short_onecue&correlator=");
    brightcoveVideoView.add(video);
    brightcoveVideoView.start();
}
Also used : ViewGroup(android.view.ViewGroup) Video(com.brightcove.player.model.Video) BrightcoveVideoView(com.brightcove.player.view.BrightcoveVideoView) View(android.view.View) VideoView(android.widget.VideoView) VMAPComponent(com.brightcove.vmap.VMAPComponent)

Example 2 with VMAPComponent

use of com.brightcove.vmap.VMAPComponent in project android-player-samples by BrightcoveOS.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    setContentView(R.layout.activity_main);
    brightcoveVideoView = (BrightcoveExoPlayerVideoView) findViewById(R.id.brightcove_video_view);
    super.onCreate(savedInstanceState);
    vmapComponent = new VMAPComponent(brightcoveVideoView);
    View view = findViewById(R.id.ad_frame);
    if ((view != null) && (view instanceof ViewGroup)) {
        vmapComponent.addCompanionContainer((ViewGroup) view);
    } else {
        Log.e(TAG, "Companion container must be an instance of a ViewGroup");
    }
    Video video = Video.createVideo("http://media.w3.org/2010/05/sintel/trailer.mp4", DeliveryType.MP4);
    video.getProperties().put(VMAPComponent.VMAP_URL, "http://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&cmsid=496&vid=short_onecue&correlator=");
    brightcoveVideoView.add(video);
    brightcoveVideoView.start();
}
Also used : ViewGroup(android.view.ViewGroup) Video(com.brightcove.player.model.Video) BrightcoveExoPlayerVideoView(com.brightcove.player.view.BrightcoveExoPlayerVideoView) View(android.view.View) VideoView(android.widget.VideoView) VMAPComponent(com.brightcove.vmap.VMAPComponent)

Aggregations

View (android.view.View)2 ViewGroup (android.view.ViewGroup)2 VideoView (android.widget.VideoView)2 Video (com.brightcove.player.model.Video)2 VMAPComponent (com.brightcove.vmap.VMAPComponent)2 BrightcoveExoPlayerVideoView (com.brightcove.player.view.BrightcoveExoPlayerVideoView)1 BrightcoveVideoView (com.brightcove.player.view.BrightcoveVideoView)1