text: (function(){"use strict";var j=[].indexOf||function(e){for(var t=0,a=this.length;t<a;t++)if(t in this&&this[t]===e)return t;return-1};(videojs.registerPlugin||videojs.plugin)("td",function(e){var t,a,o,n,l,i,r,s,d,c,u,h,g,v,f,b,_,m,p;if(e.writeKey&&e.database&&e.table)if((t=document.createElement("a")).href=document.referrer,self===top||"players.brightcove.net"!==window.location.host&&"preview-players.brightcove.net"!==window.location.host||"studio.brightcove.com"!==t.hostname){if(a=this,o=new function(e){this.td=new TreasureVideojs({host:e.host||"in.treasuredata.com",writeKey:e.writeKey,database:e.database,startInSignedMode:e.startInSignedMode||!1}),this.table=e.table,this.debug=e.debug||!1,this.td.set(this.table,{bc_session_id:a.bcAnalytics.client.defaultParams_.session}),e.trackCrossDomain&&this.td.set("$global","td_global_id","td_global_id"),this.log=function(e,t){void 0===t&&(t={}),t.bc_event=e,this.debug?(videojs.log("Table name is "+this.table+", params are as follows."),videojs.log(t)):this.td.trackEvent(this.table,t)}}(e),r=function(e){var t=10;return void 0!==e.interval&&0<=j.call([5,10,25],e.interval)&&(t=e.interval),t}(e),l=["play","pause","error","fullscreen_change","volume_change","ended","percent_of_view","seek","player_load","video_loaded"],0===(n=e.trackEventList||l).length&&(n=l),d=s=0,!(i=[]),c={player_load:"Player Loaded",video_loaded:"Contents Loaded",play:"Play",pause:"Pause",error:"Error",fullscreenchange:"FullScreen Start",fullscreenchangeexit:"FullScreen Exit",volumechange:"Volume Change",ended:"Complete",percent_of_view:"Percent of View",seek:"Seek"},e.eventNameLabels&&0<Object.keys(e.eventNameLabels).length)for(var y=Object.keys(e.eventNameLabels),w=y.length,k=0;k<w;k++)c[y[k]]=e.eventNameLabels[y[k]];u=function(){o.td.set(o.table,{bc_video_id:this.mediainfo.id}),o.td.set(o.table,{bc_duration:this.mediainfo.duration}),o.td.set(o.table,{bc_video_name:this.mediainfo.name}),o.log(c.video_loaded)},h=function(){o.log(c.ended)},g=function(){o.log(c.play),!1},v=function(){o.log(c.pause),!1},f=function(){o.log(c.error)},b=function(){this.isFullscreen()?o.log(c.fullscreenchange):o.log(c.fullscreenchangeexit)},_=function(){var e;e=!0===this.muted()?0:this.volume(),o.log(c.volumechange,{bc_volume:e})},m=function(){var e,t,a,n,l;for(e=Math.round(this.currentTime()),t=Math.round(this.duration()),n=Math.round(e/t*100),a=l=0;l<=100;a=l+=r)a<=n&&j.call(i,a)<0&&(o.log(c.percent_of_view,{bc_percent:a}),i.push(a))},p=function(){var e=Math.round(this.currentTime());s=d,d=e,1<Math.abs(s-d)&&(!0,o.log(c.seek,{bc_seek_start:s,bc_seek_end:d}))},this.ready(function(){0<=j.call(n,"player_load")&&o.log(c.player_load),0<=j.call(n,"video_loaded")&&a.on("loadedmetadata",u),0<=j.call(n,"play")&&a.on("play",g),0<=j.call(n,"pause")&&a.on("pause",v),0<=j.call(n,"error")&&a.on("error",f),0<=j.call(n,"fullscreen_change")&&a.on("fullscreenchange",b),0<=j.call(n,"volume_change")&&a.on("volumechange",_),0<=j.call(n,"percent_of_view")&&a.on("timeupdate",m),0<=j.call(n,"seek")&&a.on("timeupdate",p),0<=j.call(n,"ended")&&a.on("ended",h)})}else videojs.log("TreasureData plugin will not track events in Video Cloud Studio");else videojs.log("require writeKey, database, table")})}).call(this);