diff --git a/ui/component/viewers/videoViewer/internal/plugins/videojs-aniview/plugin.js b/ui/component/viewers/videoViewer/internal/plugins/videojs-aniview/plugin.js index f51502be8..0dcdc20be 100644 --- a/ui/component/viewers/videoViewer/internal/plugins/videojs-aniview/plugin.js +++ b/ui/component/viewers/videoViewer/internal/plugins/videojs-aniview/plugin.js @@ -97,7 +97,7 @@ class AniviewPlugin extends Component { } } -videojs.registerComponent('recsys', AniviewPlugin); +videojs.registerComponent('aniview', AniviewPlugin); const onPlayerReady = (player, options) => { player.aniview = new AniviewPlugin(player, options); diff --git a/ui/component/viewers/videoViewer/internal/videojs.jsx b/ui/component/viewers/videoViewer/internal/videojs.jsx index 29366c338..d27bf7f1d 100644 --- a/ui/component/viewers/videoViewer/internal/videojs.jsx +++ b/ui/component/viewers/videoViewer/internal/videojs.jsx @@ -13,8 +13,9 @@ import hlsQualitySelector from './plugins/videojs-hls-quality-selector/plugin'; 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'; - +// @endif const isDev = process.env.NODE_ENV !== 'production'; export type Player = { @@ -585,9 +586,11 @@ export default React.memo<Props>(function VideoJs(props: Props) { // This must be initialized earlier than everything else // 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(); } + // @endif // fixes #3498 (https://github.com/lbryio/lbry-desktop/issues/3498) // summary: on firefox the focus would stick to the fullscreen button which caused buggy behavior with spacebar @@ -662,6 +665,7 @@ export default React.memo<Props>(function VideoJs(props: Props) { }, [source, reload]); // Load IMA3 SDK for aniview + // @if TARGET='web' useEffect(() => { const script = document.createElement('script'); script.src = `https://imasdk.googleapis.com/js/sdkloader/ima3.js`; @@ -674,6 +678,7 @@ export default React.memo<Props>(function VideoJs(props: Props) { document.body.removeChild(script); }; }); + // @endif return ( // $FlowFixMe