티스토리 수익 글 보기
!function(e){‘use strict’;e.KTP={},e.videofarm={};var l={},s={getVideoStatus:!0},t={on:document.addEventListener?function(e,t,n){if(!e)throw new Error(‘failed to add event. Element: “‘+e+'”, Event: “‘+t+'”, handler: ‘+n.toString());e.addEventListener(t,n,!1)}:function(e,t,n){e.attachEvent(‘on’+t,n)},off:document.removeEventListener?function(e,t,n){e.removeEventListener(t,n,!1)}:function(e,t,n){e.detachEvent(‘on’+t,n)}};function d(e){e&&e.style&&(e.style.width=’100%’,e.style.height=’100%’,e.style.position=”)}function i(e,t,n){e.postMessage(JSON.stringify(n),t)}function n(){var n=this;this.promise=new Promise(function(e,t){n.reject=t,n.resolve=e})}function o(e){this.name=e,this.key=this.createKey(),this.deferred=new n}function a(e){this.scheduledJobs=e||{}}function f(e,t,n){this.iframe=e,this.style=e.style,this.config=t,this.callbacks=n,this.isInited=!1,this.originHost=(t=e.src,n=new RegExp(‘^(http(?:s)?://[^/]+)’,’im’),t.match(n)[1].toString().toLowerCase()),this.scheduler=new a}o.prototype={createKey:function(){return(new Date).getTime()+’.’+(1e4*Math.random()).toFixed(0)}},a.prototype={set:function(e){if(!(e instanceof o))return new Error(‘An object that is not a job object was entered into the scheduler.’);this.scheduledJobs[e.name]||(this.scheduledJobs[e.name]={}),this.scheduledJobs[e.name][e.key]||(this.scheduledJobs[e.name][e.key]={}),this.scheduledJobs[e.name][e.key]=e},get:function(e,t){return e&&t?(this.scheduledJobs[e]||{})[t]:this.scheduledJobs[e]},create:function(e){if(e)return e=new o(e),this.set(e),e},delete:function(e){if(e instanceof o){var t=this.scheduledJobs[e.name];if(t&&t[e.key])return void delete t[e.key]}if(e.name&&e.key)return t=this.get(e.name,e.key),void this.delete(t);e.name&&delete this.scheduledJobs[e.name]}},f.prototype={getVideoStatus:function(){var e=this.scheduler.create(‘getVideoStatus’);return this.sendCommand(e.name,[e.key]),e.deferred.promise},sendCommand:function(e){var t=this.config.id||”,n=this.iframe.contentWindow,o=this.originHost,s=Array.prototype.slice.call(arguments,1)[0],e={action:e,id:t||”,args:Array.isArray(s)?s:[s]};try{this.checkReady()&&i(n,o,e)}catch(e){this.callbacks&&’function’==typeof this.callbacks.notReadyCallback&&this.callbacks.notReadyCallback()}},runActionTask:function(e){var t,n,o;’onReadyComplete’===e&&((t=this).isInited=!0,n=t.callbacks,o=t.config,t.setCallback(n),n&&n.canUseApi&&n.canUseApi(),o&&o.beaconData&&t.setBeaconData(o.beaconData),t.trackUsage({callbackCount:Object.keys(n).length,referer:window.location.href})),’onAlreadyInited’===e&&(this.isInited=!0)},onMessage:function(e){if(e.origin.toLowerCase()===this.originHost){try{o=JSON.parse(e.data)}catch(e){return}var t,n=o.action,o=o.args||[];this.runActionTask(n,o),this.callbacks&&’function’==typeof this.callbacks[n]&&this.callbacks[n].apply(this.callbacks,o),!s[n]||(t=this.scheduler.get(n,o[o.length-1]))&&(t.deferred.resolve(o[0]),this.scheduler.delete(t)),’pageReload’===n&&window.location.reload()}},checkReady:function(){return this.isInited||this.callbacks&&’function’==typeof this.callbacks.notReadyCallback&&this.callbacks.notReadyCallback(),this.isInited},checkInited:function(){var e=this.iframe.contentWindow,t=this.originHost;try{i(e,t,{action:’checkInited’})}catch(e){this.callbacks&&’function’==typeof this.callbacks.notReadyCallback&&this.callbacks.notReadyCallback()}},playSegmentLoading:function(){this.sendCommand(‘playSegmentLoading’)},pauseSegmentLoading:function(){this.sendCommand(‘pauseSegmentLoading’)},play:function(e){0===this.config.showcover&&d(this.iframe),this.sendCommand(‘play’,[e])},pause:function(){this.sendCommand(‘pause’)},reset:function(){this.sendCommand(‘reset’)},stop:function(){this.sendCommand(‘stop’)},load:function(e,t,n){this.sendCommand(‘load’,[e,t,n])},loadAndPlay:function(e,t,n){this.sendCommand(‘loadAndPlay’,[e,t,n])},reload:function(e){this.sendCommand(‘reload’,[e])},mute:function(){this.sendCommand(‘mute’)},unMute:function(){this.sendCommand(‘unMute’)},setVolume:function(e){this.sendCommand(‘setVolume’,[e])},seekTo:function(e){this.sendCommand(‘seekTo’,[e])},increaseUpCnt:function(){this.sendCommand(‘increaseUpCnt’)},setListPlayMode:function(e){this.sendCommand(‘setListPlayMode’,[e])},setRepeatMode:function(e){this.sendCommand(‘setRepeatMode’,[e])},setVerticalMode:function(){this.sendCommand(‘setVerticalMode’)},setAutoplayVisible:function(){this.sendCommand(‘setAutoplayVisible’)},setContinuousPlay:function(){this.sendCommand(‘setContinuousPlay’)},setPlaybackRate:function(){this.sendCommand(‘setPlaybackRate’)},unsetVerticalMode:function(){this.sendCommand(‘unsetVerticalMode’)},popupUrl:function(e){this.sendCommand(‘popupUrl’,[e])},changeScreenType:function(e){this.sendCommand(‘changeScreenType’,[e])},fireEvent:function(e){this.sendCommand(‘fireEvent’,[e])},setCallback:function(e){this.callbacks=e},setBeaconData:function(e){this.sendCommand(‘setBeaconData’,[e])},requestFullScreen:function(){this.sendCommand(‘requestFullScreen’)},cancelFullScreen:function(){this.sendCommand(‘cancelFullScreen’)},sendReport:function(){this.sendCommand(‘sendReport’)},setProfile:function(e){this.sendCommand(‘setProfile’,[e])},destroy:function(){var e=this.config.instanceId||this.config.id;void 0!==l[e]&&(this.iframe.parentNode.removeChild(this.iframe),delete l[e])},setLowLatencyMode:function(e){this.sendCommand(‘setLowLatencyMode’,[e])},setBufferLength:function(e,t){this.sendCommand(‘setBufferLength’,[e,t])},setBufferBasedABR:function(e){this.sendCommand(‘setBufferBasedABR’,[e])},trackUsage:function(e){this.sendCommand(‘trackUsage’,[e])}};u=’/embed/player/’;var u,r={create:function(e,t,n){if(t.id&&”!==t.id){var o=t.instanceId||t.id,s=(t.instanceId=o,document.createElement(‘iframe’)),i=(s.setAttribute(‘allow’,’autoplay; fullscreen; encrypted-media’),s.setAttribute(‘allowfullscreen’,”),s.setAttribute(‘referrerpolicy’,’unsafe-url’),t&&0===t.showcover?(i=s)&&i.style&&(i.style.width=’1px’,i.style.height=’1px’,i.style.position=’absolute’,i.style.zIndex=”):d(s),s.style.border=’0′,t.service||’und_player’),a=(c=”,(r=i)&&(c+=’?service=’+r),(a=t)&&(a.section&&(c+=’§ion=’+a.section),a.section2&&(c+=’§ion2=’+a.section2),a.slot&&(c+=’&slot=’+a.slot),’number’==typeof a.showaction&&0===a.showaction&&(c+=’&showaction=’+a.showaction),’number’==typeof a.autoplay&&1===a.autoplay&&(c+=’&autoplay=’+a.autoplay),’number’==typeof a.mute&&1===a.mute&&(c+=’&mute=’+a.mute),’number’==typeof a.fs&&0===a.fs&&(c+=’&fs=’+a.fs),’number’==typeof a.playsinline&&0===a.playsinline&&(c+=’&playsinline=’+a.playsinline),a.profile&&(c+=’&profile=’+a.profile),a.forceprofile&&(c+=’&forceprofile=’+a.forceprofile),’number’==typeof a.extensions&&0===a.extensions&&(c+=’&extensions=’+a.extensions),’number’==typeof a.showcover&&0===a.showcover&&(c+=’&showcover=’+a.showcover),’number’==typeof a.coverprofile&&0===a.coverprofile&&(c+=’&coverprofile=’+a.coverprofile),’number’==typeof a.covertime&&0===a.covertime&&(c+=’&covertime=’+a.covertime),’number’==typeof a.showprofile&&0===a.showprofile&&(c+=’&showprofile=’+a.showprofile),’number’==typeof a.miniprogress&&1===a.miniprogress&&(c+=’&miniprogress=’+a.miniprogress),’number’==typeof a.showinfo&&0===a.showinfo&&(c+=’&showinfo=’+a.showinfo),’number’==typeof a.controls&&0===a.controls&&(c+=’&controls=’+a.controls),’number’==typeof a.rel&&0===a.rel&&(c+=’&rel=’+a.rel),’number’==typeof a.branding&&0===a.branding&&(c+=’&branding=’+a.branding),a.isLauncher&&(c+=’&m_is_launcher=true’),a.start&&0