@@ -7,10 +7,13 @@ import * as clientUtils from './client';
77
88const Modernizr = window . suggestv . Modernizr ;
99const CLIENT = clientUtils . getClient ( ) ;
10+ const ENV = String ( process . env . NODE_ENV ) ;
11+ const API_URL = process . env . NODE_ENV === 'production' ? 'https://api.suggestv.io/semantics' : 'https://uat.suggestv.io/semantics' ;
12+ const ANALYTICS_URL = process . env . NODE_ENV === 'production' ? 'https://analytics.suggestv.io/track' : 'https://test.suggestv.io/analytics/track' ;
1013
1114class App extends React . Component {
1215 static getVideos ( url , client ) {
13- const endpoint = `https://api.suggestv.io/semantics ?url=${ url } &client=${ client } ` ;
16+ const endpoint = `${ API_URL } ?url=${ url } &client=${ client } ` ;
1417
1518 return fetch ( endpoint , {
1619 method : 'GET' ,
@@ -53,6 +56,8 @@ class App extends React.Component {
5356 if ( CLIENT === 'sovrnus' ) return cb ( null , 'http://ap.lijit.com/www/delivery/vst.php?zoneid=463506' ) ;
5457 if ( CLIENT === 'hitc' ) return cb ( null , 'https://ad.360yield.com/advast?p=1034241&w=4&h=3' ) ;
5558 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 ( ) } ` ) ;
59+ if ( CLIENT === 'global-radio' ) return cb ( null , 'http://adserver.adtech.de/?advideo/3.0/646.1/6441115/0/0/cc=2;vidAS=pre_roll;cors=yes;VidRT=VAST;VidRTV=3.0' ) ;
60+ if ( CLIENT === 'nigella' ) return cb ( null , 'https://ads.stickyadstv.com/www/delivery/swfIndex.php?reqType=AdsSetup&protocolVersion=2.0&zoneId=1016097' ) ;
5661 if ( CLIENT === 'telegraph' && tmgAdsBuildAd ) {
5762 return App . getPlaylistAdTag ( tmgAdsBuildAd ( 'advert_body_vid' , '' , '' , '' ) . fetchUrl ( ) , cb ) ;
5863 }
@@ -195,7 +200,7 @@ class App extends React.Component {
195200 postAnalytics ( player ) {
196201 if ( player . playlist . currentItem ( ) === - 1 ) { return ; }
197202
198- fetch ( 'https://analytics.suggestv.io/track' , {
203+ fetch ( ANALYTICS_URL , {
199204 method : 'POST' ,
200205 headers : {
201206 Accept : 'application/json' ,
0 commit comments