com.brightcove.player.model.Video.getId()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中com.brightcove.player.model.Video.getId()方法的一些代码示例,展示了Video.getId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Video.getId()方法的具体详情如下:
包路径:com.brightcove.player.model.Video
类名称:Video
方法名:getId

Video.getId介绍

暂无

代码示例

代码示例来源: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 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

/**
 * Build the index map.
 */
private void buildIndexMap() {
  indexMap.clear();
  if (videoList != null) {
    int index = 0;
    for (Video video : videoList) {
      indexMap.put(video.getId(), index++);
    }
  }
  notifyDataSetChanged();
}

代码示例来源:origin: BrightcoveOS/android-player-samples

/**
 * Removes a video from the list.
 *
 * @param video the video to be removed.
 */
void removeVideo(Video video) {
  String videoId = video.getId();
  if (indexMap.containsKey(videoId)) {
    int index = indexMap.remove(videoId);
    videoList.remove(index);
    buildIndexMap();
  }
}

代码示例来源:origin: BrightcoveOS/android-player-samples

/**
 * Build the index map.
 */
private void buildIndexMap() {
  indexMap.clear();
  if (videoList != null) {
    int index = 0;
    for (Video video : videoList) {
      indexMap.put(video.getId(), index++);
    }
  }
  notifyDataSetChanged();
}

代码示例来源:origin: BrightcoveOS/android-player-samples

/**
 * Causes item display for the specified video to be updated.
 *
 * @param video  the video that changed
 * @param status optional current download status.
 */
void notifyVideoChanged(@NonNull Video video, @Nullable DownloadStatus status) {
  String videoId = video.getId();
  if (indexMap.containsKey(videoId)) {
    int index = indexMap.get(videoId);
    videoList.set(index, video);
    notifyItemChanged(index, status);
  }
}

代码示例来源:origin: BrightcoveOS/android-player-samples

@Override
public void itemClicked(View view, Video video, int position) {
  Intent intent = new Intent(this, VideoPlayerActivity.class);
  intent.putExtra(VideoPlayerActivity.INTENT_EXTRA_VIDEO_ID, video.getId());
  Pair<View, String> imagePair = Pair
      .create(view, getString(R.string.transition_image));
  //noinspection unchecked
  ActivityOptionsCompat options = ActivityOptionsCompat
      .makeSceneTransitionAnimation(this, imagePair);
  ActivityCompat.startActivity(this, intent, options.toBundle());
}

代码示例来源: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);
  }
}

代码示例来源: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);
    }
  }
}

相关文章