aniview only web - v0.1 #6898
2 changed files with 7 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue