revert embedNoEnd and modify preferEmbed end display (#7144)

This commit is contained in:
jessopb 2021-09-21 12:47:56 -04:00 committed by GitHub
parent aefa889ee4
commit 8a277e767a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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,23 +44,25 @@ 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>
<div className="file-viewer__overlay-actions">
<>
<div className="file-viewer__overlay-title file-viewer_embed-ended-title">
<p>{prompt}</p>
</div>
<div className="file-viewer__overlay-actions">
{showReplay && (
<Button
title={__('Replay')}
button="link"
label={preferEmbed ? __('Replay') : undefined}
iconRight={ICONS.REPLAY}
onClick={() => {
if (window.player) window.player.play();
}}
/>
)}
{!preferEmbed && (
<>
{showReplay && (
<Button
title={__('Replay')}
button="link"
iconRight={ICONS.REPLAY}
onClick={() => {
if (window.player) window.player.play();
}}
/>
)}
<Button label={__('Discuss')} iconRight={ICONS.EXTERNAL} button="primary" href={lbrytvLink} />
{!isAuthenticated && (
<Button
@ -70,9 +72,9 @@ function FileViewerEmbeddedEnded(props: Props) {
/>
)}
</>
</div>
)}
</>
)}
</div>
</div>
);
}