remove old ads code and disable videojs mobile plugin

This commit is contained in:
Sean Yesmunt 2020-12-15 14:06:47 -05:00
parent 62dfaf0709
commit 0d4659472b
8 changed files with 2 additions and 13969 deletions

View file

@ -47,7 +47,6 @@ import BuyPage from 'page/buy';
import NotificationsPage from 'page/notifications';
import SignInWalletPasswordPage from 'page/signInWalletPassword';
import YoutubeSyncPage from 'page/youtubeSync';
import AdsTestPage from 'page/adsTest';
import { LINKED_COMMENT_QUERY_PARAM } from 'constants/comment';
import { parseURI, isURIValid } from 'lbry-redux';
@ -246,8 +245,6 @@ function AppRouter(props: Props) {
<Route path={`/$/${PAGES.INVITE}/:referrer`} exact component={InvitedPage} />
<Route path={`/$/${PAGES.CHECKOUT}`} exact component={CheckoutPage} />
<Route path="/$/adstest" exact component={AdsTestPage} />
<PrivateRoute {...props} exact path={`/$/${PAGES.YOUTUBE_SYNC}`} component={YoutubeSyncPage} />
<PrivateRoute {...props} exact path={`/$/${PAGES.TAGS_FOLLOWING}`} component={TagsFollowingPage} />
<PrivateRoute

View file

@ -1,117 +0,0 @@
/* eslint-disable */
.vjs-label-hidden {
display: none !important;
}
.vjs-default-skin div.vjs-ads-label {
font-size: 13px;
line-height: 30px;
font-weight: 400;
text-align: center;
color: #fff;
display: none;
width: auto;
padding-left: 10px;
}
.vjs-ad-playing .vjs-control.vjs-ads-label {
display: block;
}
.vjs-black-poster {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: 0;
padding: 0;
background-repeat: no-repeat;
background-position: 50% 50%;
background-size: contain;
cursor: pointer;
background-color: #000;
}
.vjs-has-started .vjs-black-poster.vjs-hidden,
.vjs-using-native-controls .vjs-black-poster {
display: none;
}
div.VPAID-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
div.vjs-vpaid-ad div.vjs-progress-control,
div.vjs-vpaid-ad div.vjs-time-controls,
div.vjs-vpaid-ad div.vjs-time-divider {
display: none;
}
div.vjs-vpaid-ad.vjs-vpaid-flash-ad div.VPAID-container {
background-color: #000;
}
div.vjs-vpaid-ad .vjs-tech {
z-index: 0;
}
.vjs-ad-playing .vjs-progress-control {
pointer-events: none;
}
.vjs-ad-playing .vjs-play-control.vjs-paused,
.vjs-ad-playing .vjs-play-progress,
.vjs-ad-playing .vjs-volume-level {
background-color: #ffe400 !important;
}
div.vast-skip-button {
display: block;
position: absolute;
bottom: 20%;
right: 0;
background-color: #000;
color: #fff;
font-size: 15px;
font-weight: 700;
width: auto;
padding: 8px;
z-index: 1;
border: 1px solid #fff;
border-right: none;
}
.vast-skip-button.enabled {
cursor: pointer;
color: #fff;
}
.vast-skip-button.enabled:hover {
cursor: pointer;
background: #333;
}
.vast-blocker {
display: block;
position: absolute;
margin: 0;
padding: 0;
height: 100%;
width: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.vast-skip-button.enabled:after {
content: '>>';
position: relative;
top: 1px;
margin-left: 8px;
}
.vjs-ad-playing.vjs-vast-ad-loading .vjs-loading-spinner {
display: block;
z-index: 2;
-webkit-animation: spin 1.5s infinite linear;
animation: spin 1.5s infinite linear;
}
.vjs-vast-ad-loading div.vjs-big-play-button {
display: none !important;
}
.vjs-ad-playing .vjs-live-controls,
.vjs-ad-playing .vjs-slider-handle:before {
display: none;
}
/*# sourceMappingURL=videojs.vast.vpaid.min.css.map */
/* eslint-enable */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -7,11 +7,8 @@ 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 * as OVERLAY from './overlays';
import './plugins/videojs-mobile-ui/plugin';
// import './plugins/videojs-mobile-ui/plugin';
import isUserTyping from 'util/detect-typing';
import './adstest.js';
// import './adstest2.js';
import './adstest.css';
const isDev = process.env.NODE_ENV !== 'production';
@ -43,7 +40,6 @@ type Props = {
onPlayerReady: Player => void,
isAudio: boolean,
startMuted: boolean,
adsTest?: boolean,
};
type VideoJSOptions = {
@ -140,7 +136,7 @@ class LbryVolumeBarClass extends videojs.getComponent(VIDEOJS_VOLUME_BAR_CLASS)
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;
@ -161,23 +157,6 @@ export default React.memo<Props>(function VideoJs(props: Props) {
},
};
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://serve.adspruce.com/vpaid-8394-3.xml',
adsCancelTimeout: 5000,
adsEnabled: true,
};
}
videoJsOptions.muted = startMuted;
const tapToUnmuteRef = useRef();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View file

@ -1,2 +0,0 @@
import AdsTestPage from './view';
export default AdsTestPage;

View file

@ -1,34 +0,0 @@
// @flow
import * as React from 'react';
import Page from 'component/page';
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;
// $FlowFixMe
document.head.appendChild(script);
}, []);
React.useEffect(() => {
setTimeout(() => {
setShow(true);
}, 1000);
}, []);
return (
<Page className="ads-test">
<h1>ads test</h1>
{show && (
<div style={{ marginTop: '5rem' }}>
{/* $FlowFixMe */}
<VideoJs adsTest />
</div>
)}
</Page>
);
}