Search in sources :

Example 1 with OfflineCatalog

use of com.brightcove.player.edge.OfflineCatalog 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);
}
Also used : EventEmitter(com.brightcove.player.event.EventEmitter) OfflineCatalog(com.brightcove.player.edge.OfflineCatalog) RecyclerView(android.support.v7.widget.RecyclerView) ArrayAdapter(android.widget.ArrayAdapter)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)1 ArrayAdapter (android.widget.ArrayAdapter)1 OfflineCatalog (com.brightcove.player.edge.OfflineCatalog)1 EventEmitter (com.brightcove.player.event.EventEmitter)1