enable show internal feature
This commit is contained in:
parent
59a9f46c29
commit
85447185a8
3 changed files with 15 additions and 4 deletions
|
@ -30,9 +30,11 @@ const select = (state, props) => {
|
|||
const urlParams = new URLSearchParams(search);
|
||||
const autoplay = urlParams.get('autoplay');
|
||||
const uri = props.uri;
|
||||
|
||||
// TODO: eventually this should be received from DB and not local state (https://github.com/lbryio/lbry-desktop/issues/6796)
|
||||
const position = urlParams.get('t') !== null ? urlParams.get('t') : makeSelectContentPositionForUri(uri)(state);
|
||||
const userId = selectUser(state) && selectUser(state).id;
|
||||
const internalFeature = selectUser(state) && selectUser(state).internal_feature;
|
||||
const playingUri = selectPlayingUri(state);
|
||||
const collectionId = urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID) || (playingUri && playingUri.collectionId);
|
||||
const isMarkdownOrComment = playingUri && (playingUri.source === 'markdown' || playingUri.source === 'comment');
|
||||
|
@ -50,6 +52,7 @@ const select = (state, props) => {
|
|||
return {
|
||||
position,
|
||||
userId,
|
||||
internalFeature,
|
||||
collectionId,
|
||||
nextRecommendedUri,
|
||||
previousListUri,
|
||||
|
|
|
@ -60,7 +60,8 @@ type Props = {
|
|||
adUrl: ?string,
|
||||
claimId: ?string,
|
||||
userId: ?number,
|
||||
// allowPreRoll: ?boolean,
|
||||
allowPreRoll: ?boolean,
|
||||
internalFeatureEnabled: ?boolean,
|
||||
shareTelemetry: boolean,
|
||||
replay: boolean,
|
||||
videoTheaterMode: boolean,
|
||||
|
@ -193,6 +194,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
|||
claimId,
|
||||
userId,
|
||||
allowPreRoll,
|
||||
internalFeatureEnabled,
|
||||
shareTelemetry,
|
||||
replay,
|
||||
videoTheaterMode,
|
||||
|
@ -553,11 +555,14 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
|||
// this seems like a weird thing to have to check for here
|
||||
if (!player) return;
|
||||
|
||||
if (allowPreRoll && hitsTwentyPercent()) {
|
||||
// always have ads on if internal feature is on,
|
||||
// otherwise if not authed, roll for 20% to see an ad
|
||||
const shouldShowAnAd = internalFeatureEnabled || (allowPreRoll && hitsTwentyPercent());
|
||||
|
||||
if (shouldShowAnAd) {
|
||||
vjs.aniview();
|
||||
}
|
||||
|
||||
|
||||
// Add various event listeners to player
|
||||
player.one('play', onInitialPlay);
|
||||
player.on('play', resolveCtrlText);
|
||||
|
|
|
@ -55,6 +55,7 @@ type Props = {
|
|||
setVideoPlaybackRate: (number) => void,
|
||||
authenticated: boolean,
|
||||
userId: number,
|
||||
internalFeature: boolean,
|
||||
homepageData?: { [string]: HomepageCat },
|
||||
shareTelemetry: boolean,
|
||||
isFloating: boolean,
|
||||
|
@ -98,6 +99,7 @@ function VideoViewer(props: Props) {
|
|||
homepageData,
|
||||
authenticated,
|
||||
userId,
|
||||
internalFeature,
|
||||
shareTelemetry,
|
||||
isFloating,
|
||||
doPlayUri,
|
||||
|
@ -467,7 +469,8 @@ function VideoViewer(props: Props) {
|
|||
autoplaySetting={autoplayNext}
|
||||
claimId={claimId}
|
||||
userId={userId}
|
||||
allowPreRoll={!authenticated}
|
||||
allowPreRoll={!authenticated} // used to not include embeds, removed for now
|
||||
internalFeatureEnabled={internalFeature}
|
||||
shareTelemetry={shareTelemetry}
|
||||
replay={replay}
|
||||
videoTheaterMode={videoTheaterMode}
|
||||
|
|
Loading…
Reference in a new issue