Recsys: add isEmbed to videos in Markdown (posts, comments) (#1765)

* Remove dead-end selector

`playingUri` resides in the `content` slice, so this returns nothing.
Nobody is using it, so should be safe to remove.

* Recsys: add `isEmbed` to videos in Markdown (posts, comments)

It seems like the existing `embedded` needs to specifically mean `/$/embed` (external from odysee.com), so had to add another variable.
This commit is contained in:
infinite-persistence 2022-06-28 20:10:22 +08:00 committed by GitHub
parent 0a88c6254d
commit d3f95e256a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View file

@ -82,7 +82,8 @@ type Props = {
claimId: ?string, claimId: ?string,
title: ?string, title: ?string,
channelTitle: string, channelTitle: string,
embedded: boolean, embedded: boolean, // `/$/embed`
embeddedInternal: boolean, // Markdown (Posts and Comments)
internalFeatureEnabled: ?boolean, internalFeatureEnabled: ?boolean,
isAudio: boolean, isAudio: boolean,
poster: ?string, poster: ?string,
@ -142,6 +143,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
title, title,
channelTitle, channelTitle,
embedded, embedded,
embeddedInternal,
// internalFeatureEnabled, // for people on the team to test new features internally // internalFeatureEnabled, // for people on the team to test new features internally
isAudio, isAudio,
poster, poster,
@ -310,7 +312,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
player.recsys({ player.recsys({
videoId: claimId, videoId: claimId,
userId: userId, userId: userId,
embedded: embedded, embedded: embedded || embeddedInternal,
}); });
} }
@ -381,7 +383,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
vjsPlayer.recsys.options_ = { vjsPlayer.recsys.options_ = {
videoId: claimId, videoId: claimId,
userId: userId, userId: userId,
embedded: embedded, embedded: embedded || embeddedInternal,
}; };
vjsPlayer.recsys.lastTimeUpdate = null; vjsPlayer.recsys.lastTimeUpdate = null;

View file

@ -525,6 +525,7 @@ function VideoViewer(props: Props) {
playNext={doPlayNext} playNext={doPlayNext}
playPrevious={doPlayPrevious} playPrevious={doPlayPrevious}
embedded={embedded} embedded={embedded}
embeddedInternal={isMarkdownOrComment}
claimValues={claim.value} claimValues={claim.value}
doAnalyticsView={doAnalyticsView} doAnalyticsView={doAnalyticsView}
doAnalyticsBuffer={doAnalyticsBuffer} doAnalyticsBuffer={doAnalyticsBuffer}

View file

@ -561,8 +561,6 @@ export const selectIsUriResolving = (state: State, uri: string) => {
return resolvingUris && resolvingUris.includes(uri); return resolvingUris && resolvingUris.includes(uri);
}; };
export const selectPlayingUri = (state: State) => selectState(state).playingUri;
export const selectChannelClaimCounts = createSelector(selectState, (state) => state.channelClaimCounts || {}); export const selectChannelClaimCounts = createSelector(selectState, (state) => state.channelClaimCounts || {});
export const makeSelectPendingClaimForUri = (uri: string) => export const makeSelectPendingClaimForUri = (uri: string) =>