revert embedNoEnd and modify preferEmbed end display

This commit is contained in:
zeppi 2021-09-21 11:38:12 -04:00
parent b42e882a02
commit 8335974963
3 changed files with 20 additions and 25 deletions

View file

@ -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),

View file

@ -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));

View file

@ -44,8 +44,7 @@ function FileViewerEmbeddedEnded(props: Props) {
<Logo type={'embed'} />
</Button>
</div>
{!preferEmbed && (
<>
<div className="file-viewer__overlay-title file-viewer_embed-ended-title">
<p>{prompt}</p>
</div>
@ -55,12 +54,15 @@ function FileViewerEmbeddedEnded(props: Props) {
<Button
title={__('Replay')}
button="link"
label={preferEmbed ? __('Replay') : undefined}
iconRight={ICONS.REPLAY}
onClick={() => {
if (window.player) window.player.play();
}}
/>
)}
{!preferEmbed && (
<>
<Button label={__('Discuss')} iconRight={ICONS.EXTERNAL} button="primary" href={lbrytvLink} />
{!isAuthenticated && (
<Button
@ -70,9 +72,9 @@ function FileViewerEmbeddedEnded(props: Props) {
/>
)}
</>
</div>
</>
)}
</>
</div>
</div>
);
}