use of com.brightcove.player.media.VideoListener in project android-player-samples by BrightcoveOS.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ima_activity_main);
eventEmitter = brightcoveVideoView.getEventEmitter();
// Use a procedural abstraction to setup the Google IMA SDK via the plugin.
setupGoogleIMA();
Map<String, String> options = new HashMap<String, String>();
List<String> values = new ArrayList<String>(Arrays.asList(VideoFields.DEFAULT_FIELDS));
values.remove(VideoFields.HLS_URL);
options.put("video_fields", StringUtil.join(values, ","));
Catalog catalog = new Catalog("ErQk9zUeDVLIp8Dc7aiHKq8hDMgkv5BFU7WGshTc-hpziB3BuYh28A..");
catalog.findVideoByReferenceID("shark", new VideoListener() {
public void onVideo(Video video) {
brightcoveVideoView.add(video);
// Auto play: the GoogleIMAComponent will postpone
// playback until the Ad Rules are loaded.
brightcoveVideoView.start();
}
public void onError(String error) {
Log.e(TAG, error);
}
});
}
use of com.brightcove.player.media.VideoListener 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 the BrightcoveVideoView
// before entering the superclass. This allows for some stock video player lifecycle
// management.
setContentView(R.layout.freewheel_activity_main);
brightcoveVideoView = (BrightcoveVideoView) findViewById(R.id.brightcove_video_view);
super.onCreate(savedInstanceState);
adFrame = (FrameLayout) findViewById(R.id.ad_frame);
eventEmitter = brightcoveVideoView.getEventEmitter();
setupFreeWheel();
setupWidevine();
Catalog catalog = new Catalog("FqicLlYykdimMML7pj65Gi8IHl8EVReWMJh6rLDcTjTMqdb5ay_xFA..");
catalog.findVideoByID("2142114984001", new VideoListener() {
@Override
public void onVideo(Video video) {
brightcoveVideoView.add(video);
brightcoveVideoView.start();
}
@Override
public void onError(String error) {
Log.e(TAG, error);
}
});
}
use of com.brightcove.player.media.VideoListener 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 the BrightcoveVideoView before
// entering the superclass. This allows for some stock video player lifecycle
// management. Establish the video object and use it's event emitter to get important
// notifications and to control logging.
setContentView(R.layout.ima_widevine_activity_main);
brightcoveVideoView = (BrightcoveVideoView) findViewById(R.id.brightcove_video_view);
super.onCreate(savedInstanceState);
eventEmitter = brightcoveVideoView.getEventEmitter();
// Use a procedural abstraction to setup the Google IMA SDK via the plugin and establish
// a playlist listener object for our sample video: the Potter Puppet show.
setupGoogleIMA();
// Initialize the widevine plugin.
setupWidevine();
// Create the catalog object which will start and play the video.
Catalog catalog = new Catalog("FqicLlYykdimMML7pj65Gi8IHl8EVReWMJh6rLDcTjTMqdb5ay_xFA..");
catalog.findVideoByID("2223563028001", new VideoListener() {
@Override
public void onError(String error) {
Log.e(TAG, error);
}
@Override
public void onVideo(Video video) {
brightcoveVideoView.add(video);
brightcoveVideoView.start();
}
});
}
use of com.brightcove.player.media.VideoListener 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 the BrightcoveVideoView before
// entering the superclass. This allows for some stock video player lifecycle
// management.
setContentView(R.layout.activity_main);
brightcoveVideoView = (BrightcoveVideoView) findViewById(R.id.brightcove_video_view);
super.onCreate(savedInstanceState);
eventEmitter = brightcoveVideoView.getEventEmitter();
// Use a procedural abstraction to setup the Google IMA SDK via the plugin.
setupGoogleIMA();
// Initialize the widevine plugin.
setupWidevine();
// Create the catalog object which will start and play the video.
Catalog catalog = new Catalog("FqicLlYykdimMML7pj65Gi8IHl8EVReWMJh6rLDcTjTMqdb5ay_xFA..");
catalog.findVideoByID("2142114984001", new VideoListener() {
@Override
public void onVideo(Video video) {
brightcoveVideoView.add(video);
// Auto play: the GoogleIMAComponent will postpone
// playback until the Ad Rules are loaded.
brightcoveVideoView.start();
}
public void onError(String error) {
Log.e(TAG, error);
}
});
}
use of com.brightcove.player.media.VideoListener in project android-player-samples by BrightcoveOS.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
// Establish the video object and use it's event emitter to get important notifications
// and to control logging and media.
setContentView(R.layout.basic_widevine);
brightcoveVideoView = (BrightcoveVideoView) findViewById(R.id.bc_video_view);
super.onCreate(savedInstanceState);
// Set up the DRM licensing server to be handled by Brightcove with arbitrary device and
// portal identifiers to fulfill the Widevine API contract. These arguments will
// suffice to create a Widevine plugin instance.
String drmServerUri = "https://wvlic.brightcove.com/widevine/cypherpc/cgi-bin/GetEMMs.cgi";
String deviceId = "device1234";
String portalId = "brightcove";
new WidevinePlugin(this, brightcoveVideoView, drmServerUri, deviceId, portalId);
// Create the catalog object which will start and play the video.
Catalog catalog = new Catalog("FqicLlYykdimMML7pj65Gi8IHl8EVReWMJh6rLDcTjTMqdb5ay_xFA..");
catalog.findVideoByID("2142114984001", new VideoListener() {
@Override
public void onError(String error) {
Log.e(TAG, error);
}
@Override
public void onVideo(Video video) {
brightcoveVideoView.add(video);
brightcoveVideoView.start();
}
});
}
Aggregations