display ad in related sidebar for video view page

Co-authored-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
This commit is contained in:
mayeaux 2021-11-11 23:15:50 +01:00 committed by GitHub
parent ef0329e03b
commit d047a748b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,8 @@ import Button from 'component/button';
import classnames from 'classnames';
// $FlowFixMe
const ADS_URL = '//assets.revcontent.com/master/delivery.js';
const ADS_URL =
'https://cdn.vidcrunch.com/integrations/618bb4d28aac298191eec411/Lbry_Odysee.com_Responsive_Floating_DFP_Rev70_1011.js';
const IS_MOBILE = typeof window.orientation !== 'undefined';
type Props = {
@ -32,11 +33,12 @@ function Ads(props: Props) {
try {
const d = document;
const s = 'script';
const n = 'playbuzz-stream';
const n = 'vidcrunch';
let fjs = d.getElementsByTagName(s)[0];
script = d.createElement(s);
script.className = n;
script.src = 'https://stream.playbuzz.com/player/62d1eb10-e362-4873-99ed-c64a4052b43b';
script.src =
'https://cdn.vidcrunch.com/integrations/618bb4d28aac298191eec411/Lbry_Odysee.com_Responsive_Floating_DFP_Rev70_1011.js';
// $FlowFixMe
fjs.parentNode.insertBefore(script, fjs);
} catch (e) {}
@ -47,7 +49,7 @@ function Ads(props: Props) {
if (SHOW_ADS && !IS_MOBILE && type === 'sidebar') {
const script = document.createElement('script');
script.src = ADS_URL;
script.async = true;
script.defer = true;
// $FlowFixMe
document.body.appendChild(script);
return () => {
@ -73,16 +75,15 @@ function Ads(props: Props) {
navigate={`/$/${PAGES.AUTH}?redirect=${pathname}`}
/>
),
download_the_app: <Button button="link" label={__('download the app')} href="https://lbry.com/get" />,
}}
>
Hate these? %log_in_to_domain% or %download_the_app% for an ad free experience.
Hate these? %log_in_to_domain% for an ad free experience.
</I18nMessage>
);
const videoAd = (
<div className="ads__claim-item">
<div id="62d1eb10-e362-4873-99ed-c64a4052b43b" className="ads__injected-video" />
<div id="vidcrunchJS537102317" className="ads__injected-video" style={{display: 'none'}} />
<div
className={classnames('ads__claim-text', {
'ads__claim-text--small': small,
@ -98,13 +99,7 @@ function Ads(props: Props) {
<div className="ads-wrapper">
<p>Ads</p>
<p>{adsSignInDriver}</p>
<div
id="rc-widget-0a74cf"
data-rc-widget
data-widget-host="habitat"
data-endpoint="//trends.revcontent.com"
data-widget-id="117427"
/>
<div id="vidcrunchJS537102317" />
</div>
);