本文整理汇总了Java中com.google.android.gms.cast.MediaStatus.getQueueItemById方法的典型用法代码示例。如果您正苦于以下问题:Java MediaStatus.getQueueItemById方法的具体用法?Java MediaStatus.getQueueItemById怎么用?Java MediaStatus.getQueueItemById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.cast.MediaStatus
的用法示例。
在下文中一共展示了MediaStatus.getQueueItemById方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: syncWithRemoteQueue
import com.google.android.gms.cast.MediaStatus; //导入方法依赖的package包/类
private void syncWithRemoteQueue() {
RemoteMediaClient remoteMediaClient = getRemoteMediaClient();
if (remoteMediaClient != null) {
remoteMediaClient.addListener(mRemoteMediaClientListener);
MediaStatus mediaStatus = remoteMediaClient.getMediaStatus();
if (mediaStatus != null) {
List<MediaQueueItem> items = mediaStatus.getQueueItems();
if (items != null && !items.isEmpty()) {
mQueue.clear();
mQueue.addAll(items);
mRepeatMode = mediaStatus.getQueueRepeatMode();
mCurrentIem = mediaStatus.getQueueItemById(mediaStatus.getCurrentItemId());
mDetachedQueue = false;
mUpcomingItem = mediaStatus.getQueueItemById(mediaStatus.getPreloadedItemId());
}
}
}
}
示例2: onPreloadStatusUpdated
import com.google.android.gms.cast.MediaStatus; //导入方法依赖的package包/类
@Override
public void onPreloadStatusUpdated() {
RemoteMediaClient remoteMediaClient = getRemoteMediaClient();
if (remoteMediaClient == null) {
return;
}
MediaStatus mediaStatus = remoteMediaClient.getMediaStatus();
if (mediaStatus == null) {
return;
}
mUpcomingItem = mediaStatus.getQueueItemById(mediaStatus.getPreloadedItemId());
Log.d(TAG, "onRemoteMediaPreloadStatusUpdated() with item=" + mUpcomingItem);
if (mListener != null) {
mListener.onQueueDataChanged();
}
}
示例3: updateMediaQueue
import com.google.android.gms.cast.MediaStatus; //导入方法依赖的package包/类
private void updateMediaQueue() {
RemoteMediaClient remoteMediaClient = getRemoteMediaClient();
MediaStatus mediaStatus;
List<MediaQueueItem> queueItems = null;
if (remoteMediaClient != null) {
mediaStatus = remoteMediaClient.getMediaStatus();
if (mediaStatus != null) {
queueItems = mediaStatus.getQueueItems();
mRepeatMode = mediaStatus.getQueueRepeatMode();
mCurrentIem = mediaStatus.getQueueItemById(mediaStatus.getCurrentItemId());
}
}
mQueue.clear();
if (queueItems == null) {
Log.d(TAG, "Queue is cleared");
} else {
Log.d(TAG, "Queue is updated with a list of size: " + queueItems.size());
if (queueItems.size() > 0) {
mQueue.addAll(queueItems);
mDetachedQueue = false;
} else {
mDetachedQueue = true;
}
}
}