add ads script to head for test

This commit is contained in:
Sean Yesmunt 2020-11-02 12:00:49 -05:00
parent 1eec5a182d
commit e6016538b4
5 changed files with 7590 additions and 23 deletions

File diff suppressed because it is too large Load diff

View file

@ -7,8 +7,9 @@ import videojs from 'video.js/dist/alt/video.core.novtt.min.js';
import 'video.js/dist/alt/video-js-cdn.min.css';
import eventTracking from 'videojs-event-tracking';
import isUserTyping from 'util/detect-typing';
import './adstest.js';
import './adstest.css';
// import './adstest.js';
// import './adstest2.js';
// import './adstest.css';
const isDev = process.env.NODE_ENV !== 'production';
@ -82,7 +83,7 @@ if (!Object.keys(videojs.getPlugins()).includes('eventTracking')) {
properties for this component should be kept to ONLY those that if changed should REQUIRE an entirely new videojs element
*/
export default React.memo<Props>(function VideoJs(props: Props) {
const { startMuted, source, sourceType, poster, isAudio, onPlayerReady, adsTest } = props;
const { startMuted, source, sourceType, poster, isAudio, onPlayerReady } = props;
const [reload, setReload] = useState('initial');
let player: ?Player;
@ -102,22 +103,20 @@ export default React.memo<Props>(function VideoJs(props: Props) {
playsinline: IS_IOS,
};
if (adsTest) {
videoJsOptions.sources = [
{
src:
'https://cdn.lbryplayer.xyz/api/v3/streams/free/ted-cruz-obliterates-jack-dorsey/9c1d2dec8fd668a79966da4218b2c4d850f7e3c6/bd9c0e',
type: 'video/mp4',
},
];
// $FlowFixMe
videoJsOptions.plugins.vastClient = {
adTagUrl: 'https://rozamimo9za10.com/ceef/gdt3g0/tbt/1794126/tlk.xml',
adsCancelTimeout: 5000,
adsEnabled: true,
};
}
// if (adsTest) {
// videoJsOptions.sources = [
// {
// src:
// 'https://cdn.lbryplayer.xyz/api/v3/streams/free/ted-cruz-obliterates-jack-dorsey/9c1d2dec8fd668a79966da4218b2c4d850f7e3c6/bd9c0e',
// type: 'video/mp4',
// },
// ];
// // videoJsOptions.plugins.vastClient = {
// // adTagUrl: 'https://rozamimo9za10.com/ceef/gdt3g0/tbt/1794126/tlk.xml',
// // adsCancelTimeout: 5000,
// // adsEnabled: true,
// // };
// }
videoJsOptions.muted = startMuted;

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View file

@ -1,14 +1,28 @@
// @flow
import * as React from 'react';
import Page from 'component/page';
import VideoJs from 'component/viewers/videoViewer/internal/videojs';
// import VideoJs from 'component/viewers/videoViewer/internal/videojs';
export default function AdsTestPage() {
const [show, setShow] = React.useState(false);
React.useEffect(() => {
const script = document.createElement('script');
script.src = 'https://sdk.adspruce.com/1/adsprucetag.js?pid=8394&sid=2"';
script.defer = true;
document.head.appendChild(script);
}, []);
React.useEffect(() => {
setTimeout(() => {
setShow(true);
}, 3000);
}, []);
export default function CheckoutPage() {
return (
<Page className="ads-test">
<h1>ads test</h1>
{/* $FlowFixMe */}
<VideoJs adsTest />
{/* {show && <VideoJs adsTest />} */}
</Page>
);
}

View file

@ -359,3 +359,8 @@ textarea {
.ads-test {
height: 50vh;
}
.adspruce-bannerspot {
height: 5rem;
width: 100%;
}