disable aniview

This commit is contained in:
zeppi 2021-08-23 11:05:33 -04:00 committed by jessopb
parent d5a330a390
commit 4e3b07ede5
2 changed files with 24 additions and 22 deletions

View file

@ -5,7 +5,7 @@ import { lazyImport } from 'util/lazyImport';
import classnames from 'classnames';
import analytics from 'analytics';
import { buildURI, parseURI } from 'lbry-redux';
import { SIMPLE_SITE, ENABLE_PREROLL_ADS } from 'config';
import { SIMPLE_SITE } from 'config';
import Router from 'component/router/index';
import ReactModal from 'react-modal';
import { openContextMenu } from 'util/context-menu';
@ -325,21 +325,21 @@ function App(props: Props) {
}
}, [previousRewardApproved, isRewardApproved]);
// Load IMA3 SDK for aniview
// Load IMA3 SDK for aniview: DISABLED FOR NOW
// @if TARGET='web'
useEffect(() => {
if (ENABLE_PREROLL_ADS) {
const script = document.createElement('script');
script.src = `https://imasdk.googleapis.com/js/sdkloader/ima3.js`;
script.async = true;
// $FlowFixMe
document.body.appendChild(script);
return () => {
// $FlowFixMe
document.body.removeChild(script);
};
}
});
// useEffect(() => {
// if (ENABLE_PREROLL_ADS) {
// const script = document.createElement('script');
// script.src = `https://imasdk.googleapis.com/js/sdkloader/ima3.js`;
// script.async = true;
// // $FlowFixMe
// document.body.appendChild(script);
// return () => {
// // $FlowFixMe
// document.body.removeChild(script);
// };
// }
// });
// @endif
// @if TARGET='app'

View file

@ -1,6 +1,6 @@
// @flow
import React, { useEffect, useRef, useState } from 'react';
import { SIMPLE_SITE } from 'config';
// import { SIMPLE_SITE } from 'config';
import Button from 'component/button';
import * as ICONS from 'constants/icons';
import classnames from 'classnames';
@ -14,7 +14,8 @@ import recsys from './plugins/videojs-recsys/plugin';
import qualityLevels from 'videojs-contrib-quality-levels';
import isUserTyping from 'util/detect-typing';
// @if TARGET='web'
import './plugins/videojs-aniview/plugin';
// Disabled for now.
// import './plugins/videojs-aniview/plugin';
// @endif
const isDev = process.env.NODE_ENV !== 'production';
@ -56,7 +57,7 @@ type Props = {
adUrl: ?string,
claimId: ?string,
userId: ?number,
allowPreRoll: ?boolean,
// allowPreRoll: ?boolean,
shareTelemetry: boolean,
};
@ -194,7 +195,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
adUrl,
claimId,
userId,
allowPreRoll,
// allowPreRoll,
shareTelemetry,
} = props;
@ -587,9 +588,10 @@ export default React.memo<Props>(function VideoJs(props: Props) {
// otherwise a race condition occurs if we place this in the onReady call back
// allow if isDev because otherwise you'll never see ads when basing to master
// @if TARGET='web'
if ((allowPreRoll && SIMPLE_SITE) || isDev) {
vjs.aniview();
}
// DISABLED FOR NOW
// if ((allowPreRoll && SIMPLE_SITE) || isDev) {
// vjs.aniview();
// }
// @endif
// fixes #3498 (https://github.com/lbryio/lbry-desktop/issues/3498)