本文整理汇总了Java中com.google.android.gms.cast.framework.media.RemoteMediaClient.queueJumpToItem方法的典型用法代码示例。如果您正苦于以下问题:Java RemoteMediaClient.queueJumpToItem方法的具体用法?Java RemoteMediaClient.queueJumpToItem怎么用?Java RemoteMediaClient.queueJumpToItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.cast.framework.media.RemoteMediaClient
的用法示例。
在下文中一共展示了RemoteMediaClient.queueJumpToItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onUpcomingPlayClicked
import com.google.android.gms.cast.framework.media.RemoteMediaClient; //导入方法依赖的package包/类
public void onUpcomingPlayClicked(View view, MediaQueueItem upcomingItem) {
RemoteMediaClient remoteMediaClient = getRemoteMediaClient();
if (remoteMediaClient == null) {
return;
}
remoteMediaClient.queueJumpToItem(upcomingItem.getItemId(), null);
}
示例2: onContainerClicked
import com.google.android.gms.cast.framework.media.RemoteMediaClient; //导入方法依赖的package包/类
private void onContainerClicked(View view) {
RemoteMediaClient remoteMediaClient = getRemoteMediaClient();
if (remoteMediaClient == null) {
return;
}
MediaQueueItem item = (MediaQueueItem) view.getTag(R.string.queue_tag_item);
if (mProvider.isQueueDetached()) {
Log.d(TAG, "Is detached: itemId = " + item.getItemId());
int currentPosition = mProvider.getPositionByItemId(item.getItemId());
MediaQueueItem[] items = Utils.rebuildQueue(mProvider.getItems());
remoteMediaClient.queueLoad(items, currentPosition,
MediaStatus.REPEAT_MODE_REPEAT_OFF, null);
} else {
int currentItemId = mProvider.getCurrentItemId();
if (currentItemId == item.getItemId()) {
// We selected the one that is currently playing so we take the user to the
// full screen controller
CastSession castSession = CastContext.getSharedInstance(
getContext().getApplicationContext())
.getSessionManager().getCurrentCastSession();
if (castSession != null) {
Intent intent = new Intent(getActivity(), ExpandedControlsActivity.class);
startActivity(intent);
}
} else {
// a different item in the queue was selected so we jump there
remoteMediaClient.queueJumpToItem(item.getItemId(), null);
}
}
}