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();
}
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();
}
Aggregations