{
  "genericAdsAdapter.adapter,getVersion": "return '7.0.1-react-native-video-ads-js';",
  "genericAdsAdapter.adapter,getDuration": "return this.duration||0;",
  "genericAdsAdapter.adapter,getResource": "return this.resource||'N/A';",
  "genericAdsAdapter.adapter,getPlayhead": "var videoAdapter=this.getVideo().getAdapter();return videoAdapter ? videoAdapter.playhead : undefined;",
  "genericAdsAdapter.adapter,getTitle": "return this.title||'N/A';",
  "genericAdsAdapter.adapter,getPosition": "var position=this.getNpawReference().Constants.AdPosition.Midroll;if(this.getVideo().getAdapter()&&!this.getVideo().getAdapter().flags.isJoined){position=this.getNpawReference().Constants.AdPosition.Preroll;}return position;",
  "genericAdsAdapter.adapter,onAdEvent,e": "switch(e.event){case 'FIRST_QUARTILE': this._quartileHandler(1);break;case 'MIDPOINT': this._quartileHandler(2);break;case 'THIRD_QUARTILE': this._quartileHandler(3);break;case 'STARTED': this.adStartedListener();break;case 'COMPLETED': this.adCompleteListener();break;case 'CLICK': this.adClickListener();break;case 'PAUSED': this.adPauseListener();break;case 'RESUMED': this.adPlayListener();break;case 'ERROR': this.adErrorListener();break;case 'SKIPPED': this.adSkippedListener();break;case 'CONTENT_RESUME_REQUESTED': this.adBreakFinished();break;case 'CONTENT_PAUSE_REQUESTED': var videoAdapter=this.getVideo().getAdapter();if(!videoAdapter.flags.isPaused){videoAdapter.firePause();videoAdapter.lastPlayhead=videoAdapter.getPlayhead();}this.showingAds=true;break;case 'ALL_ADS_COMPLETED': if(this.getVideo().getAdapter().reactPlatform&&this.getVideo().getAdapter().reactPlatform==='ios'){this.getVideo().getAdapter().fireStop({},'onAdEvent');}break;}",
  "genericAdsAdapter.adapter,isShowingAds": "return this.showingAds;",
  "genericAdsAdapter.adapter,_quartileHandler,position": "this.fireQuartile(position);",
  "genericAdsAdapter.adapter,adStartedListener,e": "if(this.getVideo().getAdapter()&&this.getVideo().getAdapter().stopTimer){clearTimeout(this.getVideo().getAdapter().stopTimer);}this.showingAds=true;this.getVideo().getAdapter().cancelSeek();this.fireStart({},'adStartListener');this.fireJoin({},'adStartListener');",
  "genericAdsAdapter.adapter,adPauseListener,e": "this.firePause({},'adPauseListener');",
  "genericAdsAdapter.adapter,adPlayListener,e": "this.fireResume({},'adPlayListener');",
  "genericAdsAdapter.adapter,adSkippedListener,e": "this.fireSkip({},'adSkippedListener');",
  "genericAdsAdapter.adapter,adCompleteListener,e": "this.fireStop({},'adCompleteListener');this.resetValues();",
  "genericAdsAdapter.adapter,adClickListener,e": "this.fireClick(this.clickThrough);",
  "genericAdsAdapter.adapter,adBreakFinished,e": "this.fireBreakStop({},'adBreakFinished');this.showingAds=false;",
  "genericAdsAdapter.adapter,adErrorListener,e": "if(e.message){var msg=e.message.toLowerCase();if(msg.indexOf('ad tag empty')>-1){this.fireManifest(this.getNpawReference().Constants.ManifestError.EMPTY,e.message);}else if(msg.indexOf('error loading ad tag')>-1||msg.indexOf('invalid ad tag')>-1||msg.indexOf('any valid ads')>-1){this.fireManifest(this.getNpawReference().Constants.ManifestError.WRONG,e.message);}else{if(e.adErrorCode&&(e.adErrorCode===60006||e.adErrorCode===10403)){this.fireManifest(this.getNpawReference().Constants.ManifestError.WRONG,e.message);}else{this.fireError(e.adErrorCode,e.message);this.fireStop();this.resetValues();if(msg.indexOf('timeout')>-1){this.fireBreakStop();}}}}",
  "genericAdsAdapter.adapter,resetValues": "this.playhead=undefined;this.duration=undefined;this.position=undefined;this.resource=undefined;this.title=undefined;this.showingAds=false;",
  
  "adapter,getVersion": "return '7.0.1-react-native-video-js';",
  "adapter,getPlayhead": "var adsAdapter=this.getVideo().getAdsAdapter();return adsAdapter&&adsAdapter.isShowingAds()? this.lastPlayhead : this.playhead;",
  "adapter,getIsLive": "return typeof this.duration!=='undefined' ?!this.duration : undefined;",
  "adapter,getDuration": "return this.duration;",
  "adapter,getResource": "return this.resource;",
  "adapter,getRendition": "if(this.width&&this.height){return this.getNpawUtils().buildRenditionString(this.width,this.height);}return;",
  "adapter,getPlayerName": "return 'React Native Video';",
  "adapter,setPlatform,platform": "this.reactPlatform=platform;",
  "adapter,registerListeners": "if(this.reactPlatform&&this.reactPlatform=='ios'){this.monitorPlayhead(true,true,400);}if(!this.getVideo().getAdsAdapter()){this.plugin.setAdsAdapter(this.getAdapterClass('genericAdsAdapter'),this.getVideo().getVideoKey());}",
  "adapter,unregisterListeners": "if(this.monitor)this.monitor.stop();",
  "adapter,onLoad,e": "if(this.reactPlatform&&this.reactPlatform=='ios'&&!this.monitor){this.monitorPlayhead(true,true,400);}var size=e.naturalSize;if(size){this.width=Math.round(size.width);this.height=Math.round(size.height);}this.duration=e.duration;this.fireStart({},'onLoad');if(!this.flags.isJoined){this.onBuffering=false;this.fireJoin({},'onLoadStart');if(this.reactPlatform&&this.reactPlatform=='ios'&&this.monitor){this.monitor.skipNextTick();}}if(this.pausePlayhead&&Math.abs(this.getPlayhead()-this.pausePlayhead)>0.5){this.fireSeekEnd({},'onLoadStart');}else{if(this.pausePlayhead){this.chronos.pause.pauseTime=undefined;}}this.pausePlayhead=undefined;this.fireResume({},'onLoadStart');",
  "adapter,onLoadStart,e": "if(this.reactPlatform&&this.reactPlatform=='ios'&&!this.monitor){this.monitorPlayhead(true,true,400);}if(e.src){this.resource=e.src.uri;}this.fireStart({},'onLoadStart');",
  "adapter,onPlaybackRateChange,e": "this.playrate=e.playbackRate;if(this.getVideo().getAdsAdapter()&&this.getVideo().getAdsAdapter().isShowingAds()){return;}if(this.playrate&&this.playhead>0.1){this.fireStart({},'onPlaybackRateChange');if(!this.flags.isJoined){this.onBuffering=false;if(this.reactPlatform&&this.reactPlatform=='ios'&&!this.monitor){this.monitorPlayhead(true,true,400);}this.fireJoin({},'onPlaybackRateChange');if(this.reactPlatform&&this.reactPlatform=='ios'&&this.monitor){this.monitor.skipNextTick();}}if(this.pausePlayhead&&Math.abs(this.getPlayhead()-this.pausePlayhead)>0.5&&!this.flags.isPaused){this.fireSeekEnd({},'onPlaybackRateChange');this.pausePlayhead=undefined;}else if(this.pausePlayhead&&Math.abs(this.getPlayhead()-this.pausePlayhead)<0.5&&!this.onBuffering){this.cancelSeek();this.pausePlayhead=undefined;}this.fireResume({},'onPlaybackRateChange');}else if(this.playhead>0.1){if(this.reactPlatform&&this.reactPlatform=='android'){this.pausePlayhead=this.getPlayhead();this.fireSeekBegin({},true,'onPlaybackRateChange');}if(this.reactPlatform&&this.reactPlatform=='ios'){this.lastPlayhead=this.playhead;}this.firePause({},'onPlaybackRateChange');if(this.reactPlatform&&this.reactPlatform=='android'){this.chronos.pause.startTime=new Date().getTime();}}",
  "adapter,onProgress,e": "var adsAdapter=this.getVideo().getAdsAdapter();if(adsAdapter&&adsAdapter.isShowingAds()&&this.reactPlatform&&this.reactPlatform=='android'&&!this.lastPlayhead){this.lastPlayhead=this.playhead;}else if(adsAdapter&&!adsAdapter.isShowingAds()&&!this.flags.isPaused){this.lastPlayhead=undefined;}if(adsAdapter&&!adsAdapter.isShowingAds()&&!this.duration){this.duration=e.seekableDuration;}this.playhead=e.currentTime;if(e.playableDuration-e.currentTime>0.5){this.fireStart({},'onProgress');}if(this.playhead>0.5&&!this.flags.isJoined){this.onBuffering=false;this.fireJoin({},'onProgress');if(this.reactPlatform&&this.reactPlatform=='ios'&&this.monitor){this.monitor.skipNextTick();}}if(this.pausePlayhead&&!this.flags.isPaused){if(Math.abs(this.getPlayhead()-this.pausePlayhead)>2){this.fireSeekEnd({},'onProgress');}else if(this.onBuffering){this.fireBufferBegin({},true,'onProgress');this.fireBufferEnd({},'onProgress');this.onBuffering=false;}else{this.chronos.pause.pauseTime=undefined;}this.pausePlayhead=undefined;}if(this.playrate){this.onBuffering=false;}",
  "adapter,onBuffer,e": "if(e.isBuffering&&typeof this.getPlayhead()!=='undefined'&&this.reactPlatform&&this.reactPlatform=='android'){this.onBuffering=true;this.fireBufferBegin({},false,'onBuffer');}",
  "adapter,onError,e": "var errorCode;var errorException;if(this.reactPlatform&&this.reactPlatform=='android'){errorCode=e.error.errorCode;errorException=e.error.errorException;}else if(this.reactPlatform&&this.reactPlatform=='ios'){errorCode=e.error.code;errorException=e.error.localizedDescription;}this.fireError(errorCode,errorException);",
  "adapter,onEnd,e": "if(this.reactPlatform&&this.reactPlatform=='ios'&&this.getVideo().getAdsAdapter()){this.stopTimer=setTimeout(()=>{this.fireStop();},this.getVideo().options['ad.postRollTimeout']||1000);return;}this.fireStop();",
  "adapter,onAdEvent,e": "if(this.getVideo()&&this.getVideo().getAdsAdapter()){this.getVideo().getAdsAdapter().onAdEvent(e);}"
}
