11import React from 'react' ;
2- import videojs from 'video.js' ;
32import throttle from 'lodash/throttle' ;
4-
5- import 'videojs-overlay' ;
6- import 'videojs-playlist' ;
7- import 'imports-loader?videojs=video.js!videojs-vast-vpaid/dist/videojs_5.vast.vpaid' ;
83import 'whatwg-fetch' ;
94
10- import Player from './Player.jsx ' ;
5+ import Player from './Player' ;
116
127import { itn , bristolsport , londontheinside , spectator , telegraph } from './playlist' ;
138
@@ -44,15 +39,14 @@ function getClient() {
4439 : href . indexOf ( url ) !== - 1 ;
4540 }
4641
47-
4842 return 'unknown' ;
4943}
5044
5145const CLIENT = getClient ( ) ;
5246
5347class App extends React . Component {
5448 static getVideos ( url , client ) {
55- let endpoint = `https://api .suggestv.io/semantics?url=${ url } ` ;
49+ let endpoint = `https://uat .suggestv.io/semantics?url=${ url } ` ;
5650
5751 if ( client === 'telegraph' ) {
5852 endpoint += `&client=${ client } ` ;
@@ -77,14 +71,15 @@ class App extends React.Component {
7771 static getAdTag ( player , cb ) {
7872 const height = player . currentHeight ( ) ;
7973 const width = player . currentWidth ( ) ;
74+ const url = window . location . href ;
8075 const { title, videoId, sources, description } = player . playlist ( ) [ 0 ] ;
8176 const tremorUrl = 'https://fp31r.ads.tremorhub.com/ad/tag?adCode=m523r-uxl0e' ;
82- const playerInfo = `playerWidth=${ width } &playerHeight=${ height } &srcPageUrl=${ window . location . href } ` ;
77+ const playerInfo = `playerWidth=${ width } &playerHeight=${ height } &srcPageUrl=${ url } ` ;
8378 const mediaInfo = `mediaId=${ videoId } &mediaUrl=${ sources [ 0 ] . src } &mediaTitle=${ encodeURIComponent ( title ) } &mediaDesc=${ encodeURIComponent ( description ) } ` ;
8479 const adTag = `${ tremorUrl } &${ playerInfo } &${ mediaInfo } ` ;
8580 const tmgAdsBuildAd = window . tmgAdsBuildAd ;
8681
87- if ( CLIENT === 'client-test' ) return cb ( null , '' ) ;
82+ if ( CLIENT === 'client-test' ) return cb ( null , `https://req.tidaltv.com/ppm.ashx?logs=0&mt=1&pid=1&fmid=521675&xf=7&ap=0&rand= ${ Date . now ( ) } &refUrl= ${ url } ` ) ;
8883 if ( CLIENT === 'cityam' ) return cb ( null , 'https://ad.360yield.com/advast?p=1023878&w=16&h=9' ) ;
8984 if ( CLIENT === 'spectator' ) return cb ( null , 'https://ad.360yield.com/advast?p=1021575&w=4&h=3' ) ;
9085 if ( CLIENT === 'prospectmagazine' ) return cb ( null , 'https://ad.360yield.com/advast?p=1021574&w=4&h=3' ) ;
@@ -97,7 +92,7 @@ class App extends React.Component {
9792 if ( CLIENT === 'sovrnuk' ) return cb ( null , 'https://ap.lijit.com/www/delivery/vst.php?zoneid=458676' ) ;
9893 if ( CLIENT === 'sovrnus' ) return cb ( null , 'http://ap.lijit.com/www/delivery/vst.php?zoneid=463506' ) ;
9994 if ( CLIENT === 'hitc' ) return cb ( null , 'https://ad.360yield.com/advast?p=1034241&w=4&h=3' ) ;
100- if ( CLIENT === 'clickon' ) return cb ( null , ' https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/14188402/Soccer_Preroll &impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&url=https://soccer.clickon.co/ &description_url=https://soccer.clickon.co/ &correlator=__random-number__' ) ;
95+ if ( CLIENT === 'clickon' ) return cb ( null , ` https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/14188402/CLICKON/preroll &impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&url=${ url } &description_url=${ url } &correlator=${ Date . now ( ) } ` ) ;
10196 if ( CLIENT === 'telegraph' && tmgAdsBuildAd ) {
10297 return App . getPlaylistAdTag ( tmgAdsBuildAd ( 'advert_body_vid' , '' , '' , '' ) . fetchUrl ( ) , cb ) ;
10398 }
@@ -128,7 +123,7 @@ class App extends React.Component {
128123 videosFrom : '' ,
129124 videoJsOptions : {
130125 controls : true ,
131- preload : 'auto ' ,
126+ preload : 'meta ' ,
132127 loop : false ,
133128 muted : true ,
134129 width : 640 ,
@@ -259,7 +254,7 @@ class App extends React.Component {
259254 this . setState ( obj ) ;
260255 }
261256
262- handleScroll ( player ) {
257+ handleScroll ( ) {
263258 const { pausedByUser, playedByUser, flashTestFinished, videoLoaded } = this . state ;
264259 if ( App . isInViewport ( this . playerNode . videoNode ) ) {
265260 if ( this . playerNode . videoNode && ! pausedByUser && videoLoaded && flashTestFinished ) {
0 commit comments