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

View file

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