use of com.brightcove.player.edge.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.activity_main);
brightcoveVideoView = (BrightcoveExoPlayerTextureVideoView) findViewById(R.id.brightcove_video_view);
super.onCreate(savedInstanceState);
// Get the event emitter from the SDK and create a catalog request to fetch a video from the
// Brightcove Edge service, given a video id, an account id and a policy key.
EventEmitter eventEmitter = brightcoveVideoView.getEventEmitter();
Catalog catalog = new Catalog(eventEmitter, getString(R.string.account), getString(R.string.policy));
catalog.findVideoByID(getString(R.string.videoId), new VideoListener() {
// Add the video found to the queue with add().
// Start playback of the video with start().
@Override
public void onVideo(Video video) {
Log.v(TAG, "onVideo: video = " + video);
brightcoveVideoView.add(video);
brightcoveVideoView.start();
}
});
}
use of com.brightcove.player.edge.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.activity_main);
brightcoveVideoView = (BrightcoveExoPlayerVideoView) findViewById(R.id.brightcove_video_view);
super.onCreate(savedInstanceState);
Catalog catalog = new Catalog(brightcoveVideoView.getEventEmitter(), "3303963094001", "BCpkADawqM3zXLtsEM0nAyA_3o3TmZnG6bZTXFmjZ8X_rmFMqlpB78l0aiRELs7MWACf4mYN92qMOLMxfZN6Xr3cQ_0R3G2qBiho3X3Nc2yTv7DH4APQ-EimMJQ3crX0zc0mJMy9CtSqkmli");
catalog.findVideoByID("4283173439001", new VideoListener() {
@Override
public void onVideo(Video video) {
brightcoveVideoView.add(video);
brightcoveVideoView.start();
}
@Override
public void onError(String s) {
Log.e(TAG, "Could not load video: " + s);
}
});
}
use of com.brightcove.player.edge.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.default_activity_main);
brightcoveVideoView = (BrightcoveExoPlayerVideoView) findViewById(R.id.brightcove_video_view);
super.onCreate(savedInstanceState);
EventEmitter eventEmitter = brightcoveVideoView.getEventEmitter();
Catalog catalog = new Catalog(eventEmitter, getString(R.string.account), getString(R.string.policy));
catalog.findVideoByID(getString(R.string.videoId), new VideoListener() {
// Add the video found to the queue with add().
// Start playback of the video with start().
@Override
public void onVideo(Video video) {
Log.v(TAG, "onVideo: video = " + video);
brightcoveVideoView.add(video);
brightcoveVideoView.start();
}
});
}
use of com.brightcove.player.edge.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.activity_main);
brightcoveVideoView = (BrightcoveExoPlayerVideoView) findViewById(R.id.brightcove_video_view);
super.onCreate(savedInstanceState);
// Get the event emitter from the SDK and create a catalog request to fetch a video from the
// Brightcove Edge service, given a video id, an account id and a policy key.
EventEmitter eventEmitter = brightcoveVideoView.getEventEmitter();
Catalog catalog = new Catalog(eventEmitter, getString(R.string.account), getString(R.string.policy));
catalog.findVideoByID(getString(R.string.videoId), new VideoListener() {
// Add the video found to the queue with add().
// Start playback of the video with start().
@Override
public void onVideo(Video video) {
Log.v(TAG, "onVideo: video = " + video);
brightcoveVideoView.add(video);
brightcoveVideoView.start();
}
});
}
use of com.brightcove.player.edge.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 BrightcoveExoPlayerVideoView
// before entering the superclass. This allows for some stock video player lifecycle
// management.
setContentView(R.layout.freewheel_activity_main);
brightcoveVideoView = (BrightcoveExoPlayerVideoView) findViewById(R.id.brightcove_video_view);
super.onCreate(savedInstanceState);
adFrame = (FrameLayout) findViewById(R.id.ad_frame);
eventEmitter = brightcoveVideoView.getEventEmitter();
setupFreeWheel();
Catalog catalog = new Catalog(brightcoveVideoView.getEventEmitter(), "3303963094001", "BCpkADawqM3zXLtsEM0nAyA_3o3TmZnG6bZTXFmjZ8X_rmFMqlpB78l0aiRELs7MWACf4mYN92qMOLMxfZN6Xr3cQ_0R3G2qBiho3X3Nc2yTv7DH4APQ-EimMJQ3crX0zc0mJMy9CtSqkmli");
catalog.findVideoByID("4283173439001", new VideoListener() {
@Override
public void onVideo(Video video) {
brightcoveVideoView.add(video);
brightcoveVideoView.start();
}
@Override
public void onError(String s) {
Log.e(TAG, "Could not load video: " + s);
}
});
}
Aggregations