use of com.brightcove.player.event.EventEmitter in project android-player-samples by BrightcoveOS.
the class MainActivity method registerEventHandlers.
// Private instance methods
/**
* Procedural abstraction used to setup event handlers for the OnceUX plugin.
*/
private void registerEventHandlers() {
// Handle the case where the ad data URL has not been supplied to the plugin.
EventEmitter eventEmitter = brightcoveVideoView.getEventEmitter();
eventEmitter.on(OnceUxEventType.NO_AD_DATA_URL, new EventListener() {
@Override
public void processEvent(Event event) {
// Log the event and display a warning message (later)
Log.e(TAG, event.getType());
// TODO: throw up a stock Android warning widget.
}
});
}
use of com.brightcove.player.event.EventEmitter in project android-player-samples by BrightcoveOS.
the class MainActivity method onCreate.
/**
* Sets up the view when created.
*/
private void onCreate() {
connectivityMonitor = ConnectivityMonitor.getInstance(this);
videoListLabel = ViewUtil.findView(this, R.id.video_list_label);
videoListView = ViewUtil.findView(this, R.id.video_list_view);
emptyListMessage = ViewUtil.findView(this, R.id.empty_list_message);
brightcoveVideoView = ViewUtil.findView(this, R.id.brightcove_video_view);
EventEmitter eventEmitter = brightcoveVideoView.getEventEmitter();
catalog = new OfflineCatalog(this, eventEmitter, ACCOUNT_ID, POLICY_KEY);
// Configure downloads through the catalog.
catalog.setMobileDownloadAllowed(true);
catalog.setMeteredDownloadAllowed(false);
catalog.setRoamingDownloadAllowed(false);
videoListAdapter = new VideoListAdapter(catalog, videoListListener);
// Connect the video list view to the adapter
RecyclerView videoListView = ViewUtil.findView(this, R.id.video_list_view);
videoListView.setAdapter(videoListAdapter);
// Setup an adapter to render the playlist items in the spinner view Adapter that
// will be used to bind the playlist spinner to the underlying data source.
ArrayAdapter<PlaylistModel> playlistAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item);
playlistAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
}
Aggregations