/*!@silvermine/videojs-chromecast 2020-04-06 ba1fae9ba-dirty*/(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a;} var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r);},p,p.exports,r,e,n,t);} return n[i].exports;} for(var u="function"==typeof require&&require,i=0;i=0&&length<=MAX_ARRAY_INDEX;};_.each=_.forEach=function(obj,iteratee,context){iteratee=optimizeCb(iteratee,context);var i,length;if(isArrayLike(obj)){for(i=0,length=obj.length;i=0&&index0?0:length-1;if(arguments.length<3){memo=obj[keys?keys[index]:index];index+=dir;} return iterator(obj,iteratee,memo,keys,index,length);};} _.reduce=_.foldl=_.inject=createReduce(1);_.reduceRight=_.foldr=createReduce(-1);_.find=_.detect=function(obj,predicate,context){var key;if(isArrayLike(obj)){key=_.findIndex(obj,predicate,context);}else{key=_.findKey(obj,predicate,context);} if(key!==void 0&&key!==-1)return obj[key];};_.filter=_.select=function(obj,predicate,context){var results=[];predicate=cb(predicate,context);_.each(obj,function(value,index,list){if(predicate(value,index,list))results.push(value);});return results;};_.reject=function(obj,predicate,context){return _.filter(obj,_.negate(cb(predicate)),context);};_.every=_.all=function(obj,predicate,context){predicate=cb(predicate,context);var keys=!isArrayLike(obj)&&_.keys(obj),length=(keys||obj).length;for(var index=0;index=0;};_.invoke=function(obj,method){var args=slice.call(arguments,2);var isFunc=_.isFunction(method);return _.map(obj,function(value){var func=isFunc?method:value[method];return func==null?func:func.apply(value,args);});};_.pluck=function(obj,key){return _.map(obj,_.property(key));};_.where=function(obj,attrs){return _.filter(obj,_.matcher(attrs));};_.findWhere=function(obj,attrs){return _.find(obj,_.matcher(attrs));};_.max=function(obj,iteratee,context){var result=-Infinity,lastComputed=-Infinity,value,computed;if(iteratee==null&&obj!=null){obj=isArrayLike(obj)?obj:_.values(obj);for(var i=0,length=obj.length;iresult){result=value;}}}else{iteratee=cb(iteratee,context);_.each(obj,function(value,index,list){computed=iteratee(value,index,list);if(computed>lastComputed||computed===-Infinity&&result===-Infinity){result=value;lastComputed=computed;}});} return result;};_.min=function(obj,iteratee,context){var result=Infinity,lastComputed=Infinity,value,computed;if(iteratee==null&&obj!=null){obj=isArrayLike(obj)?obj:_.values(obj);for(var i=0,length=obj.length;ib||a===void 0)return 1;if(a0?0:length-1;for(;index>=0&&index0){i=idx>=0?idx:Math.max(idx+length,i);}else{length=idx>=0?Math.min(idx+1,length):idx+length+1;}}else if(sortedIndex&&idx&&length){idx=sortedIndex(array,item);return array[idx]===item?idx:-1;} if(item!==item){idx=predicateFind(slice.call(array,i,length),_.isNaN);return idx>=0?idx+i:-1;} for(idx=dir>0?i:length-1;idx>=0&&idxwait){if(timeout){clearTimeout(timeout);timeout=null;} previous=now;result=func.apply(context,args);if(!timeout)context=args=null;}else if(!timeout&&options.trailing!==false){timeout=setTimeout(later,remaining);} return result;};};_.debounce=function(func,wait,immediate){var timeout,args,context,timestamp,result;var later=function(){var last=_.now()-timestamp;if(last=0){timeout=setTimeout(later,wait-last);}else{timeout=null;if(!immediate){result=func.apply(context,args);if(!timeout)context=args=null;}}};return function(){context=this;args=arguments;timestamp=_.now();var callNow=immediate&&!timeout;if(!timeout)timeout=setTimeout(later,wait);if(callNow){result=func.apply(context,args);context=args=null;} return result;};};_.wrap=function(func,wrapper){return _.partial(wrapper,func);};_.negate=function(predicate){return function(){return!predicate.apply(this,arguments);};};_.compose=function(){var args=arguments;var start=args.length-1;return function(){var i=start;var result=args[start].apply(this,arguments);while(i--)result=args[i].call(this,result);return result;};};_.after=function(times,func){return function(){if(--times<1){return func.apply(this,arguments);}};};_.before=function(times,func){var memo;return function(){if(--times>0){memo=func.apply(this,arguments);} if(times<=1)func=null;return memo;};};_.once=_.partial(_.before,2);var hasEnumBug=!{toString:null}.propertyIsEnumerable("toString");var nonEnumerableProps=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function collectNonEnumProps(obj,keys){var nonEnumIdx=nonEnumerableProps.length;var constructor=obj.constructor;var proto=_.isFunction(constructor)&&constructor.prototype||ObjProto;var prop="constructor";if(_.has(obj,prop)&&!_.contains(keys,prop))keys.push(prop);while(nonEnumIdx--){prop=nonEnumerableProps[nonEnumIdx];if(prop in obj&&obj[prop]!==proto[prop]&&!_.contains(keys,prop)){keys.push(prop);}}} _.keys=function(obj){if(!_.isObject(obj))return[];if(nativeKeys)return nativeKeys(obj);var keys=[];for(var key in obj)if(_.has(obj,key))keys.push(key);if(hasEnumBug)collectNonEnumProps(obj,keys);return keys;};_.allKeys=function(obj){if(!_.isObject(obj))return[];var keys=[];for(var key in obj)keys.push(key);if(hasEnumBug)collectNonEnumProps(obj,keys);return keys;};_.values=function(obj){var keys=_.keys(obj);var length=keys.length;var values=Array(length);for(var i=0;i":">",'"':""","'":"'","`":"`"};var unescapeMap=_.invert(escapeMap);var createEscaper=function(map){var escaper=function(match){return map[match];};var source="(?:"+_.keys(map).join("|")+")";var testRegexp=RegExp(source);var replaceRegexp=RegExp(source,"g");return function(string){string=string==null?"":""+string;return testRegexp.test(string)?string.replace(replaceRegexp,escaper):string;};};_.escape=createEscaper(escapeMap);_.unescape=createEscaper(unescapeMap);_.result=function(object,property,fallback){var value=object==null?void 0:object[property];if(value===void 0){value=fallback;} return _.isFunction(value)?value.call(object):value;};var idCounter=0;_.uniqueId=function(prefix){var id=++idCounter+"";return prefix?prefix+id:id;};_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var noMatch=/(.)^/;var escapes={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"};var escaper=/\\|'|\r|\n|\u2028|\u2029/g;var escapeChar=function(match){return"\\"+escapes[match];};_.template=function(text,settings,oldSettings){if(!settings&&oldSettings)settings=oldSettings;settings=_.defaults({},settings,_.templateSettings);var matcher=RegExp([(settings.escape||noMatch).source,(settings.interpolate||noMatch).source,(settings.evaluate||noMatch).source].join("|")+"|$","g");var index=0;var source="__p+='";text.replace(matcher,function(match,escape,interpolate,evaluate,offset){source+=text.slice(index,offset).replace(escaper,escapeChar);index=offset+match.length;if(escape){source+="'+\n((__t=("+escape+"))==null?'':_.escape(__t))+\n'";}else if(interpolate){source+="'+\n((__t=("+interpolate+"))==null?'':__t)+\n'";}else if(evaluate){source+="';\n"+evaluate+"\n__p+='";} return match;});source+="';\n";if(!settings.variable)source="with(obj||{}){\n"+source+"}\n";source="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+source+"return __p;\n";try{var render=new Function(settings.variable||"obj","_",source);}catch(e){e.source=source;throw e;} var template=function(data){return render.call(this,data,_);};var argument=settings.variable||"obj";template.source="function("+argument+"){\n"+source+"}";return template;};_.chain=function(obj){var instance=_(obj);instance._chain=true;return instance;};var result=function(instance,obj){return instance._chain?_(obj).chain():obj;};_.mixin=function(obj){_.each(_.functions(obj),function(name){var func=_[name]=obj[name];_.prototype[name]=function(){var args=[this._wrapped];push.apply(args,arguments);return result(this,func.apply(_,args));};});};_.mixin(_);_.each(["pop","push","reverse","shift","sort","splice","unshift"],function(name){var method=ArrayProto[name];_.prototype[name]=function(){var obj=this._wrapped;method.apply(obj,arguments);if((name==="shift"||name==="splice")&&obj.length===0)delete obj[0];return result(this,obj);};});_.each(["concat","join","slice"],function(name){var method=ArrayProto[name];_.prototype[name]=function(){return result(this,method.apply(this._wrapped,arguments));};});_.prototype.value=function(){return this._wrapped;};_.prototype.valueOf=_.prototype.toJSON=_.prototype.value;_.prototype.toString=function(){return""+this._wrapped;};if(typeof define==="function"&&define.amd){define("underscore",[],function(){return _;});}}).call(this);},{}],3:[function(require,module,exports){(function(){window.WebComponents=window.WebComponents||{flags:{}};var file="webcomponents-lite.js";var script=document.querySelector('script[src*="'+file+'"]');var flags={};if(!flags.noOpts){location.search.slice(1).split("&").forEach(function(option){var parts=option.split("=");var match;if(parts[0]&&(match=parts[0].match(/wc-(.+)/))){flags[match[1]]=parts[1]||true;}});if(script){for(var i=0,a;a=script.attributes[i];i++){if(a.name!=="src"){flags[a.name]=a.value||true;}}} if(flags.log&&flags.log.split){var parts=flags.log.split(",");flags.log={};parts.forEach(function(f){flags.log[f]=true;});}else{flags.log={};}} if(flags.register){window.CustomElements=window.CustomElements||{flags:{}};window.CustomElements.flags.register=flags.register;} WebComponents.flags=flags;})();(function(scope){"use strict";var hasWorkingUrl=false;if(!scope.forceJURL){try{var u=new URL("b","http://a");u.pathname="c%20d";hasWorkingUrl=u.href==="http://a/c%20d";}catch(e){}} if(hasWorkingUrl)return;var relative=Object.create(null);relative["ftp"]=21;relative["file"]=0;relative["gopher"]=70;relative["http"]=80;relative["https"]=443;relative["ws"]=80;relative["wss"]=443;var relativePathDotMapping=Object.create(null);relativePathDotMapping["%2e"]=".";relativePathDotMapping[".%2e"]="..";relativePathDotMapping["%2e."]="..";relativePathDotMapping["%2e%2e"]="..";function isRelativeScheme(scheme){return relative[scheme]!==undefined;} function invalid(){clear.call(this);this._isInvalid=true;} function IDNAToASCII(h){if(""==h){invalid.call(this);} return h.toLowerCase();} function percentEscape(c){var unicode=c.charCodeAt(0);if(unicode>32&&unicode<127&&[34,35,60,62,63,96].indexOf(unicode)==-1){return c;} return encodeURIComponent(c);} function percentEscapeQuery(c){var unicode=c.charCodeAt(0);if(unicode>32&&unicode<127&&[34,35,60,62,96].indexOf(unicode)==-1){return c;} return encodeURIComponent(c);} var EOF=undefined,ALPHA=/[a-zA-Z]/,ALPHANUMERIC=/[a-zA-Z0-9\+\-\.]/;function parse(input,stateOverride,base){function err(message){errors.push(message);} var state=stateOverride||"scheme start",cursor=0,buffer="",seenAt=false,seenBracket=false,errors=[];loop:while((input[cursor-1]!=EOF||cursor==0)&&!this._isInvalid){var c=input[cursor];switch(state){case"scheme start":if(c&&ALPHA.test(c)){buffer+=c.toLowerCase();state="scheme";}else if(!stateOverride){buffer="";state="no scheme";continue;}else{err("Invalid scheme.");break loop;} break;case"scheme":if(c&&ALPHANUMERIC.test(c)){buffer+=c.toLowerCase();}else if(":"==c){this._scheme=buffer;buffer="";if(stateOverride){break loop;} if(isRelativeScheme(this._scheme)){this._isRelative=true;} if("file"==this._scheme){state="relative";}else if(this._isRelative&&base&&base._scheme==this._scheme){state="relative or authority";}else if(this._isRelative){state="authority first slash";}else{state="scheme data";}}else if(!stateOverride){buffer="";cursor=0;state="no scheme";continue;}else if(EOF==c){break loop;}else{err("Code point not allowed in scheme: "+c);break loop;} break;case"scheme data":if("?"==c){this._query="?";state="query";}else if("#"==c){this._fragment="#";state="fragment";}else{if(EOF!=c&&"\t"!=c&&"\n"!=c&&"\r"!=c){this._schemeData+=percentEscape(c);}} break;case"no scheme":if(!base||!isRelativeScheme(base._scheme)){err("Missing scheme.");invalid.call(this);}else{state="relative";continue;} break;case"relative or authority":if("/"==c&&"/"==input[cursor+1]){state="authority ignore slashes";}else{err("Expected /, got: "+c);state="relative";continue;} break;case"relative":this._isRelative=true;if("file"!=this._scheme)this._scheme=base._scheme;if(EOF==c){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._query=base._query;this._username=base._username;this._password=base._password;break loop;}else if("/"==c||"\\"==c){if("\\"==c)err("\\ is an invalid code point.");state="relative slash";}else if("?"==c){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._query="?";this._username=base._username;this._password=base._password;state="query";}else if("#"==c){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._query=base._query;this._fragment="#";this._username=base._username;this._password=base._password;state="fragment";}else{var nextC=input[cursor+1];var nextNextC=input[cursor+2];if("file"!=this._scheme||!ALPHA.test(c)||nextC!=":"&&nextC!="|"||EOF!=nextNextC&&"/"!=nextNextC&&"\\"!=nextNextC&&"?"!=nextNextC&&"#"!=nextNextC){this._host=base._host;this._port=base._port;this._username=base._username;this._password=base._password;this._path=base._path.slice();this._path.pop();} state="relative path";continue;} break;case"relative slash":if("/"==c||"\\"==c){if("\\"==c){err("\\ is an invalid code point.");} if("file"==this._scheme){state="file host";}else{state="authority ignore slashes";}}else{if("file"!=this._scheme){this._host=base._host;this._port=base._port;this._username=base._username;this._password=base._password;} state="relative path";continue;} break;case"authority first slash":if("/"==c){state="authority second slash";}else{err("Expected '/', got: "+c);state="authority ignore slashes";continue;} break;case"authority second slash":state="authority ignore slashes";if("/"!=c){err("Expected '/', got: "+c);continue;} break;case"authority ignore slashes":if("/"!=c&&"\\"!=c){state="authority";continue;}else{err("Expected authority, got: "+c);} break;case"authority":if("@"==c){if(seenAt){err("@ already seen.");buffer+="%40";} seenAt=true;for(var i=0;i>>0)+(counter++ +"__");};WeakMap.prototype={set:function(key,value){var entry=key[this.name];if(entry&&entry[0]===key)entry[1]=value;else defineProperty(key,this.name,{value:[key,value],writable:true});return this;},get:function(key){var entry;return(entry=key[this.name])&&entry[0]===key?entry[1]:undefined;},delete:function(key){var entry=key[this.name];if(!entry||entry[0]!==key)return false;entry[0]=entry[1]=undefined;return true;},has:function(key){var entry=key[this.name];if(!entry)return false;return entry[0]===key;}};window.WeakMap=WeakMap;})();} (function(global){if(global.JsMutationObserver){return;} var registrationsTable=new WeakMap();var setImmediate;if(/Trident|Edge/.test(navigator.userAgent)){setImmediate=setTimeout;}else if(window.setImmediate){setImmediate=window.setImmediate;}else{var setImmediateQueue=[];var sentinel=String(Math.random());window.addEventListener("message",function(e){if(e.data===sentinel){var queue=setImmediateQueue;setImmediateQueue=[];queue.forEach(function(func){func();});}});setImmediate=function(func){setImmediateQueue.push(func);window.postMessage(sentinel,"*");};} var isScheduled=false;var scheduledObservers=[];function scheduleCallback(observer){scheduledObservers.push(observer);if(!isScheduled){isScheduled=true;setImmediate(dispatchCallbacks);}} function wrapIfNeeded(node){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(node)||node;} function dispatchCallbacks(){isScheduled=false;var observers=scheduledObservers;scheduledObservers=[];observers.sort(function(o1,o2){return o1.uid_-o2.uid_;});var anyNonEmpty=false;observers.forEach(function(observer){var queue=observer.takeRecords();removeTransientObserversFor(observer);if(queue.length){observer.callback_(queue,observer);anyNonEmpty=true;}});if(anyNonEmpty)dispatchCallbacks();} function removeTransientObserversFor(observer){observer.nodes_.forEach(function(node){var registrations=registrationsTable.get(node);if(!registrations)return;registrations.forEach(function(registration){if(registration.observer===observer)registration.removeTransientObservers();});});} function forEachAncestorAndObserverEnqueueRecord(target,callback){for(var node=target;node;node=node.parentNode){var registrations=registrationsTable.get(node);if(registrations){for(var j=0;j0){var lastRecord=records[length-1];var recordToReplaceLast=selectRecord(lastRecord,record);if(recordToReplaceLast){records[length-1]=recordToReplaceLast;return;}}else{scheduleCallback(this.observer);} records[length]=record;},addListeners:function(){this.addListeners_(this.target);},addListeners_:function(node){var options=this.options;if(options.attributes)node.addEventListener("DOMAttrModified",this,true);if(options.characterData)node.addEventListener("DOMCharacterDataModified",this,true);if(options.childList)node.addEventListener("DOMNodeInserted",this,true);if(options.childList||options.subtree)node.addEventListener("DOMNodeRemoved",this,true);},removeListeners:function(){this.removeListeners_(this.target);},removeListeners_:function(node){var options=this.options;if(options.attributes)node.removeEventListener("DOMAttrModified",this,true);if(options.characterData)node.removeEventListener("DOMCharacterDataModified",this,true);if(options.childList)node.removeEventListener("DOMNodeInserted",this,true);if(options.childList||options.subtree)node.removeEventListener("DOMNodeRemoved",this,true);},addTransientObserver:function(node){if(node===this.target)return;this.addListeners_(node);this.transientObservedNodes.push(node);var registrations=registrationsTable.get(node);if(!registrations)registrationsTable.set(node,registrations=[]);registrations.push(this);},removeTransientObservers:function(){var transientObservedNodes=this.transientObservedNodes;this.transientObservedNodes=[];transientObservedNodes.forEach(function(node){this.removeListeners_(node);var registrations=registrationsTable.get(node);for(var i=0;i]/g;function escapeReplace(c){switch(c){case"&":return"&";case"<":return"<";case">":return">";case" ":return" ";}} function escapeData(s){return s.replace(escapeDataRegExp,escapeReplace);}} if(needsTemplate||needsCloning){var nativeCloneNode=Node.prototype.cloneNode;TemplateImpl.cloneNode=function(template,deep){var clone=nativeCloneNode.call(template,false);if(this.decorate){this.decorate(clone);} if(deep){clone.content.appendChild(nativeCloneNode.call(template.content,true));this.fixClonedDom(clone.content,template.content);} return clone;};TemplateImpl.fixClonedDom=function(clone,source){if(!source.querySelectorAll)return;var s$=source.querySelectorAll(TEMPLATE_TAG);var t$=clone.querySelectorAll(TEMPLATE_TAG);for(var i=0,l=t$.length,t,s;i=200&&request.status<300||request.status===304||request.status===0;},load:function(url,next,nextContext){var request=new XMLHttpRequest();if(scope.flags.debug||scope.flags.bust){url+="?"+Math.random();} request.open("GET",url,xhr.async);request.addEventListener("readystatechange",function(e){if(request.readyState===4){var redirectedUrl=null;try{var locationHeader=request.getResponseHeader("Location");if(locationHeader){redirectedUrl=locationHeader.substr(0,1)==="/"?location.origin+locationHeader:locationHeader;}}catch(e){console.error(e.message);} next.call(nextContext,!xhr.ok(request)&&request,request.response||request.responseText,redirectedUrl);}});request.send();return request;},loadDocument:function(url,next,nextContext){this.load(url,next,nextContext).responseType="document";}};scope.xhr=xhr;});window.HTMLImports.addModule(function(scope){var xhr=scope.xhr;var flags=scope.flags;var Loader=function(onLoad,onComplete){this.cache={};this.onload=onLoad;this.oncomplete=onComplete;this.inflight=0;this.pending={};};Loader.prototype={addNodes:function(nodes){this.inflight+=nodes.length;for(var i=0,l=nodes.length,n;i-1){body=atob(body);}else{body=decodeURIComponent(body);} setTimeout(function(){this.receive(url,elt,null,body);}.bind(this),0);}else{var receiveXhr=function(err,resource,redirectedUrl){this.receive(url,elt,err,resource,redirectedUrl);}.bind(this);xhr.load(url,receiveXhr);}},receive:function(url,elt,err,resource,redirectedUrl){this.cache[url]=resource;var $p=this.pending[url];for(var i=0,l=$p.length,p;i=0){this.dynamicElements.splice(i,1);}},parseImport:function(elt){elt.import=elt.__doc;if(window.HTMLImports.__importsParsingHook){window.HTMLImports.__importsParsingHook(elt);} if(elt.import){elt.import.__importParsed=true;} this.markParsingComplete(elt);if(elt.__resource&&!elt.__error){elt.dispatchEvent(new CustomEvent("load",{bubbles:false}));}else{elt.dispatchEvent(new CustomEvent("error",{bubbles:false}));} if(elt.__pending){var fn;while(elt.__pending.length){fn=elt.__pending.shift();if(fn){fn({target:elt});}}} this.parseNext();},parseLink:function(linkElt){if(nodeIsImport(linkElt)){this.parseImport(linkElt);}else{linkElt.href=linkElt.href;this.parseGeneric(linkElt);}},parseStyle:function(elt){var src=elt;elt=cloneStyle(elt);src.__appliedElement=elt;elt.__importElement=src;this.parseGeneric(elt);},parseGeneric:function(elt){this.trackElement(elt);this.addElementToDocument(elt);},rootImportForElement:function(elt){var n=elt;while(n.ownerDocument.__importLink){n=n.ownerDocument.__importLink;} return n;},addElementToDocument:function(elt){var port=this.rootImportForElement(elt.__importElement||elt);port.parentNode.insertBefore(elt,port);},trackElement:function(elt,callback){var self=this;var done=function(e){elt.removeEventListener("load",done);elt.removeEventListener("error",done);if(callback){callback(e);} self.markParsingComplete(elt);self.parseNext();};elt.addEventListener("load",done);elt.addEventListener("error",done);if(isIE&&elt.localName==="style"){var fakeLoad=false;if(elt.textContent.indexOf("@import")==-1){fakeLoad=true;}else if(elt.sheet){fakeLoad=true;var csr=elt.sheet.cssRules;var len=csr?csr.length:0;for(var i=0,r;i=0;},hasResource:function(node){if(nodeIsImport(node)&&node.__doc===undefined){return false;} return true;}};function nodeIsImport(elt){return elt.localName==="link"&&elt.rel===IMPORT_LINK_TYPE;} function generateScriptDataUrl(script){var scriptContent=generateScriptContent(script);return"data:text/javascript;charset=utf-8,"+encodeURIComponent(scriptContent);} function generateScriptContent(script){return script.textContent+generateSourceMapHint(script);} function generateSourceMapHint(script){var owner=script.ownerDocument;owner.__importedScripts=owner.__importedScripts||0;var moniker=script.ownerDocument.baseURI;var num=owner.__importedScripts?"-"+owner.__importedScripts:"";owner.__importedScripts++;return"\n//# sourceURL="+moniker+num+".js\n";} function cloneStyle(style){var clone=style.ownerDocument.createElement("style");clone.textContent=style.textContent;path.resolveUrlsInStyle(clone);return clone;} scope.parser=importParser;scope.IMPORT_SELECTOR=IMPORT_SELECTOR;});window.HTMLImports.addModule(function(scope){var flags=scope.flags;var IMPORT_LINK_TYPE=scope.IMPORT_LINK_TYPE;var IMPORT_SELECTOR=scope.IMPORT_SELECTOR;var rootDocument=scope.rootDocument;var Loader=scope.Loader;var Observer=scope.Observer;var parser=scope.parser;var importer={documents:{},documentPreloadSelectors:IMPORT_SELECTOR,importsPreloadSelectors:[IMPORT_SELECTOR].join(","),loadNode:function(node){importLoader.addNode(node);},loadSubtree:function(parent){var nodes=this.marshalNodes(parent);importLoader.addNodes(nodes);},marshalNodes:function(parent){return parent.querySelectorAll(this.loadSelectorsForNode(parent));},loadSelectorsForNode:function(node){var doc=node.ownerDocument||node;return doc===rootDocument?this.documentPreloadSelectors:this.importsPreloadSelectors;},loaded:function(url,elt,resource,err,redirectedUrl){flags.load&&console.log("loaded",url,elt);elt.__resource=resource;elt.__error=err;if(isImportLink(elt)){var doc=this.documents[url];if(doc===undefined){doc=err?null:makeDocument(resource,redirectedUrl||url);if(doc){doc.__importLink=elt;this.bootDocument(doc);} this.documents[url]=doc;} elt.__doc=doc;} parser.parseNext();},bootDocument:function(doc){this.loadSubtree(doc);this.observer.observe(doc);parser.parseNext();},loadedAll:function(){parser.parseNext();}};var importLoader=new Loader(importer.loaded.bind(importer),importer.loadedAll.bind(importer));importer.observer=new Observer();function isImportLink(elt){return isLinkRel(elt,IMPORT_LINK_TYPE);} function isLinkRel(elt,rel){return elt.localName==="link"&&elt.getAttribute("rel")===rel;} function hasBaseURIAccessor(doc){return!!Object.getOwnPropertyDescriptor(doc,"baseURI");} function makeDocument(resource,url){var doc=document.implementation.createHTMLDocument(IMPORT_LINK_TYPE);doc._URL=url;var base=doc.createElement("base");base.setAttribute("href",url);if(!doc.baseURI&&!hasBaseURIAccessor(doc)){Object.defineProperty(doc,"baseURI",{value:url});} var meta=doc.createElement("meta");meta.setAttribute("charset","utf-8");doc.head.appendChild(meta);doc.head.appendChild(base);doc.body.innerHTML=resource;if(window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap){HTMLTemplateElement.bootstrap(doc);} return doc;} if(!document.baseURI){var baseURIDescriptor={get:function(){var base=document.querySelector("base");return base?base.href:window.location.href;},configurable:true};Object.defineProperty(document,"baseURI",baseURIDescriptor);Object.defineProperty(rootDocument,"baseURI",baseURIDescriptor);} scope.importer=importer;scope.importLoader=importLoader;});window.HTMLImports.addModule(function(scope){var parser=scope.parser;var importer=scope.importer;var dynamic={added:function(nodes){var owner,parsed,loading;for(var i=0,l=nodes.length,n;i=0){return;} processingDocuments.push(doc);var imports=doc.querySelectorAll("link[rel="+IMPORT_LINK_TYPE+"]");for(var i=0,l=imports.length,n;i=0){implementPrototype(element,HTMLElement);} return element;} var domCreateElement=document.createElement.bind(document);var domCreateElementNS=document.createElementNS.bind(document);var isInstance;if(!Object.__proto__&&!useNative){isInstance=function(obj,ctor){if(obj instanceof ctor){return true;} var p=obj;while(p){if(p===ctor.prototype){return true;} p=p.__proto__;} return false;};}else{isInstance=function(obj,base){return obj instanceof base;};} function wrapDomMethodToForceUpgrade(obj,methodName){var orig=obj[methodName];obj[methodName]=function(){var n=orig.apply(this,arguments);upgradeAll(n);return n;};} wrapDomMethodToForceUpgrade(Node.prototype,"cloneNode");wrapDomMethodToForceUpgrade(document,"importNode");document.registerElement=register;document.createElement=createElement;document.createElementNS=createElementNS;scope.registry=registry;scope.instanceof=isInstance;scope.reservedTagList=reservedTagList;scope.getRegisteredDefinition=getRegisteredDefinition;document.register=document.registerElement;});(function(scope){var useNative=scope.useNative;var initializeModules=scope.initializeModules;var isIE=scope.isIE;if(useNative){var nop=function(){};scope.watchShadow=nop;scope.upgrade=nop;scope.upgradeAll=nop;scope.upgradeDocumentTree=nop;scope.upgradeSubtree=nop;scope.takeRecords=nop;scope.instanceof=function(obj,base){return obj instanceof base;};}else{initializeModules();} var upgradeDocumentTree=scope.upgradeDocumentTree;var upgradeDocument=scope.upgradeDocument;if(!window.wrap){if(window.ShadowDOMPolyfill){window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded;window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded;}else{window.wrap=window.unwrap=function(node){return node;};}} if(window.HTMLImports){window.HTMLImports.__importsParsingHook=function(elt){if(elt.import){upgradeDocument(wrap(elt.import));}};} function bootstrap(){upgradeDocumentTree(window.wrap(document));window.CustomElements.ready=true;var requestAnimationFrame=window.requestAnimationFrame||function(f){setTimeout(f,16);};requestAnimationFrame(function(){setTimeout(function(){window.CustomElements.readyTime=Date.now();if(window.HTMLImports){window.CustomElements.elapsed=window.CustomElements.readyTime-window.HTMLImports.readyTime;} document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:true}));});});} if(document.readyState==="complete"||scope.flags.eager){bootstrap();}else if(document.readyState==="interactive"&&!window.attachEvent&&(!window.HTMLImports||window.HTMLImports.ready)){bootstrap();}else{var loadEvent=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(loadEvent,bootstrap);}})(window.CustomElements);(function(scope){var style=document.createElement("style");style.textContent=""+"body {"+"transition: opacity ease-in 0.2s;"+" } \n"+"body[unresolved] {"+"opacity: 0; display: block; overflow: hidden; position: relative;"+" } \n";var head=document.querySelector("head");head.insertBefore(style,head.firstChild);})(window.WebComponents);},{}],4:[function(require,module,exports){"use strict";var Class=require("class.extend"),_=require("underscore"),hasConnected=false,ChromecastSessionManager;function getCastContext(){return cast.framework.CastContext.getInstance();} ChromecastSessionManager=Class.extend({init:function(player){this.player=player;this._addCastContextEventListeners();this.player.on("dispose",this._removeCastContextEventListeners.bind(this));this._notifyPlayerOfDevicesAvailabilityChange(this.getCastContext().getCastState());this.remotePlayer=new cast.framework.RemotePlayer();this.remotePlayerController=new cast.framework.RemotePlayerController(this.remotePlayer);},_addCastContextEventListeners:function(){var sessionStateChangedEvt=cast.framework.CastContextEventType.SESSION_STATE_CHANGED,castStateChangedEvt=cast.framework.CastContextEventType.CAST_STATE_CHANGED;this.getCastContext().addEventListener(sessionStateChangedEvt,this._onSessionStateChange.bind(this));this.getCastContext().addEventListener(castStateChangedEvt,this._onCastStateChange.bind(this));},_removeCastContextEventListeners:function(){var sessionStateChangedEvt=cast.framework.CastContextEventType.SESSION_STATE_CHANGED,castStateChangedEvt=cast.framework.CastContextEventType.CAST_STATE_CHANGED;this.getCastContext().removeEventListener(sessionStateChangedEvt);this.getCastContext().removeEventListener(castStateChangedEvt);},_onSessionStateChange:function(event){if(event.sessionState===cast.framework.SessionState.SESSION_ENDED){this.player.trigger("chromecastDisconnected");this._reloadTech();}},_onCastStateChange:function(event){this._notifyPlayerOfDevicesAvailabilityChange(event.castState);},_notifyPlayerOfDevicesAvailabilityChange:function(castState){if(this.hasAvailableDevices(castState)){this.player.trigger("chromecastDevicesAvailable");}else{this.player.trigger("chromecastDevicesUnavailable");}},hasAvailableDevices:function(castState){castState=castState||this.getCastContext().getCastState();return castState===cast.framework.CastState.NOT_CONNECTED||castState===cast.framework.CastState.CONNECTING||castState===cast.framework.CastState.CONNECTED;},openCastMenu:function(){var onSessionSuccess;if(!this.player.currentSource()){return;} onSessionSuccess=function(){hasConnected=true;this.player.trigger("chromecastConnected");this._reloadTech();}.bind(this);this.getCastContext().requestSession().then(onSessionSuccess,_.noop);},_reloadTech:function(){var player=this.player,currentTime=player.currentTime(),wasPaused=player.paused(),sources=player.currentSources();player.src(sources);player.ready(function(){if(wasPaused){player.pause();}else{player.play();} player.currentTime(currentTime||0);});},getCastContext:getCastContext,getRemotePlayer:function(){return this.remotePlayer;},getRemotePlayerController:function(){return this.remotePlayerController;}});ChromecastSessionManager.isChromecastAPIAvailable=function(){return window.chrome&&window.chrome.cast&&window.cast;};ChromecastSessionManager.isChromecastConnected=function(){return ChromecastSessionManager.isChromecastAPIAvailable()&&getCastContext().getCastState()===cast.framework.CastState.CONNECTED&&hasConnected;};module.exports=ChromecastSessionManager;},{"class.extend":1,underscore:2}],5:[function(require,module,exports){"use strict";var ChromecastButton;ChromecastButton={constructor:function(player){this.constructor.super_.apply(this,arguments);player.on("chromecastConnected",this._onChromecastConnected.bind(this));player.on("chromecastDisconnected",this._onChromecastDisconnected.bind(this));player.on("chromecastDevicesAvailable",this._onChromecastDevicesAvailable.bind(this));player.on("chromecastDevicesUnavailable",this._onChromecastDevicesUnavailable.bind(this));this.controlText("Open Chromecast menu");if(player.chromecastSessionManager&&player.chromecastSessionManager.hasAvailableDevices()){this._onChromecastDevicesAvailable();}else{this._onChromecastDevicesUnavailable();}},buildCSSClass:function(){return"vjs-chromecast-button "+(this._isChromecastConnected?"vjs-chromecast-casting-state ":"")+this.constructor.super_.prototype.buildCSSClass();},handleClick:function(){this.player().trigger("chromecastRequested");},_onChromecastConnected:function(){this._isChromecastConnected=true;this._reloadCSSClasses();},_onChromecastDisconnected:function(){this._isChromecastConnected=false;this._reloadCSSClasses();},_onChromecastDevicesAvailable:function(){this.show();},_onChromecastDevicesUnavailable:function(){this.hide();},_reloadCSSClasses:function(){if(!this.el_){return;} this.el_.className=this.buildCSSClass();}};module.exports=function(videojs){var ChromecastButtonImpl;ChromecastButtonImpl=videojs.extend(videojs.getComponent("Button"),ChromecastButton);videojs.registerComponent("chromecastButton",ChromecastButtonImpl);};},{}],6:[function(require,module,exports){"use strict";var ChromecastSessionManager=require("./chromecast/ChromecastSessionManager"),_=require("underscore"),CHECK_AVAILABILITY_INTERVAL=1e3,CHECK_AVAILABILITY_TIMEOUT=30*1e3;function configureCastContext(options){var context=cast.framework.CastContext.getInstance();context.setOptions({receiverApplicationId:options.receiverAppID||chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED});} function onChromecastRequested(player){player.chromecastSessionManager.openCastMenu();} function setUpChromecastButton(player,options){var indexOpt;if(options.addButtonToControlBar&&!player.controlBar.getChild("chromecastButton")){indexOpt=player.controlBar.children().length;if(typeof options.buttonPositionIndex!=="undefined"){indexOpt=options.buttonPositionIndex>=0?options.buttonPositionIndex:player.controlBar.children().length+options.buttonPositionIndex;} player.controlBar.addChild("chromecastButton",options,indexOpt);} player.on("chromecastRequested",onChromecastRequested.bind(null,player));} function createSessionManager(player){if(!player.chromecastSessionManager){player.chromecastSessionManager=new ChromecastSessionManager(player);}} function enableChromecast(player,options){configureCastContext(options);createSessionManager(player);setUpChromecastButton(player,options);} function waitUntilChromecastAPIsAreAvailable(player,options){var maxTries=CHECK_AVAILABILITY_TIMEOUT/CHECK_AVAILABILITY_INTERVAL,tries=1,intervalID;intervalID=setInterval(function(){if(tries>maxTries){clearInterval(intervalID);return;} if(ChromecastSessionManager.isChromecastAPIAvailable()){clearInterval(intervalID);enableChromecast(player,options);} tries=tries+1;},CHECK_AVAILABILITY_INTERVAL);} module.exports=function(videojs){videojs.registerPlugin("chromecast",function(options){var pluginOptions=_.extend({addButtonToControlBar:true},options||{});this.ready(function(){if(!this.controlBar){return;} if(ChromecastSessionManager.isChromecastAPIAvailable()){enableChromecast(this,pluginOptions);}else{waitUntilChromecastAPIsAreAvailable(this,pluginOptions);}}.bind(this));});};},{"./chromecast/ChromecastSessionManager":4,underscore:2}],7:[function(require,module,exports){"use strict";var _=require("underscore"),preloadWebComponents=require("./preloadWebComponents"),createChromecastButton=require("./components/ChromecastButton"),createChromecastTech=require("./tech/ChromecastTech"),enableChromecast=require("./enableChromecast");module.exports=function(videojs,userOpts){var options=_.defaults(_.extend({},userOpts),{preloadWebComponents:false});if(options.preloadWebComponents){preloadWebComponents();} videojs=videojs||window.videojs;createChromecastButton(videojs);createChromecastTech(videojs);enableChromecast(videojs);};},{"./components/ChromecastButton":5,"./enableChromecast":6,"./preloadWebComponents":8,"./tech/ChromecastTech":10,underscore:2}],8:[function(require,module,exports){"use strict";var _=require("underscore");function doesUserAgentContainString(str){return _.isString(window.navigator.userAgent)&&window.navigator.userAgent.indexOf(str)>=0;} module.exports=function(){var needsWebComponents=!document.registerElement,iosChrome=doesUserAgentContainString("CriOS"),androidChrome;androidChrome=doesUserAgentContainString("Android")&&doesUserAgentContainString("Chrome/")&&window.navigator.presentation;if((androidChrome||iosChrome)&&needsWebComponents){require("webcomponents.js/webcomponents-lite.js");}};},{underscore:2,"webcomponents.js/webcomponents-lite.js":3}],9:[function(require,module,exports){"use strict";require("./index")(undefined,window.SILVERMINE_VIDEOJS_CHROMECAST_CONFIG);},{"./index":7}],10:[function(require,module,exports){"use strict";var ChromecastSessionManager=require("../chromecast/ChromecastSessionManager"),ChromecastTechUI=require("./ChromecastTechUI"),_=require("underscore"),SESSION_TIMEOUT=10*1e3,ChromecastTech;ChromecastTech={constructor:function(options){var subclass;this._eventListeners=[];this.videojsPlayer=this.videojs(options.playerId);this._chromecastSessionManager=this.videojsPlayer.chromecastSessionManager;this._ui=new ChromecastTechUI();this._ui.updatePoster(this.videojsPlayer.poster());subclass=this.constructor.super_.apply(this,arguments);this._remotePlayer=this._chromecastSessionManager.getRemotePlayer();this._remotePlayerController=this._chromecastSessionManager.getRemotePlayerController();this._listenToPlayerControllerEvents();this.on("dispose",this._removeAllEventListeners.bind(this));this._hasPlayedAnyItem=false;this._requestTitle=options.requestTitleFn||_.noop;this._requestSubtitle=options.requestSubtitleFn||_.noop;this._requestCustomData=options.requestCustomDataFn||_.noop;this._initialStartTime=options.startTime||0;this._playSource(options.source,this._initialStartTime);this.ready(function(){this.setMuted(options.muted);}.bind(this));return subclass;},createEl:function(){return this._ui.getDOMElement();},play:function(){if(!this.paused()){return;} if(this.ended()&&!this._isMediaLoading){this._playSource({src:this.videojsPlayer.src()},0);}else{this._remotePlayerController.playOrPause();}},pause:function(){if(!this.paused()&&this._remotePlayer.canPause){this._remotePlayerController.playOrPause();}},paused:function(){return this._remotePlayer.isPaused||this.ended()||this._remotePlayer.playerState===null;},setSource:function(source){if(this._currentSource&&this._currentSource.src===source.src&&this._currentSource.type===source.type){return;} this._currentSource=source;this._playSource(source,0);},_playSource:function(source,startTime){var castSession=this._getCastSession(),mediaInfo=new chrome.cast.media.MediaInfo(source.src,source.type),title=this._requestTitle(source),subtitle=this._requestSubtitle(source),customData=this._requestCustomData(source),request;this.trigger("waiting");this._clearSessionTimeout();mediaInfo.metadata=new chrome.cast.media.GenericMediaMetadata();mediaInfo.metadata.metadataType=chrome.cast.media.MetadataType.GENERIC;mediaInfo.metadata.title=title;mediaInfo.metadata.subtitle=subtitle;if(customData){mediaInfo.customData=customData;} this._ui.updateTitle(title);this._ui.updateSubtitle(subtitle);request=new chrome.cast.media.LoadRequest(mediaInfo);request.autoplay=true;request.currentTime=startTime;this._isMediaLoading=true;this._hasPlayedCurrentItem=false;castSession.loadMedia(request).then(function(){if(!this._hasPlayedAnyItem){this.triggerReady();} this.trigger("loadstart");this.trigger("loadeddata");this.trigger("play");this.trigger("playing");this._hasPlayedAnyItem=true;this._isMediaLoading=false;}.bind(this),this._triggerErrorEvent.bind(this));},setCurrentTime:function(time){var duration=this.duration();if(time>duration||!this._remotePlayer.canSeek){return;} this._remotePlayer.currentTime=Math.min(duration-1,time);this._remotePlayerController.seek();this._triggerTimeUpdateEvent();},currentTime:function(){if(!this._hasPlayedAnyItem){return this._initialStartTime;} return this._remotePlayer.currentTime;},duration:function(){if(!this._hasPlayedAnyItem){return this.videojsPlayer.duration();} return this._remotePlayer.duration;},ended:function(){var mediaSession=this._getMediaSession();return mediaSession?mediaSession.idleReason===chrome.cast.media.IdleReason.FINISHED:false;},volume:function(){return this._remotePlayer.volumeLevel;},setVolume:function(volumeLevel){this._remotePlayer.volumeLevel=volumeLevel;this._remotePlayerController.setVolumeLevel();this._triggerVolumeChangeEvent();},muted:function(){return this._remotePlayer.isMuted;},setMuted:function(isMuted){if(this._remotePlayer.isMuted&&!isMuted||!this._remotePlayer.isMuted&&isMuted){this._remotePlayerController.muteOrUnmute();}},poster:function(){return this._ui.getPoster();},setPoster:function(poster){this._ui.updatePoster(poster);},buffered:function(){return undefined;},seekable:function(){return this.videojs.createTimeRange(0,this.duration());},controls:function(){return false;},playsinline:function(){return true;},supportsFullScreen:function(){return true;},setAutoplay:function(){},playbackRate:function(){var mediaSession=this._getMediaSession();return mediaSession?mediaSession.playbackRate:1;},setPlaybackRate:function(){},load:function(){},readyState:function(){if(this._remotePlayer.playerState==="IDLE"||this._remotePlayer.playerState==="BUFFERING"){return 0;} return 4;},_listenToPlayerControllerEvents:function(){var eventTypes=cast.framework.RemotePlayerEventType;this._addEventListener(this._remotePlayerController,eventTypes.PLAYER_STATE_CHANGED,this._onPlayerStateChanged,this);this._addEventListener(this._remotePlayerController,eventTypes.VOLUME_LEVEL_CHANGED,this._triggerVolumeChangeEvent,this);this._addEventListener(this._remotePlayerController,eventTypes.IS_MUTED_CHANGED,this._triggerVolumeChangeEvent,this);this._addEventListener(this._remotePlayerController,eventTypes.CURRENT_TIME_CHANGED,this._triggerTimeUpdateEvent,this);this._addEventListener(this._remotePlayerController,eventTypes.DURATION_CHANGED,this._triggerDurationChangeEvent,this);},_addEventListener:function(target,type,callback,context){var listener;listener={target:target,type:type,callback:callback,context:context,listener:callback.bind(context)};target.addEventListener(type,listener.listener);this._eventListeners.push(listener);},_removeAllEventListeners:function(){while(this._eventListeners.length>0){this._removeEventListener(this._eventListeners[0]);} this._eventListeners=[];},_removeEventListener:function(listener){var index;listener.target.removeEventListener(listener.type,listener.listener);index=_.findIndex(this._eventListeners,function(registeredListener){return registeredListener.target===listener.target&®isteredListener.type===listener.type&®isteredListener.callback===listener.callback&®isteredListener.context===listener.context;});if(index!==-1){this._eventListeners.splice(index,1);}},_onPlayerStateChanged:function(){var states=chrome.cast.media.PlayerState,playerState=this._remotePlayer.playerState;if(playerState===states.PLAYING){this._hasPlayedCurrentItem=true;this.trigger("play");this.trigger("playing");}else if(playerState===states.PAUSED){this.trigger("pause");}else if(playerState===states.IDLE&&this.ended()||playerState===null&&this._hasPlayedCurrentItem){this._hasPlayedCurrentItem=false;this._closeSessionOnTimeout();this.trigger("ended");this._triggerTimeUpdateEvent();}else if(playerState===states.BUFFERING){this.trigger("waiting");}},_closeSessionOnTimeout:function(){this._clearSessionTimeout();this._sessionTimeoutID=setTimeout(function(){var castSession=this._getCastSession();if(castSession){castSession.endSession(true);} this._clearSessionTimeout();}.bind(this),SESSION_TIMEOUT);},_clearSessionTimeout:function(){if(this._sessionTimeoutID){clearTimeout(this._sessionTimeoutID);this._sessionTimeoutID=false;}},_getCastContext:function(){return this._chromecastSessionManager.getCastContext();},_getCastSession:function(){return this._getCastContext().getCurrentSession();},_getMediaSession:function(){var castSession=this._getCastSession();return castSession?castSession.getMediaSession():null;},_triggerVolumeChangeEvent:function(){this.trigger("volumechange");},_triggerTimeUpdateEvent:function(){this.trigger("timeupdate");},_triggerDurationChangeEvent:function(){this.trigger("durationchange");},_triggerErrorEvent:function(){this.trigger("error");}};module.exports=function(videojs){var Tech=videojs.getComponent("Tech"),ChromecastTechImpl;ChromecastTechImpl=videojs.extend(Tech,ChromecastTech);ChromecastTechImpl.canPlaySource=ChromecastSessionManager.isChromecastConnected.bind(ChromecastSessionManager);ChromecastTechImpl.isSupported=ChromecastSessionManager.isChromecastConnected.bind(ChromecastSessionManager);ChromecastTechImpl.prototype.featuresVolumeControl=true;ChromecastTechImpl.prototype.featuresPlaybackRate=false;ChromecastTechImpl.prototype.movingMediaElementInDOM=false;ChromecastTechImpl.prototype.featuresFullscreenResize=true;ChromecastTechImpl.prototype.featuresTimeupdateEvents=true;ChromecastTechImpl.prototype.featuresProgressEvents=false;ChromecastTechImpl.prototype.featuresNativeTextTracks=false;ChromecastTechImpl.prototype.featuresNativeAudioTracks=false;ChromecastTechImpl.prototype.featuresNativeVideoTracks=false;ChromecastTechImpl.prototype.videojs=videojs;videojs.registerTech("chromecast",ChromecastTechImpl);};},{"../chromecast/ChromecastSessionManager":4,"./ChromecastTechUI":11,underscore:2}],11:[function(require,module,exports){"use strict";var Class=require("class.extend"),ChromecastTechUI;ChromecastTechUI=Class.extend({init:function(){this._el=this._createDOMElement();},_createDOMElement:function(){var el=this._createElement("div","vjs-tech vjs-tech-chromecast"),posterContainerEl=this._createElement("div","vjs-tech-chromecast-poster"),posterImageEl=this._createElement("img","vjs-tech-chromecast-poster-img"),titleEl=this._createElement("div","vjs-tech-chromecast-title"),subtitleEl=this._createElement("div","vjs-tech-chromecast-subtitle"),titleContainer=this._createElement("div","vjs-tech-chromecast-title-container");posterContainerEl.appendChild(posterImageEl);titleContainer.appendChild(titleEl);titleContainer.appendChild(subtitleEl);el.appendChild(titleContainer);el.appendChild(posterContainerEl);return el;},_createElement:function(type,className){var el=document.createElement(type);el.className=className;return el;},getDOMElement:function(){return this._el;},_findPosterEl:function(){return this._el.querySelector(".vjs-tech-chromecast-poster");},_findPosterImageEl:function(){return this._el.querySelector(".vjs-tech-chromecast-poster-img");},_findTitleEl:function(){return this._el.querySelector(".vjs-tech-chromecast-title");},_findSubtitleEl:function(){return this._el.querySelector(".vjs-tech-chromecast-subtitle");},updatePoster:function(poster){var posterImageEl=this._findPosterImageEl();this._poster=poster?poster:null;if(poster){posterImageEl.setAttribute("src",poster);posterImageEl.classList.remove("vjs-tech-chromecast-poster-img-empty");}else{posterImageEl.removeAttribute("src");posterImageEl.classList.add("vjs-tech-chromecast-poster-img-empty");}},getPoster:function(){return this._poster;},updateTitle:function(title){var titleEl=this._findTitleEl();this._title=title;if(title){titleEl.innerHTML=title;titleEl.classList.remove("vjs-tech-chromecast-title-empty");}else{titleEl.classList.add("vjs-tech-chromecast-title-empty");}},updateSubtitle:function(subtitle){var subtitleEl=this._findSubtitleEl();this._subtitle=subtitle;if(subtitle){subtitleEl.innerHTML=subtitle;subtitleEl.classList.remove("vjs-tech-chromecast-subtitle-empty");}else{subtitleEl.classList.add("vjs-tech-chromecast-subtitle-empty");}}});module.exports=ChromecastTechUI;},{"class.extend":1}]},{},[9]);;