Tabnine Logo
OfflineCatalog
Code IndexAdd Tabnine to your IDE (free)

How to use
OfflineCatalog
in
com.brightcove.player.edge

Best Java code snippets using com.brightcove.player.edge.OfflineCatalog (Showing top 11 results out of 315)

origin: BrightcoveOS/android-player-samples

  @Override
  public void deleteVideo(@NonNull Video video) {
    catalog.deleteVideo(video, new OfflineCallback<Boolean>() {
      @Override
      public void onSuccess(Boolean aBoolean) {
      }
      @Override
      public void onFailure(Throwable throwable) {
        Log.e(TAG, "Error deleting video: ", throwable);
      }
    });
  }
};
origin: BrightcoveOS/android-player-samples

@Override
public void rentVideo(@NonNull final Video video) {
  // Fetch the video object again to avoid using the given video that may have been
  // changed by previous download.
  catalog.findVideoByID(video.getId(), new FindVideoListener(video) {
    @Override
    public void onVideo(Video newVideo) {
      MainActivity.this.rentVideo(newVideo);
    }
  });
}
origin: BrightcoveOS/android-player-samples

@Override
public void downloadVideo(@NonNull final Video video) {
  // bundle has all available captions and audio tracks
  catalog.getMediaFormatTracksAvailable(video, new MediaDownloadable.MediaFormatListener() {
    @Override
    public void onResult(MediaDownloadable mediaDownloadable, Bundle bundle) {
      BrightcoveDownloadUtil.selectMediaFormatTracksAvailable(mediaDownloadable, bundle);
      catalog.downloadVideo(video, new OfflineCallback<DownloadStatus>() {
        @Override
        public void onSuccess(DownloadStatus downloadStatus) {
          // Video download started successfully
          videoListAdapter.notifyVideoChanged(video);
        }
        @Override
        public void onFailure(Throwable throwable) {
          Log.e(TAG, "Error initializing video download: ", throwable);
        }
      });
    }
  });
}
origin: BrightcoveOS/android-player-samples

/**
 * 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/*, playlistNames*/);
  playlistAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
}
origin: BrightcoveOS/android-player-samples

private void handleViewState(final ViewHolder holder, Video video, DownloadStatus status) {
  if (video.isOfflinePlaybackAllowed()) {
    holder.estimatedSizeText.setVisibility(View.VISIBLE);
    catalog.estimateSize(video, new MediaDownloadable.OnVideoSizeCallback() {
      @Override
      public void onVideoSizeEstimated(long bytes) {
      holder.videoStatusText.setVisibility(View.VISIBLE);
      catalog.getVideoDownloadStatus(holder.video, new OfflineCallback<DownloadStatus>() {
        @Override
        public void onSuccess(DownloadStatus downloadStatus) {
origin: BrightcoveOS/android-player-samples

@Override
public void pauseVideoDownload(@NonNull Video video) {
  Log.v(TAG,"Calling pauseVideoDownload.");
  catalog.pauseVideoDownload(video, new OfflineCallback<Integer>() {
    @Override
    public void onSuccess(Integer integer) {
      // Video download was paused successfully
    }
    @Override
    public void onFailure(Throwable throwable) {
      Log.e(TAG, "Error pausing video download: ", throwable);
    }
  });
}
origin: BrightcoveOS/android-player-samples

videoListLabel.setVisibility(View.VISIBLE);
videoListLabel.setText(R.string.offline_playlist);
catalog.findAllVideoDownload(
    DownloadStatus.STATUS_COMPLETE,
    new OfflineCallback<List<Video>>() {
origin: BrightcoveOS/android-player-samples

@Override
protected void onStart() {
  super.onStart();
  ConnectivityMonitor.getInstance(this).addListener(connectivityListener);
  catalog.addDownloadEventListener(downloadEventListener);
  updateVideoList();
}
origin: BrightcoveOS/android-player-samples

  void getVideo(final OfflineCallback<Video> callback) {
    final Video result = video;
    if (video.isOfflinePlaybackAllowed()) {
      catalog.findOfflineVideoById(video.getId(), new OfflineCallback<Video>() {
        @Override
        public void onSuccess(Video offlineVideo) {
          if (offlineVideo != null) {
            callback.onSuccess(offlineVideo);
          } else {
            callback.onSuccess(video);
          }
        }
        @Override
        public void onFailure(Throwable throwable) {
          callback.onSuccess(result);
        }
      });
    } else {
      callback.onSuccess(result);
    }
  }
}
origin: BrightcoveOS/android-player-samples

@Override
public void buyVideo(@NonNull final Video video) {
  // Fetch the video object again to avoid using the given video that may have been
  // changed by previous download.
  catalog.findVideoByID(video.getId(), new FindVideoListener(video) {
    @Override
    public void onVideo(Video newVideo) {
      catalog.requestPurchaseLicense(video, licenseEventListener);
    }
  });
}
origin: BrightcoveOS/android-player-samples

/**
 * Called when an offline copy of the video is either cancelled or deleted.
 *
 * @param video the video that was removed.
 */
private void onDownloadRemoved(@NonNull final Video video) {
  if (connectivityMonitor.isConnected()) {
    // Fetch the video object again to avoid using the given video that may have been
    // tainted by previous download.
    catalog.findVideoByID(video.getId(), new FindVideoListener(video) {
      @Override
      public void onVideo(Video newVideo) {
        videoListAdapter.notifyVideoChanged(newVideo);
      }
    });
  } else {
    videoListAdapter.removeVideo(video);
    onVideoListUpdated(false);
  }
}
com.brightcove.player.edgeOfflineCatalog

Most used methods

  • <init>
  • addDownloadEventListener
  • deleteVideo
  • estimateSize
  • findAllVideoDownload
  • findOfflineVideoById
  • findVideoByID
  • getMediaFormatTracksAvailable
  • getVideoDownloadStatus
  • pauseVideoDownload
  • removeDownloadEventListener
  • requestRentalLicense
  • removeDownloadEventListener,
  • requestRentalLicense,
  • resumeVideoDownload,
  • setMeteredDownloadAllowed,
  • setMobileDownloadAllowed,
  • setRoamingDownloadAllowed

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getResourceAsStream (ClassLoader)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • String (java.lang)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • JTable (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now