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

View file

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

View file

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