diff --git a/ui/component/claimMenuList/view.jsx b/ui/component/claimMenuList/view.jsx
index b444a804e..36085b24d 100644
--- a/ui/component/claimMenuList/view.jsx
+++ b/ui/component/claimMenuList/view.jsx
@@ -340,9 +340,9 @@ function ClaimMenuList(props: Props) {
)}
>
) : (
- isPlayable && (
- <>
- {/* WATCH LATER */}
+ <>
+ {/* WATCH LATER */}
+ {isPlayable && (
- {/* FAVORITES LIST */}
+ )}
+ {/* FAVORITES LIST */}
+
+ {/* CURRENTLY ONLY SUPPORT PLAYLISTS FOR PLAYABLE; LATER DIFFERENT TYPES */}
+
+ {lastUsedCollection && lastUsedCollectionIsNotBuiltin && (
- {/* CURRENTLY ONLY SUPPORT PLAYLISTS FOR PLAYABLE; LATER DIFFERENT TYPES */}
-
- {lastUsedCollection && lastUsedCollectionIsNotBuiltin && (
-
- )}
-
- >
- )
+ )}
+
+ >
)}
>
{!isChannelPage && (
diff --git a/ui/component/viewers/videoViewer/index.js b/ui/component/viewers/videoViewer/index.js
index 3b1f0df8a..6d6bc67db 100644
--- a/ui/component/viewers/videoViewer/index.js
+++ b/ui/component/viewers/videoViewer/index.js
@@ -34,12 +34,38 @@ const select = (state, props) => {
const playingUri = selectPlayingUri(state);
const collectionId = urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID) || (playingUri && playingUri.collectionId);
const isMarkdownOrComment = playingUri && (playingUri.source === 'markdown' || playingUri.source === 'comment');
+ const isClaimPlayable = (uri) => {
+ const claim = makeSelectClaimForUri(uri)(state);
+ // $FlowFixMe
+ return (
+ claim &&
+ // $FlowFixMe
+ claim.value &&
+ // $FlowFixMe
+ claim.value.stream_type &&
+ // $FlowFixMe
+ (claim.value.stream_type === 'audio' || claim.value.stream_type === 'video')
+ );
+ };
+ const nextUriInCollection = (fromUri) => {
+ return makeSelectNextUrlForCollectionAndUrl(collectionId, fromUri)(state);
+ };
+ const prevUriInCollection = (fromUri) => {
+ return makeSelectPreviousUrlForCollectionAndUrl(collectionId, fromUri)(state);
+ };
let nextRecommendedUri;
let previousListUri;
if (collectionId) {
- nextRecommendedUri = makeSelectNextUrlForCollectionAndUrl(collectionId, uri)(state);
- previousListUri = makeSelectPreviousUrlForCollectionAndUrl(collectionId, uri)(state);
+ nextRecommendedUri = uri;
+ previousListUri = uri;
+ // Find previous and next playable item in the collection.
+ do {
+ nextRecommendedUri = nextUriInCollection(nextRecommendedUri);
+ } while (nextRecommendedUri && !isClaimPlayable(nextRecommendedUri));
+ do {
+ previousListUri = prevUriInCollection(previousListUri);
+ } while (previousListUri && !isClaimPlayable(previousListUri));
} else {
const recommendedContent = selectRecommendedContentForUri(state, uri);
nextRecommendedUri = recommendedContent && recommendedContent[0];