
(function (w) {
    /*tagconfig*/
    var config =

{"autoPlay":true,"maxWidth":400,"playerType":2,"showBigPlay":true,"showBigPlayOnPause":true,"volumeControlVertical":true,"showBigPrevNextOnPause":true,"showReplay":true,"showTitle":"left","spinner":2,"scriptId":"AV62567a6bc6d8106d122f0bb4","tagId":"62567a6bc6d8106d122f0bb4","playerVersion":7,"content":{"order":0,"contents":[{"entry":{"thumbnailUrl":"https:\/\/d1w6a77c28m7kb.cloudfront.net\/CampusLore%20LLC\/EP79_03_Who_Is_An_Underrated_QB_Prospect_In_The_Draft\/assets\/68833f02-4c17-4427-924f-5b5fc2574d8e\/Thumbnails\/EP79_03_Who_Is_An_Underrated_QB_Prospect_In_The_Draft.0000000.jpg","name":"NFL: Underrated QB in Draft?"},"url":"https:\/\/cf2224258e08e50d45561ac7a0f22ad7.egress.mediapackage-vod.us-east-1.amazonaws.com\/out\/v1\/16f52578c85b4b67894a6ddc8aad2434\/d034d6cd8af74ad3894b64d0c84c6fd5\/f0ad6631904f455aa26d7f9cbfdd38ca\/index.m3u8"},{"entry":{"thumbnailUrl":"https:\/\/d1w6a77c28m7kb.cloudfront.net\/CampusLore%20LLC\/EP79_02_Did_Buffalo_Overpay_For_WR_Stefon_Diggs\/assets\/77f841ea-2462-46af-be0c-069b0f5973bf\/Thumbnails\/EP79_02_Did_Buffalo_Overpay_For_WR_Stefon_Diggs.0000000.jpg","name":"NFL: Buffalo Overpay Stefon Diggs?"},"url":"https:\/\/cf2224258e08e50d45561ac7a0f22ad7.egress.mediapackage-vod.us-east-1.amazonaws.com\/out\/v1\/7116a11c3f114749930fcbad03020df0\/d034d6cd8af74ad3894b64d0c84c6fd5\/f0ad6631904f455aa26d7f9cbfdd38ca\/index.m3u8"},{"entry":{"thumbnailUrl":"https:\/\/d1w6a77c28m7kb.cloudfront.net\/CampusLore%20LLC\/EP79_01_Can_Carroll_Rebuild_The_Seahawks_In_His_13th_Season\/assets\/76e3f802-c115-4c27-a06f-4d0bffdfdde0\/Thumbnails\/EP79_01_Can_Carroll_Rebuild_The_Seahawks_In_His_13th_Season.0000000.jpg","name":"NFL: Pete Carroll Rebuild Seattle?"},"url":"https:\/\/cf2224258e08e50d45561ac7a0f22ad7.egress.mediapackage-vod.us-east-1.amazonaws.com\/out\/v1\/71559041e8034b86bfe2f150bce137ec\/d034d6cd8af74ad3894b64d0c84c6fd5\/f0ad6631904f455aa26d7f9cbfdd38ca\/index.m3u8"},{"entry":{"thumbnailUrl":"https:\/\/d1w6a77c28m7kb.cloudfront.net\/CampusLore%20LLC\/EP78_14_Is_Lamar_Jackson_Deserving_Of_A_Big_Payday\/assets\/3e53fe91-5fb2-4694-9aa2-f6c4dfd501c2\/Thumbnails\/EP78_14_Is_Lamar_Jackson_Deserving_Of_A_Big_Payday.0000000.jpg","name":"NFL: Lamar Jackson Contract"},"url":"https:\/\/cf2224258e08e50d45561ac7a0f22ad7.egress.mediapackage-vod.us-east-1.amazonaws.com\/out\/v1\/a649076b25fe431f9c07d76cc728d705\/d034d6cd8af74ad3894b64d0c84c6fd5\/f0ad6631904f455aa26d7f9cbfdd38ca\/index.m3u8"}],"breakingAds":5,"breakingAdsMode":"os","type":0},"adConfig":{"vitab":true,"soundButton":true,"pauseButton":true,"timelineMode":"bottom","customLogo":{"height":24,"width":24,"link":"https:\/\/playlist.cloudmcplayer.com\/logo.svg","clickthrough":"https:\/\/www.cloudmc.us\/"},"errorLimit":30,"publisherId":"624e25402d2a7c268c34f1d8","width":100,"height":0,"vastRetry":0,"logo":true,"channelId":"625e45c205749e313d3eb5d7"},"templateId":"62517005405f6739605cf0d6","posDfp1x1":false,"showPrevButton":true,"showNextButton":true,"autoContinue":true,"height":0,"showFullScreen":true,"showDuration":true,"position":"aniplayer_AV62567a6bc6d8106d122f0bb4","closeButtonStyle":{"position":"Top-Right"},"showPauseButton":true,"autoLoop":true,"showBigPrevNext":true,"timelineMode":"bottom","logo":{"clickThrough":"https:\/\/www.cloudmc.us\/","position":"right","url":"https:\/\/playlist.cloudmcplayer.com\/logo.svg"},"startVolume":0,"playerDelay":0,"mobile":{"showNextButton":true,"showBigPrevNext":true,"showFullScreen":true,"showPauseButton":true,"showBigPlay":true,"showBigPlayOnPause":true,"showPrevButton":true},"tracking":{"enabled":true},"showVolumeControl":true,"showSoundButton":true,"width":100}
var b =
{}
var ab =
{}


    /*tagconfig*/
    var a = config;
    var st = {
        target: function () {
            if (this.sp) {
                return
            }
            var ua = navigator.userAgent || navigator.vendor || window.opera;
            var uav = navigator.appVersion ? navigator.appVersion.toLowerCase() : "";
            var op = 2;
            if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(ua.substr(0, 4))) {
                op = 1;
            } else {
                if (/web0s|webos|tizen/i.test(uav)) {
                    op = 4;
                }
            }
            this.op = op;
        },
        getConfig: function () {
                        function getRC(ab) {
                if (ab && ab.length) {
                    var inc = 0;
                    var rand = Math.floor(Math.random() * 100) + 1;
                    for (i = 0; i < ab.length; i++) {
                        b1 = ab[i];
                        inc += b1.sp;
                        if (b1.a && inc >= rand) {
                            return b1.a;
                        }
                    }
                }
            }

            function merge(target, source) {
                if (typeof source !== 'object' || Array.isArray(source)) return target;
                for (var key in source) {
                    if (typeof source[key] === 'object' && !Array.isArray(source[key])) {
                        if (!target[key]) Object.assign(target, { [key]: {} });
                        merge(target[key], source[key]);
                    } else {
                        Object.assign(target, { [key]: source[key] });
                    }
                }
            }

            var cfg = config;
            try {
                var i, b1;
                if (b && b.length > 0) {
                    st.target();
                    for (i = 0; i < b.length; i++) {
                        b1 = b[i];
                        if (b1.t && b1.t.p
                            && b1.t.p == this.op && b1.a) {
                            return b1.a;
                        }
                    }
                }

                var r1 = getRC(ab) || cfg;
                if (typeof ad !== 'undefined' && ad.length > 0) {
                    var r2 = getRC(ad);
                    merge(r1, r2);
                }
                return r1;
            } catch (e) {

            }

            return cfg;
        },
        track: function(e, m) {
                if (!this.trackUrl) {
                        this.trackUrl = "https://" + (a.trackDomain || "track1.aniview.com") + "/track?pid=" + a.adConfig.publisherId + "&cid=" + a.adConfig.channelId + "&cb=" + Date.now() + "&r=" + location.host + "&stagid=" + (a.tagId || "") + "&stplid=" + (a.templateId || "") + "&d35=" + (a.adConfig.sabTest || "") + "&d65=" + (a.adConfig.nabTest || "") + "&e=";
                  }
                  m = m ? m : "";
                  (new Image()).src = this.trackUrl + e + m;
                  
        },
        unique: function() {
            if (!this.win.aniplayerPos)
                this.win.aniplayerPos = {};
            this.win.aniplayerPos[a.position] = true;
            return true;
        },
        findWin: function() {
           try {
                if ((!a.posDfp1x1 && !a.posClass && !a.posSelector && !a.posId && !a.posTag) || (w === top) || !w.frameElement) {
                    this.doc = document;
                    this.win = w;
                } else if (a.posDfp1x1 && w.frameElement) {
                    this.win = parent;
                    this.doc = parent.document;
                } else {
                    this.win = top;
                    this.doc = top.document;
                }
            } catch (f) {
                this.doc = document;
                this.win = w;
            }
        },
        postCreate: function() {
            
        },
        retry: function() {
           if (this.retryCnt++ > this.timeout) {
                this.track("AV_M3", "&prbdres=nopos&sn=" + encodeURIComponent(location.href).slice(0, 400));
                return;
            }
            var that = this;
            setTimeout(function() {
                that.position();
            }, 250);
        },
        create: function(p, n) {
            var d1 = document.createElement("div");
            if(a.scriptId) {
		        d1.className = a.scriptId;
		    }
            d1.style.width = "100%";
            d1.style.margin = "0 auto";
            d1.style.maxWidth = "" + a.maxWidth + "px";
            var d2 = document.createElement("div");
            d2.id = "aniBox";
            var d3 = document.createElement("div");
            d3.id = a.position;
            if (p === this.doc || p === this.doc.head)
                p = this.doc.body;
            if (n) {
                p.insertBefore(d1, n);
            } else {
                p.appendChild(d1);
            }
            a.refDiv = p;
            d1.appendChild(d2);
            d2.appendChild(d3);
            this.postCreate(d1);
        },
        position: function() {
            var p = this.doc;
            var isScp = false;
            if (a.posSelector) {
                try {
                    var q = this.doc.querySelectorAll(a.posSelector);
                    var l = 0;
                    if(a.posCounter > 0) {
                        l = a.posCounter - 1;
                    }
                    p = q[l];
                } catch (e) {
                    this.track("AV_M3", "&prbdres=badpos&sn=" + encodeURIComponent(location.href).slice(0, 400));
                    return;
                }
                if (!p) {
                    this.retry();
                    return;
                }
            }
            if (a.posId) {
                p = this.doc.getElementById(a.posId);
                if (!p) {
                    this.retry();
                    return;
                }
            }
            if (a.posTag) {
                var c = a.posTag.split("#");
                if (c && c.length == 2) {
                    var e = p.getElementsByTagName(c[0]);
                    if (e.length == 0) {
                        this.retry();
                        return;
                    }
                    p = e[Math.min(c[1] - 1, e.length - 1)];
                }
            }
            if (a.posClass) {
                var c = a.posClass.split("#");
                var e = 1;
                if (c.length == 2) {
                    e = c[1];
                }
                var f = p.getElementsByClassName(c[0]);
                if (f.length > 0) {
                    p = f[Math.min(e - 1, f.length - 1)];
                }
                if (!p) {
                    this.retry();
                    return;
                }
            }
            if (a.posDfp1x1 && window.frameElement) {
                n = window.frameElement.parentNode.parentNode;
                p = n.parentNode;
                if ((frameElement.clientHeight > 5 || document.body.clientHeight > 5) && !a.nohideIframe) {
                    frameElement.style.height = "0px";
                }
                if (a.posType == "after") {
                    n = n.nextElementSibling;
                }
            }
            var n;
            if (p === this.doc) {
                n = this.doc.getElementById(a.scriptId);
                if (n) {
                    n.id += "-used";
                    p = n.parentNode;
                }
            }
            if (p === this.doc.head) {
                n = null;
                p = this.doc;
            }
            if (a.posType && a.posType !== "in" && !n) {
                if (a.posType === "after" && p.nextElementSibling) {
                    n = p.nextElementSibling;
                } else {
                    n = null;
                }
                p = p.parentNode;
            }
            if (p) {
                if (!p.av_setpos) {
                    p.av_setpos = {};
                }
                if (!p.av_setpos[a.position]) {
                    p.av_setpos[a.position] = true;
                    a.position += "-" + Date.now();
                    this.create(p, n);
                    this.load(a.playerVersion);
                } else {
                    this.track("AV_M3", "&prbdres=duppos&sn=" + encodeURIComponent(location.href).slice(0, 400));
                }
            }
        },
        fetchContent: function(callback) {
           		var url = "https://09nfgyvbtl.execute-api.us-east-1.amazonaws.com/prod/playlist?playlistId=1640165690";
		var xhr = new XMLHttpRequest();
		xhr.open("GET", url, true);
		xhr.onload = function () {
			xhr.onload = null;
			try {
				var json = JSON.parse(xhr.responseText).sort((a, b) => b.sequence - a.sequence).reverse();
				if (json) {
					var _contents = [];
					json.forEach((element) => {
						_contents.push(element);
					});
					a.content.contents = _contents;
					console.log("video content", json);
				}
			} catch (e) {
				console.log(e);
			}
			callback();
		};
		xhr.send();
		getDevicetype = function () {
			try {
				if (/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(navigator.userAgent)) {
					return "mobile";
				}
				if (/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(navigator.userAgent)) {
					return "mobile";
				}
				return "desktop";
			} catch (error) {
				console.log(error);
			}
		};

        },
        load: function(playerVersion) {
            var that = this;
            var baseJsUrl = "https://player.avplayer.com/script/" + (playerVersion >= 8 ? playerVersion : 2) + "/v/";
            var loadCounter = 0;
            var errorCounter = 0;
            function checkIfLoad() {
                if (++loadCounter > 1) {
                    that.init(playerVersion);
                }
            }
            function checkIfError() {
                if (++errorCounter < 2) {
                    fetchScript(a.baseJsUrl || baseJsUrl);
                } else if (errorCounter < 4) {
                    fetchScript(baseJsUrl);
                } else if (errorCounter < 16) {
                    setTimeout(function() {
                        fetchScript(baseJsUrl);
                    }, 5000);
                }
            }
            function fetchScript(baseJsUrl) {
                var scp = that.doc.createElement("script");
                scp.src = baseJsUrl + "avcplayer.js";
                scp.onload = function() {
                    scp.onload = null;
                    checkIfLoad();
                };
                scp.onerror = function() {
                    scp.onerror = null;
                    that.doc.body.removeChild(scp);
                    checkIfError();
                };
                scp.async = true;
                that.doc.body.appendChild(scp);
            }
            this.fetchContent(checkIfLoad);
            fetchScript(a.baseJsUrl || baseJsUrl);
        },
        postStart: function(p) {
            
        },
        getAttr: function() {
            if (a.scriptId) {
                var s = document.getElementById(a.scriptId) || document.getElementById(a.scriptId + "-used");
                if (s) {
                    for (var i = 0, t = s.attributes; i < s.attributes.length; i++) {
                        if (t[i].nodeName && t[i].nodeName.indexOf("data-") == 0) {
                            var n = t[i].nodeName.replace(/^data-/, "").replace(/[-_]+?(\w)/g, function (_, letter) { return letter.toUpperCase(); }).split(".");
                            var lastProp = n.pop();
                            try {
                                var innerConfig = n.reduce(function (a, prop) { return a[prop]; }, a);
                                innerConfig[lastProp] = t[i].nodeValue;
                            } catch(e) {
                            }
                        }
                    }
                    if (s.src) {
                        var p = s.src.indexOf("?");
                        if (p > 10) {
                            var r = (s.src.substring(p + 1, s.src.length));
                            a.adConfig.ref1 = (a.adConfig.ref1 || "") + "&" + (r || "");
                        }
                    }
                }
            }
        },
        start: function(player) {
            		this.p = player;
		if (this.pbjs && this.pbjs.preparePlayer) {
			this.pbjs.preparePlayer(player, st);
		}
		if (a.playerApi && typeof this.win[a.playerApi] === "function") {
			try {
				this.win[a.playerApi](a, player);
			} catch (ex) {
			}
		}
		player.nextContent();
		this.postStart(player);
		var currentcontent;
		var _playlistId = 1640165690;
		var _sessionId = Math.random().toString(36).substr(2, 9);
		var endPointurl = "https://beacons.cloudmcapp.com/prod/streams/beacon_datastream_prod/beaconrecord/";
		player.on("ContentVideoStart", function (event, eventData) {
			let _currentcontent = a.content.contents;
			for (let index = 0; index < _currentcontent.length; index++) {
				let element = _currentcontent[index];
				if (element.url === eventData.source) {
					currentcontent = element;
				}
			}
			contentBeacons("ContentVideoStart");
		});
		player.on("ContentVideoFirstQuartile", function (event, eventData) {
			contentBeacons("ContentVideoFirstQuartile");
		});
		player.on("ContentVideoMidpoint", function (event, eventData) {
			contentBeacons("ContentVideoMidpoint");
		});
		player.on("ContentVideoThirdQuartile", function (event, eventData) {
			contentBeacons("ContentVideoThirdQuartile");
		});
		player.on("ContentVideoComplete", function (event, eventData) {
			contentBeacons("ContentVideoComplete");
		});
		player.on("AdImpression", function (event, eventData) {
			adImpBeacons("AdImpression", eventData);
		});
		player.on("AdVideoFirstQuartile", function (event, eventData) {
			adBeacons("AdVideoFirstQuartile", eventData);
		});
		player.on("AdVideoMidpoint", function (event, eventData) {
			adBeacons("AdVideoMidpoint", eventData);
		});
		player.on("AdVideoThirdQuartile", function (event, eventData) {
			adBeacons("AdVideoThirdQuartile", eventData);
		});
		player.on("AdVideoComplete", function (event, eventData) {
			adBeacons("AdVideoComplete", eventData);
		});
		player.on("AdClickThru", function (event, eventData) {
			adBeacons("AdClickThru", eventData);
		});
		function contentBeacons (event) {
			let _partitionKey = Math.round(new Date().getTime() / 1000);
			let _data = {
					Data: {
						eventType: event,
						adServer: "aniview",
						publisherId: currentcontent.publisherId,
						videoId: currentcontent.videoId,
						contentProducerId: currentcontent.contentproducer,
						deviceType: getDevicetype(),
						referrer: encodeURIComponent(window.location.href),
						playlistId: _playlistId,
						userAgent: encodeURI(navigator.userAgent),
						timeStamp: Date.now(),
						sessionId: _sessionId,
						bidCpm: 0,
						pubCpm: 0,
						floorCpm: 0,
						bidCode: "",
						bidder: ""
					},
					PartitionKey: _partitionKey
				};
			_xhttp(_data, event);
		}
		function adBeacons (event, eventData) {
			let _partitionKey = Math.round(new Date().getTime() / 1000);
			let _adData = {
					Data: {
						eventType: event,
						adServer: "aniview",
						publisherId: currentcontent.publisherId,
						videoId: currentcontent.videoId,
						contentProducerId: currentcontent.contentproducer,
						deviceType: getDevicetype(),
						referrer: encodeURIComponent(window.location.href),
						playlistId: _playlistId,
						userAgent: encodeURI(navigator.userAgent),
						timeStamp: Date.now(),
						sessionId: _sessionId,
						bidCpm: 0,
						pubCpm: 0,
						floorCpm: 0,
						bidCode: "",
						bidder: ""
					},
					PartitionKey: _partitionKey
				};
			_xhttp(_adData, event);
		}
		function adImpBeacons (event, eventData) {
			let _partitionKey = Math.round(new Date().getTime() / 1000);
			let _adData = {
					Data: {
						eventType: event,
						adServer: "aniview",
						publisherId: currentcontent.publisherId,
						videoId: currentcontent.videoId,
						contentProducerId: currentcontent.contentproducer,
						deviceType: getDevicetype(),
						referrer: encodeURIComponent(window.location.href),
						playlistId: _playlistId,
						userAgent: encodeURI(navigator.userAgent),
						timeStamp: Date.now(),
						sessionId: _sessionId,
						bidCpm: eventData.p1.tagInfo.bidCpm,
						pubCpm: eventData.p1.tagInfo.pubCpm,
						floorCpm: eventData.p1.tagInfo.floorCpm,
						bidCode: eventData.p1.tagInfo.bidCode,
						bidder: eventData.p1.tagInfo.bidder
					},
					PartitionKey: _partitionKey
				};
			_xhttp(_adData, event);
		}
		function _xhttp (data, eventType) {
			try {
				const xhttp = new XMLHttpRequest();
				xhttp.open("PUT", endPointurl, true);
				xhttp.setRequestHeader("Content-Type", "application/json");
				xhttp.send(JSON.stringify(data));
				console.log("sending data", data, eventType);
			} catch (error) {
				console.log(error);
			}
		}

        },
        preRun: function() {
            
        },
        run: function() {
            this.config = a = config = this.getConfig();
            this.a = a;
            this.getAttr();
            this.preRun();
            this.findWin();
            if (!this.doc.body) {
                this.doc.addEventListener("DOMContentLoaded", function() {
                    st.run();
                });
                if (this.bodyRetry > 0) {
                    setTimeout(function(){
                        st.run()
                    }, 250);
                    this.domRetry--;
                }
                return;
            }
            if (a.configApi && typeof this.win[a.configApi] === "function") {
                try {
                    this.win[a.configApi](a);
                } catch (ex) {
                }
            }
            if (this.unique() && !this.loaded) {
                this.loaded = true;
                this.track("playerLoaded");
                this.retryCnt = 0;
                this.timeout = a.posTimeout || 40;
                this.pbjs = window.aniviewRenderer && window.aniviewRenderer.units && window.aniviewRenderer.units[a.scriptId];
                if (this.pbjs && this.pbjs.prepareConfig) {
                    this.pbjs.prepareConfig(a, st);
                }
                this.position();
            }
        },
        init: function(playerVersion) {
            var that = this;
                this.getAttr();
                var isNewPlayer = playerVersion >= 8;
                var playerApiName = isNewPlayer ? "avContentPlayer" : "_avcp";
                function initPlayer(playerApi) {
                    return playerApi.createPlayer()
                        .then(function (playerClass) {
                            that.start(new playerClass(a));
                        })
                }
                function findPlayerApi(playerApiName) {
                    var apiClass;
                    var fallbackApiClass;
                    try {
                        if (that.win[playerApiName]) {
                            apiClass = that.win[playerApiName];
                        } else if (window[playerApiName]) {
                            apiClass = window[playerApiName];
                        } else {
                            apiClass = top[playerApiName];
                        }
                    } catch(exp) {
                        try {
                            fallbackApiClass = window[playerApiName];
                        } catch(exp) {}
                    }
                    return { apiClass: apiClass, fallbackApiClass: fallbackApiClass };
                }
                var playerApi = findPlayerApi(playerApiName);
                var playerApiClass = playerApi.apiClass;
                var playerApiFallbackClass = playerApi.fallbackApiClass;
                if (isNewPlayer && !playerApiClass && !playerApiFallbackClass) {
                    playerApi = findPlayerApi("_avcp");
                    playerApiClass = playerApi.apiClass;
                    playerApiFallbackClass = playerApi.fallbackApiClass;
                    isNewPlayer = false;
                    if (!playerApiClass && !playerApiFallbackClass) {
                        a.baseJsUrl = null;
                        that.load(7);
                        return;
                    }
                }
                if (isNewPlayer) {
                    try {
                        initPlayer(playerApiClass).catch(function () {
                            initPlayer(playerApiFallbackClass);
                        });
                    } catch (e) {
                        initPlayer(playerApiFallbackClass);
                    }
                } else {
                    var player;
                    try {
                        player = new playerApiClass(a);
                    } catch (e) {
                        player = new playerApiFallbackClass(a);
                    }
                    that.start(player);
                }
        },
        domRetry: 20
    };
    if(a.playerDelay > 0) {
        setTimeout(function(){
            st.run();
        }, a.playerDelay * 1000);
    } else {
       st.run();
    }
})(window);
