embed preferred no end (#7138)
This commit is contained in:
parent
7303abcda6
commit
432c40fb0c
2 changed files with 8 additions and 1 deletions
|
@ -6,6 +6,7 @@ import {
|
|||
COLLECTIONS_CONSTS,
|
||||
makeSelectNextUrlForCollectionAndUrl,
|
||||
makeSelectPreviousUrlForCollectionAndUrl,
|
||||
makeSelectTagInClaimOrChannelForUri,
|
||||
} from 'lbry-redux';
|
||||
import {
|
||||
doChangeVolume,
|
||||
|
@ -24,6 +25,7 @@ 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;
|
||||
|
@ -54,6 +56,7 @@ 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),
|
||||
|
|
|
@ -64,6 +64,7 @@ type Props = {
|
|||
previousListUri: string,
|
||||
videoTheaterMode: boolean,
|
||||
isMarkdownOrComment: boolean,
|
||||
preferEmbed: boolean,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -106,6 +107,7 @@ function VideoViewer(props: Props) {
|
|||
previousListUri,
|
||||
videoTheaterMode,
|
||||
isMarkdownOrComment,
|
||||
preferEmbed,
|
||||
} = props;
|
||||
const permanentUrl = claim && claim.permanent_url;
|
||||
const adApprovedChannelIds = homepageData ? getAllIds(homepageData) : [];
|
||||
|
@ -353,7 +355,9 @@ function VideoViewer(props: Props) {
|
|||
|
||||
// first play tracking, used for initializing the watchman api
|
||||
player.on('tracking:firstplay', doTrackingFirstPlay);
|
||||
player.on('ended', () => setEnded(true));
|
||||
player.on('ended', () => {
|
||||
if (!preferEmbed) setEnded(true);
|
||||
});
|
||||
player.on('play', onPlay);
|
||||
player.on('pause', (event) => onPause(event, player));
|
||||
player.on('dispose', (event) => onDispose(event, player));
|
||||
|
|
Loading…
Add table
Reference in a new issue