From 8a277e767a0e161514fd6b9c474b34cdaa5bad62 Mon Sep 17 00:00:00 2001 From: jessopb <36554050+jessopb@users.noreply.github.com> Date: Tue, 21 Sep 2021 12:47:56 -0400 Subject: [PATCH] revert embedNoEnd and modify preferEmbed end display (#7144) --- ui/component/viewers/videoViewer/index.js | 3 -- ui/component/viewers/videoViewer/view.jsx | 6 +--- .../fileViewerEmbeddedEnded/view.jsx | 36 ++++++++++--------- 3 files changed, 20 insertions(+), 25 deletions(-) diff --git a/ui/component/viewers/videoViewer/index.js b/ui/component/viewers/videoViewer/index.js index 1eaf70075..d9b6ddce1 100644 --- a/ui/component/viewers/videoViewer/index.js +++ b/ui/component/viewers/videoViewer/index.js @@ -6,7 +6,6 @@ import { COLLECTIONS_CONSTS, makeSelectNextUrlForCollectionAndUrl, makeSelectPreviousUrlForCollectionAndUrl, - makeSelectTagInClaimOrChannelForUri, } from 'lbry-redux'; import { doChangeVolume, @@ -25,7 +24,6 @@ import { doClaimEligiblePurchaseRewards } from 'redux/actions/rewards'; import { selectDaemonSettings, makeSelectClientSetting, selectHomepageData } from 'redux/selectors/settings'; import { toggleVideoTheaterMode, toggleAutoplayNext, doSetClientSetting } from 'redux/actions/settings'; import { selectUserVerifiedEmail, selectUser } from 'redux/selectors/user'; -import { PREFERENCE_EMBED } from 'constants/tags'; const select = (state, props) => { const { search } = props.location; @@ -56,7 +54,6 @@ const select = (state, props) => { nextRecommendedUri, previousListUri, isMarkdownOrComment, - preferEmbed: makeSelectTagInClaimOrChannelForUri(props.uri, PREFERENCE_EMBED)(state), autoplayIfEmbedded: Boolean(autoplay), autoplayNext: makeSelectClientSetting(SETTINGS.AUTOPLAY_NEXT)(state), volume: selectVolume(state), diff --git a/ui/component/viewers/videoViewer/view.jsx b/ui/component/viewers/videoViewer/view.jsx index 8e5ff1687..efe534dd1 100644 --- a/ui/component/viewers/videoViewer/view.jsx +++ b/ui/component/viewers/videoViewer/view.jsx @@ -64,7 +64,6 @@ type Props = { previousListUri: string, videoTheaterMode: boolean, isMarkdownOrComment: boolean, - preferEmbed: boolean, }; /* @@ -107,7 +106,6 @@ function VideoViewer(props: Props) { previousListUri, videoTheaterMode, isMarkdownOrComment, - preferEmbed, } = props; const permanentUrl = claim && claim.permanent_url; const adApprovedChannelIds = homepageData ? getAllIds(homepageData) : []; @@ -355,9 +353,7 @@ function VideoViewer(props: Props) { // first play tracking, used for initializing the watchman api player.on('tracking:firstplay', doTrackingFirstPlay); - player.on('ended', () => { - if (!preferEmbed) setEnded(true); - }); + player.on('ended', () => setEnded(true)); player.on('play', onPlay); player.on('pause', (event) => onPause(event, player)); player.on('dispose', (event) => onDispose(event, player)); diff --git a/web/component/fileViewerEmbeddedEnded/view.jsx b/web/component/fileViewerEmbeddedEnded/view.jsx index d365146b5..69aac3e9f 100644 --- a/web/component/fileViewerEmbeddedEnded/view.jsx +++ b/web/component/fileViewerEmbeddedEnded/view.jsx @@ -44,23 +44,25 @@ function FileViewerEmbeddedEnded(props: Props) { - {!preferEmbed && ( + +
+

{prompt}

+
+
<> -
-

{prompt}

-
-
+ {showReplay && ( +
+ )} - )} +
); }