1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795 |
- /*! h5vod wrapper 2022-07-26-2:29 */
- !function (e, a) {
- "object" == typeof exports && "undefined" != typeof module ? module.exports = a(require("global/window"), require("global/document")) : "function" == typeof define && define.amd ? define(["global/window", "global/document"], a) : (e = e || self).vodh5player = a(e.window, e.document)
- }(this, function (window$1, document) {
- "use strict";
- window$1 = window$1 && Object.prototype.hasOwnProperty.call(window$1, "default") ? window$1.default : window$1,
- document = document && Object.prototype.hasOwnProperty.call(document, "default") ? document.default : document;
- var wrapperversion = "2.7.8"
- , wrapperupdate = "22-7-20"
- , vodh5player = {}
- , P2P_FC = ["电视剧"]
- , NOTP2P_FC = [];
- function getvodplayerNS() {
- return void 0 === vodh5player._namespace && (vodh5player._namespace = {}),
- vodh5player._namespace
- }
- function VodConstructer(id) {
- var this_ = this;
- this.id = "VC_" + id,
- this_.isSafariPreAdHasShowed_ = !1,
- this_.isStartTimeHasSet_ = !1,
- this_.delayStartTime_ = 0,
- this.debug = vodh5player.DEBUG,
- this.PRE_AD_URL,
- this.POST_AD_URL,
- this.BANNER_AD_URL,
- this.PAUSE_AD_URL,
- this.VIDEO_CORE_NAME = "vodh5core",
- this.VIDEO_CORE_URL = "video_novhs.min.js",
- this.VIDEO_LANG_URL = "zh-CN.js",
- this.VIDEO_LANG_NAME = "vodh5Lang_" + this.VIDEO_LANG_URL,
- vodh5player.RELEASE ? this.VHS_URL = "vhs_drm.min.js" : this.VHS_URL = vodh5player.DRM ? "vhs_drm.min.js" : "vhs.min.js",
- this.VHS_NAME = "vodh5_" + this.VHS_URL,
- this.VIDEO_CSS_URL = "",
- this.VIDEO_CSS2_URL = "",
- this.config,
- this.allCoreLoaded = !1,
- this.vjsplayer,
- this.vodParas,
- this.group,
- this.HTTP_PRE = "https://",
- this.container_,
- this.PLAYER_TYPE_INDEX,
- this.analyticObj = {},
- this.analyticObj.playScene = vodh5player.PLAY_SCENE,
- this.analyticObj.playerversion = vodh5player.VERSION + "-" + wrapperversion,
- this.analyticObj.playerAppname = vodh5player.APP_NAME,
- this.analyticObj.streamType = "vod",
- this.analyticObj.streamProtocol = "HLS",
- this.analyticObj.playAMR = "F",
- this.analyticObj.P2PStyle = "F",
- this.analyticObj.ready4play1_1 = !1,
- this.analyticObj.firstplay = !1,
- this.analyticObj.cumulativeTime = 0,
- this.analyticObj.cumulativeTimeTimer,
- this.analyticObj.heartbeat,
- this.analyticObj.freezed = !1,
- this.analyticObj.loadtime = 0,
- this.analyticObj.loadtimeTimer,
- this.analyticObj.errorSent = !1,
- this.analyticObj.cdnsip = "none",
- this.analyticObj.cdncip = "none",
- this.setStartTime_ = !1,
- this.preAdVdnTimeOut_,
- this.preAdVdnTimeOutState_ = !1,
- this.postAdVdnTimeOut_,
- this.postAdVdnTimeOutState_ = !1,
- this.firstEnded_,
- this.firstFramePlayed_ = !1,
- this.paramTranslation = function (e) {
- switch ("" !== (this.vodParas = e).language && "en" !== e.language && (this.VIDEO_LANG_URL = e.language + ".js",
- this.VIDEO_LANG_NAME = "vodh5Lang_" + this.VIDEO_LANG_URL),
- e.configType && (vodh5player.CONFIG_URL = "config/" + e.configType + ".json"),
- vodh5player.HLSP2P_HAS_INSTANCE_RUNNING ? (this.vodParas.HLSP2P = !0,
- vodh5player.HLSP2P_HAS_INSTANCE_RUNNING = !0) : this.vodParas.HLSP2P = !1,
- void 0 !== this.vodParas.cms && void 0 !== this.vodParas.cms.fc && -1 < P2P_FC.indexOf(this.vodParas.cms.fc) ? vodh5player.P2P = !0 : vodh5player.P2P = !1,
- vodh5player.P2P ? this.analyticObj.P2PStyle = "T" : this.analyticObj.P2PStyle = "F",
- this.vodParas.dpr = window.devicePixelRatio,
- void 0 !== this.vodParas.enableVip && !0 === this.vodParas.enableVip && (vodh5player.enableVip = !0,
- vodh5player.userLevel = this.vodParas.userLevel || 0,
- void 0 !== this.vodParas.skipAdTip && !0 === this.vodParas.skipAdTip && (vodh5player.skipAdTip = !0)),
- vodh5player.trace("enableVip:" + vodh5player.enableVip),
- vodh5player.trace("userLevel:" + vodh5player.userLevel),
- vodh5player.trace("skipAdTip:" + vodh5player.skipAdTip),
- vodh5player.trace("p2p:" + (vodh5player.P2P ? "on" : "off")),
- void 0 === this.vodParas.PLAYER_TYPE_INDEX ? this.PLAYER_TYPE_INDEX = 0 : this.PLAYER_TYPE_INDEX = this.vodParas.PLAYER_TYPE_INDEX,
- !0 === this.vodParas.isVod4k && (this.PLAYER_TYPE_INDEX = this.vodParas.PLAYER_TYPE_INDEX = 1),
- this.vodParas,
- vodh5player.enableVip ? vodh5player.trace("player type no longer valid when costom config is on!") : vodh5player.trace("player type index:" + this.PLAYER_TYPE_INDEX + " in " + vodh5player.PLAYER_TYPES),
- 1 === this.PLAYER_TYPE_INDEX && (vodh5player.PLAY_SCENE = "HTML5.PC.4K",
- this.analyticObj.playScene = vodh5player.PLAY_SCENE),
- vodh5player.PLAYER_NAME = vodh5player.DRM ? "HTML5_VOD_DRM_PLAYER" : "HTML5_VOD_PLAYER",
- this.group = e.group,
- e.style) {
- case void 0:
- case "":
- this.VIDEO_CSS_URL = "./css/vodh5player-v2.min.css";
- break;
- case "ipanda":
- this.VIDEO_CSS_URL = "./css/vodh5player-ipanda.min.css";
- break;
- default:
- this.VIDEO_CSS_URL = "./css/vodh5player-v2.min.css"
- }
- void 0 !== this.vodParas && !1 !== this.vodParas.enableQualityLock ? vodh5player.enableQualityLock = !0 : 0 == this.vodParas.enableQualityLock && (vodh5player.enableQualityLock = !1),
- !1 !== this.vodParas.hasPreAD && (this.vodParas.hasPreAD = !0),
- !1 !== this.vodParas.hasPauseAD && (this.vodParas.hasPauseAD = !0),
- !1 !== this.vodParas.hasBannerAD && (this.vodParas.hasBannerAD = !0),
- !1 !== this.vodParas.hasPostAD && (this.vodParas.hasPostAD = !0),
- void 0 === this.vodParas.isHttps ? (-1 !== location.href.indexOf("https://") ? (this.HTTP_PRE = "https://",
- this.vodParas.isHttps = !0,
- vodh5player.HTTP_PRE = "https://") : (this.HTTP_PRE = "http://",
- this.vodParas.isHttps = !1,
- vodh5player.HTTP_PRE = "http://"),
- vodh5player.trace("para <https> is undefined use pageurl prefix which is " + this.vodParas.isHttps)) : !0 === this.vodParas.isHttps ? (this.HTTP_PRE = "https://",
- this.vodParas.isHttps = !0,
- vodh5player.HTTP_PRE = "https://") : (this.HTTP_PRE = "http://",
- this.vodParas.isHttps = !1,
- vodh5player.HTTP_PRE = "http://"),
- void 0 !== this.vodParas.preAdUrl && (this.PRE_AD_URL = this.vodParas.preAdUrl),
- void 0 !== this.vodParas.postAdUrl && (this.POST_AD_URL = this.vodParas.postAdUrl),
- void 0 !== this.vodParas.pauseAdUrl && (this.PAUSE_AD_URL = this.vodParas.pauseAdUrl),
- void 0 !== this.vodParas.bannerAdUrl && (this.BANNER_AD_URL = this.vodParas.bannerAdUrl),
- void 0 === this.vodParas.listMode && (this.vodParas.listMode = !1),
- !0 === this.vodParas.hasBarrage && void 0 !== this.vodParas.barrageApp && void 0 !== this.vodParas.barrageItemId && void 0 !== this.vodParas.barrageType ? this.vodParas._hasBarrage = !0 : this.vodParas._hasBarrage = !1,
- vodh5player.trace("barrage:" + (this.vodParas._hasBarrage ? "on" : "off")),
- void 0 === this.vodParas.setup_autoNext && (this.vodParas.setup_autoNext = !0),
- void 0 === this.vodParas.setup_loop && (this.vodParas.setup_loop = !1),
- !1 !== this.vodParas.ui_cuePoint && (this.vodParas.ui_cuePoint = !0),
- void 0 === this.vodParas.autoplay || "true" === this.vodParas.autoplay || !0 === this.vodParas.autoplay ? this.vodParas.autoplay = !0 : "false" === this.vodParas.autoplay || !1 === this.vodParas.autoplay ? this.vodParas.autoplay = !1 : "muted" === this.vodParas.autoplay ? this.vodParas.autoplay = "muted" : "any" === this.vodParas.autoplay ? this.vodParas.autoplay = "any" : this.vodParas.autoplay = !0,
- vodh5player.trace("autoplay:" + this.vodParas.autoplay),
- void 0 === this.vodParas.ui_pictureInPicture && (this.vodParas.ui_pictureInPicture = !0),
- !0 === this.vodParas.chooseVideo && (vodh5player.trace("开启选集功能,videoAlbum:" + this.vodParas.videoAlbum),
- void 0 !== this.vodParas.column_id_pk ? vodh5player.CHOOSE_VIDEO_URL += "&id=" + this.vodParas.column_id_pk : vodh5player.CHOOSE_VIDEO_URL += "&id=PAGE1431952477871318")
- }
- ,
- this.loadCore = function () {
- var e, a = this;
- null !== document.getElementById("vodh5core") ? (vodh5player.trace("vodh5core already exist"),
- vodh5player.VERSION = videojs.PLAYER_VERSION,
- a.loadVHS()) : (vodh5player.trace("vodh5core loading..."),
- (e = vodh5player.createElementByType("script", "", "absolute", "0px", "0px", "0px", "0px")).src =
- this.HTTP_PRE + window.location.host + '/static/js/lib/video_novhs.min.js',
- // this.HTTP_PRE + vodh5player.DOMAIN + this.VIDEO_CORE_URL,
- document.getElementsByTagName("head")[0].appendChild(e),
- e.onload = function () {
- e.id = a.VIDEO_CORE_NAME,
- vodh5player.VERSION = videojs.PLAYER_VERSION,
- a.loadVHS()
- }
- )
- }
- ,
- this.loadVHS = function () {
- var e, a = this;
- null !== document.getElementById(this.VHS_NAME) ? this.loadPlugins() : ((e = vodh5player.createElementByType("script", "", "absolute", "0px", "0px", "0px", "0px")).src = this.HTTP_PRE + vodh5player.DOMAIN + this.VHS_URL,
- document.getElementsByTagName("head")[0].appendChild(e),
- e.onload = function () {
- e.id = a.VHS_NAME,
- a.loadPlugins()
- }
- )
- }
- ,
- this.loadSingletonWorker = function () {
- var r, t = this;
- !1 === vodh5player.wasmSupported_ ? vodh5player.convivaOn ? t.loadConvivaJs1() : t.loadStyle() : (vodh5player.workerModuleInitialized ? vodh5player.trace("worker already onRuntimeInitialized , skip...") : vodh5player.workerLoaded ? (vodh5player.trace("worker already loaded"),
- vodh5player.workerWatcherVCList.push(t),
- console.log(vodh5player.workerWatcherVCList.length)) : vodh5player.workIsLoading ? (vodh5player.trace("worker is loading... by over player"),
- (r = document.getElementById(vodh5player.H5_WORKER_NAME)).addEventListener("load", function () {
- vodh5player.trace("worker has loaded by over players"),
- vodh5player.workerWatcherVCList.push(t)
- })) : ((r = vodh5player.createElementByType("script", "", "absolute", "0px", "0px", "0px", "0px")).src = this.HTTP_PRE + vodh5player.DOMAIN + vodh5player.H5_WORKER,
- document.getElementsByTagName("head")[0].appendChild(r),
- vodh5player.workIsLoading = !0,
- r.id = vodh5player.H5_WORKER_NAME,
- r.onload = function () {
- vodh5player.trace(">>" + r.src + " loaded"),
- vodh5player.workerLoaded = !0;
- var e, a = null;
- window.CNTVH5PlayerModule ? a = window.CNTVH5PlayerModule : window.CNTVH5PlayerModule = a,
- "function" == typeof CNTVModule && (a = CNTVModule(),
- window.CNTVH5PlayerModule = a,
- e = setTimeout(function () {
- vodh5player.trace("worker timeout!", !0),
- vodh5player.workerStatus.workertimeout = !0,
- t.workerTimeroutError()
- }, vodh5player.WORKER_TIMEOUT)),
- a.onRuntimeInitialized = function () {
- vodh5player.trace("worker onRuntimeInitialized"),
- vodh5player.workerModuleInitialized = !0,
- vodh5player.workerStatus.initialized = !0,
- window.moduleRoot = window,
- clearTimeout(e),
- t.loadChecker()
- }
- }
- ),
- t.loadHLSP2P())
- }
- ,
- this.loadPlugins = function () {
- var e, a = this;
- null !== document.getElementById(this.VIDEO_LANG_NAME) ? a.loadSingletonWorker() : ((e = vodh5player.createElementByType("script", "", "absolute", "0px", "0px", "0px", "0px")).src = this.HTTP_PRE + vodh5player.DOMAIN + this.VIDEO_LANG_URL,
- document.getElementsByTagName("head")[0].appendChild(e),
- e.onload = function () {
- e.id = a.VIDEO_LANG_NAME,
- a.loadSingletonWorker()
- }
- )
- }
- ,
- this.loadHLSP2P = function () {
- var e, a = this;
- !vodh5player.P2P || null !== document.getElementById(vodh5player.HLSP2P_NAME) ? this.loadChooseVideo() : ((e = vodh5player.createElementByType("script", "", "absolute", "0px", "0px", "0px", "0px")).src = this.HTTP_PRE + vodh5player.DOMAIN + vodh5player.HLSP2P,
- e.setAttribute("crossorigin", "anonymous"),
- document.getElementsByTagName("head")[0].appendChild(e),
- e.onload = function () {
- vodh5player.hlsp2pLoaded || (e.id = vodh5player.HLSP2P_NAME,
- vodh5player.hlsp2pLoaded = !0),
- a.loadChooseVideo()
- }
- )
- }
- ,
- this.loadHLSP2P_2 = function () {
- var e, a = this;
- null !== document.getElementById(vodh5player.HLSP2P_2_NAME) ? this.loadHLSP2P() : ((e = vodh5player.createElementByType("script", "", "absolute", "0px", "0px", "0px", "0px")).src = this.HTTP_PRE + vodh5player.DOMAIN + vodh5player.HLSP2P_2,
- e.setAttribute("crossorigin", "anonymous"),
- document.getElementsByTagName("head")[0].appendChild(e),
- e.onload = function () {
- e.id = vodh5player.HLSP2P_2_NAME,
- vodh5player.hlsp2pLoaded = !0,
- a.loadChooseVideo()
- }
- )
- }
- ,
- this.loadChooseVideo = function () {
- var e, a = this;
- !0 !== a.vodParas.chooseVideo ? a.loadConfig() : null !== document.getElementById(vodh5player.CHOOSE_VIDEO_NAME) ? this.loadConfig() : ((e = vodh5player.createElementByType("script", "", "absolute", "0px", "0px", "0px", "0px")).src = this.HTTP_PRE + vodh5player.CHOOSE_VIDEO_URL + "&callback=chooseVideoJsonpHandler",
- window.chooseVideoJsonpHandler = a.chooseVideoJsonpHandler,
- document.getElementsByTagName("head")[0].appendChild(e),
- e.onload = function () {
- e.id = vodh5player.CHOOSE_VIDEO_NAME,
- a.loadConfig()
- }
- )
- }
- ,
- this.chooseVideoJsonpHandler = function (e) {
- vodh5player.chooseVideoData = e,
- delete window.chooseVideoJsonpHandler
- }
- ,
- this.loadConfig = function () {
- var a = this;
- vodh5player.xhrRequest({
- url: vodh5player.HTTP_PRE + vodh5player.DOMAIN + vodh5player.CONFIG_URL,
- timeout: 1e4,
- data: {},
- success: function (e) {
- a.config = e,
- vodh5player.enableVip && a.processConfig(e),
- vodh5player.convivaOn ? a.loadConvivaJs1() : a.loadStyle()
- },
- error: function (e) {
- vodh5player.trace("config load error" + e),
- vodh5player.convivaOn ? a.loadConvivaJs1() : a.loadStyle()
- }
- })
- }
- ,
- this.loadConvivaJs1 = function () {
- var e, a = this;
- null !== document.getElementById(vodh5player.CONVIVA_URL_NAME_1) ? a.loadConvivaJs2() : ((e = vodh5player.createElementByType("script", "", "absolute", "0px", "0px", "0px", "0px")).src = vodh5player.HTTP_PRE + vodh5player.DOMAIN + vodh5player.CONVIVA_URL_1,
- document.getElementsByTagName("head")[0].appendChild(e),
- e.onload = function () {
- e.id = vodh5player.CONVIVA_URL_NAME_1,
- a.loadConvivaJs2()
- }
- )
- }
- ,
- this.loadConvivaJs2 = function () {
- var e, a = this;
- null !== document.getElementById(vodh5player.CONVIVA_URL_NAME_2) ? a.loadConvivaJs3() : ((e = vodh5player.createElementByType("script", "", "absolute", "0px", "0px", "0px", "0px")).src = vodh5player.HTTP_PRE + vodh5player.DOMAIN + vodh5player.CONVIVA_URL_2,
- document.getElementsByTagName("head")[0].appendChild(e),
- e.onload = function () {
- e.id = vodh5player.CONVIVA_URL_NAME_2,
- a.loadConvivaJs3()
- }
- )
- }
- ,
- this.loadConvivaJs3 = function () {
- var e, a = this;
- null !== document.getElementById(vodh5player.CONVIVA_URL_NAME_3) ? a.loadStyle() : ((e = vodh5player.createElementByType("script", "", "absolute", "0px", "0px", "0px", "0px")).src = vodh5player.HTTP_PRE + vodh5player.DOMAIN + vodh5player.CONVIVA_URL_3,
- document.getElementsByTagName("head")[0].appendChild(e),
- e.onload = function () {
- e.id = vodh5player.CONVIVA_URL_NAME_3,
- a.loadStyle()
- }
- )
- }
- ,
- this.loadStyle = function () {
- var e, a, r;
- null !== document.getElementById("vodh5css") ? this.loadStyle2() : ((e = document.createElement("link")).type = "text/css",
- e.rel = "stylesheet",
- e.href = this.HTTP_PRE + vodh5player.DOMAIN + this.VIDEO_CSS_URL,
- a = document.getElementsByTagName("head")[0],
- r = this,
- a.appendChild(e),
- e.onload = function () {
- e.id = "vodh5css",
- r.loadStyle2()
- }
- )
- }
- ,
- this.loadStyle2 = function () {
- var e, a;
- vodh5player.trace(">>loadStyle2"),
- this.VIDEO_CSS2_URL ? null !== document.getElementById("vodh5css2") ? (vodh5player.trace(">>vodh5css2 already exist"),
- vodh5player.styleLoaded = !0,
- this.loadChecker()) : ((e = document.createElement("link")).type = "text/css",
- e.rel = "stylesheet",
- e.href = this.HTTP_PRE + vodh5player.DOMAIN + this.VIDEO_CSS2_URL,
- document.getElementsByTagName("head")[0].appendChild(e),
- a = this,
- e.onload = function () {
- vodh5player.trace(">>" + e.href + " has loaded"),
- e.id = "vodh5css2",
- vodh5player.styleLoaded = !0,
- a.loadChecker()
- }
- ) : (vodh5player.styleLoaded = !0,
- vodh5player.trace(">>no css2"),
- this.loadChecker())
- }
- ,
- this.processConfig = function (e) {
- vodh5player.uniquelabel = e.quality.uniquelabel,
- vodh5player.DEFAULT_QUALITY_LABELS = e.quality.labels,
- vodh5player.DEFAULT_QUALITIES_DIVIDE = e.quality.divide,
- vodh5player.qualitiesEnabled = e.quality.enabled,
- vodh5player.permissionLevel = e.quality.permissionLevel,
- vodh5player.qualitiesNeedPermission = e.quality.needPermission;
- for (var a = vodh5player.DEFAULT_QUALITY_LABELS.length - 1; vodh5player.qualitiesEnabled.length < a;)
- vodh5player.qualitiesEnabled.push(!0);
- for (; vodh5player.qualitiesNeedPermission.length < a;)
- vodh5player.qualitiesNeedPermission.push(vodh5player.qualitiesNeedPermission[vodh5player.qualitiesNeedPermission.length - 1]);
- console.log("custom config: -----------------------------"),
- console.log(vodh5player.uniquelabel),
- console.log(vodh5player.DEFAULT_QUALITY_LABELS),
- console.log(vodh5player.DEFAULT_QUALITIES_DIVIDE),
- console.log(vodh5player.qualitiesEnabled),
- console.log(vodh5player.permissionLevel),
- console.log(vodh5player.qualitiesNeedPermission),
- console.log("--------------------------------------------")
- }
- ,
- this.loadChecker = function () {
- vodh5player.trace("allCoreLoaded:" + this.allCoreLoaded + " workerModuleInitialized:" + vodh5player.workerModuleInitialized + " styleLoaded:" + vodh5player.styleLoaded + " workertimeout:" + vodh5player.workerStatus.workertimeout);
- var e, r = this;
- !this.allCoreLoaded && vodh5player.styleLoaded && !vodh5player.workerStatus.workertimeout && vodh5player.workerModuleInitialized && (vodh5player.trace(">> -- all core complete --"),
- this.allCoreLoaded = !0,
- vodh5player.trace("start checking preAd... hasPreAD:" + this.vodParas.hasPreAD + " PRE_AD_URL:" + this.PRE_AD_URL),
- this.vodParas.hasPreAD && this.PRE_AD_URL ? (e = this.PRE_AD_URL,
- this.vodParas.preAdsParas && (this.vodParas.preAdsParas.length = 0,
- delete this.vodParas.preAdsParas),
- vodh5player.xhrRequest({
- url: e,
- timeout: vodh5player.VJS_ADS_TIMEOUT,
- data: {},
- customPara: e,
- success: function (e, a) {
- vodh5player.trace("preAdData loaded."),
- r.parsePreAdsData(e, a)
- },
- ontimeout: function (e) {
- vodh5player.trace("preAdData load timeout."),
- r.sendAliAnalytic("/play.1.24", "code=" + vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_TIMEOUT + "&msg=error1&url=" + e.url + "&bfirstframeplayed=" + (r.firstFramePlayed_ ? "1" : "0"))
- },
- error: function (e) {
- vodh5player.trace("preAdData load error:" + e),
- r.parsePreAdsDataError()
- }
- })) : (vodh5player.trace("no preAD"),
- this.vodParas.hasPreAD = !1,
- this.requestContentVDN(this.vodParas)))
- }
- ,
- this.parsePreAdsData = function (e, a) {
- vodh5player.trace("preAdData parsing...");
- var r = this
- , t = this.vodParas;
- if (e && void 0 === t.preAdsParas) {
- try {
- var o = 0;
- Array.isArray(e) && (o = e.length),
- vodh5player.trace("preAd number:" + o),
- t.preAdsParas = [];
- for (var d = t.preAdsIndex = 0; d < o; d++) {
- if (void 0 === e[d].guid) {
- console.warn("广告数据解析错误!"),
- r.sendAliAnalytic("/play.1.24", "code=" + vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_JSON_PARSE + "&msg=error2&url=" + a + "&bfirstframeplayed=" + (r.firstFramePlayed_ ? "1" : "0")),
- t.preAdsParas.length = 0;
- break
- }
- e[d].guid && e[d].clickUrl && (t.preAdsParas[d] = {},
- t.preAdsParas[d].guid = e[d].guid,
- t.preAdsParas[d].clickUrl = e[d].clickUrl,
- t.preAdsParas[d].adStartMonitor = e[d].startcount,
- t.preAdsParas[d].adMiddleMonitor = e[d].middlecount,
- t.preAdsParas[d].adMiddleMonitorTime = parseInt(e[d].monitorTime),
- t.preAdsParas[d].adMonitor3 = e[d].eventExposure,
- t.preAdsParas[d].adMonitor4 = e[d].eventExposure1,
- t.preAdsParas[d].duration = parseInt(e[d].duration))
- }
- } catch (e) {
- console.warn("广告解析错误!"),
- r.sendAliAnalytic("/play.1.24", "code=" + vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_JSON_PARSE + "&msg=error2&url=" + a + "&bfirstframeplayed=" + (r.firstFramePlayed_ ? "1" : "0"))
- }
- var i = 0;
- if (0 === (i = t.preAdsParas.length))
- return vodh5player.trace("parsePreAdsData: there is no preAd"),
- t.preAdsParas.length = 0,
- delete t.preAdsParas,
- void this.requestContentVDN(t);
- for (var l = (new Date).getTime().toString().slice(0, 10), s = t.fingerprint_uid, n = md5(l + "2049" + vodh5player.VDN_AD_STATIC_CHECK + s).toUpperCase(), p = 0; p < i; p++) {
- var h = this.HTTP_PRE + vodh5player.VDN_AD_URL + "pid=" + t.preAdsParas[p].guid + vodh5player.VDN_PARA1
- , r = (h += "&tsp=" + l + "&vn=2049&vc=" + n + "&uid=" + s + "&wlan=",
- this.sendAliAnalytic_ad("/play.1.40", "ad_url=null&ad_v_id=" + t.preAdsParas[p].guid + "&ad_sum=" + i + "&ad_num=" + (p + 1) + "&ad_len=" + 15 * i),
- this);
- vodh5player.xhrRequest({
- url: h,
- responseType: "json",
- data: {},
- customPara: {
- adindex: p,
- url: h
- },
- success: function (e, a) {
- vodh5player.trace("preAd vdn loaded xhr" + a.adindex),
- r.parsePreAdVdnDataXHR(e, a.adindex, a.url)
- },
- ontimeout: function (e) {
- vodh5player.trace("preAd vdn load timeout."),
- r.sendAliAnalytic("/play.1.24", "code=" + vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_TIMEOUT + "&msg=error3&url=" + e.url + "&bfirstframeplayed=" + (r.firstFramePlayed_ ? "1" : "0"))
- },
- error: function (e) {
- vodh5player.trace("preAd vdn load error xhr" + e),
- r.getPreAdVdnErrorXHR()
- }
- })
- }
- r = this;
- this.preAdVdnTimeOut_ = setTimeout(function () {
- r.sendAliAnalytic("/play.1.24", "code=" + vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_TIMEOUT + "&msg=error3&bfirstframeplayed=" + (r.firstFramePlayed_ ? "1" : "0")),
- console.warn(vodh5player.DEBUG_LABEL + "preAdVdnTimeOut timeout !"),
- r.preAdVdnTimeOutState_ = !0,
- r.parseAdVdnDataTimeOut()
- }, vodh5player.AD_VDN_TIME_OUT)
- } else
- vodh5player.trace("no preAd 2"),
- t.preAdsParas.length = 0,
- delete t.preAdsParas,
- r.requestContentVDN(t);
- return i
- }
- ,
- this.parsePreAdVdnDataXHR = function (e, a, r) {
- var t = this
- , o = this.vodParas;
- if (vodh5player.trace("pre ad:" + a + " vdn data received xhr"),
- !t.preAdVdnTimeOutState_) {
- try {
- o.preAdsParas[a].url = e.hls_url
- } catch (e) {
- t.sendAliAnalytic("/play.1.24", "code=" + vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_JSON_PARSE + "&msg=error4&url=" + r + "&bfirstframeplayed=" + (t.firstFramePlayed_ ? "1" : "0"))
- }
- t.sendAliAnalytic_ad("/play.1.41", "ad_url=" + encodeURIComponent(o.preAdsParas[a].url) + "&ad_v_id=" + o.preAdsParas[a].guid + "&ad_sum=" + o.preAdsParas.length + "&ad_num=" + (a + 1) + "&ad_len=" + 15 * o.preAdsParas.length);
- for (var d = !0, i = 0; i < o.preAdsParas.length; i++)
- if (void 0 === o.preAdsParas[i].url) {
- d = !1;
- break
- }
- d && (clearTimeout(t.preAdVdnTimeOut_),
- t.requestContentVDN(o))
- }
- }
- ,
- this.parseAdVdnDataTimeOut = function () {
- for (var e = this.vodParas.preAdsParas.length - 1; 0 <= e; e--)
- void 0 === this.vodParas.preAdsParas[e].url && console.warn(vodh5player.DEBUG_LABEL + "pre as i:" + e + "timeout !");
- this.preparePreAd()
- }
- ,
- this.preparePreAd = function () {
- for (var e = this.vodParas.preAdsParas.length - 1; 0 <= e; e--)
- void 0 === this.vodParas.preAdsParas[e].url && this.vodParas.preAdsParas.splice(e, 1);
- this.requestContentVDN(this.vodParas)
- }
- ,
- this.parsePostAdsData = function (e) {
- vodh5player.trace("parsePostAdsData" + e);
- var a = this.vodParas;
- if (e && void 0 === a.postAdsParas) {
- var r = 0;
- Array.isArray(e) && (r = e.length),
- a.postAdsParas = [];
- for (var t = 0; t < r; t++) {
- if (void 0 === e[t].guid) {
- console.warn("广告数据解析错误!"),
- p.sendAliAnalytic("/play.1.24", "code=" + vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_JSON_PARSE + "&msg=error2&url=" + url + "&bfirstframeplayed=" + (p.firstFramePlayed_ ? "1" : "0")),
- a.postAdsParas.length = 0;
- break
- }
- e[t].guid && e[t].clickUrl && (a.postAdsParas[t] = {},
- a.postAdsParas[t].guid = e[t].guid,
- a.postAdsParas[t].clickUrl = e[t].clickUrl,
- a.postAdsParas[t].adStartMonitor = e[t].startcount,
- a.postAdsParas[t].adMiddleMonitor = e[t].middlecount,
- a.postAdsParas[t].adMiddleMonitorTime = parseInt(e[t].monitorTime),
- a.postAdsParas[t].adMonitor3 = e[t].eventExposure,
- a.postAdsParas[t].adMonitor4 = e[t].eventExposure1,
- a.postAdsParas[t].duration = parseInt(e[t].duration))
- }
- vodh5player.trace("post ad number:" + a.postAdsParas.length);
- var o = 0;
- if (0 === (o = a.postAdsParas.length))
- return vodh5player.trace("there s no postAd ~1"),
- a.postAdsParas.length = 0,
- delete a.postAdsParas,
- void this.vjsplayer.trigger("nopostroll");
- for (var d = (new Date).getTime().toString().slice(0, 10), i = a.fingerprint_uid, l = md5(d + "2049" + vodh5player.VDN_AD_STATIC_CHECK + i).toUpperCase(), s = 0; s < o; s++) {
- var n = this.HTTP_PRE + vodh5player.VDN_AD_URL + "pid=" + a.postAdsParas[s].guid + vodh5player.VDN_PARA1
- , p = (n += "&tsp=" + d + "&vn=2049&vc=" + l + "&uid=" + i + "&wlan=",
- this.sendAliAnalytic_ad("/play.1.40", "ad_url=null&ad_v_id=" + a.postAdsParas[s].guid + "&ad_sum=" + o + "&ad_num=" + (s + 1) + "&ad_len=" + 15 * o),
- this);
- vodh5player.xhrRequest({
- url: n,
- responseType: "json",
- data: {},
- customPara: s,
- success: function (e, a) {
- vodh5player.trace("post ad vdn loaded xhr" + a),
- p.parsePostAdVdnDataXHR(e, a)
- },
- error: function (e) {
- vodh5player.trace("post ad load error xhr" + e),
- p.getPostAdVdnErrorXHR()
- }
- })
- }
- p = this;
- this.postAdVdnTimeOut_ = setTimeout(function () {
- console.warn(vodh5player.DEBUG_LABEL + "postAdVdnTimeOut timeout !"),
- p.postAdVdnTimeOutState_ = !0,
- p.vjsplayer.trigger("nopostroll")
- }, vodh5player.AD_VDN_TIME_OUT)
- } else
- this.debug && window.console.warn(vodh5player.DEBUG_LABEL + "postAd data error"),
- a.postAdsParas.length = 0,
- delete a.postAdsParas;
- return o
- }
- ,
- this.parsePostAdVdnData = function (data) {
- var this_ = data.this
- , adIndex = data.adIndex
- , vodParas = this_.vodParas;
- if (vodh5player.trace("parsePostAdVdnData index:" + adIndex),
- !this_.postAdVdnTimeOutState_) {
- for (var obj = eval("(" + vodAdCallsData + ")"), allAdURLLoaded = (vodParas.postAdsParas[adIndex].url = obj.hls_url,
- this_.sendAliAnalytic_ad("/play.1.41", "ad_url=" + encodeURIComponent(vodParas.postAdsParas[adIndex].url) + "&ad_v_id=" + vodParas.postAdsParas[adIndex].guid + "&ad_sum=" + vodParas.postAdsParas.length + "&ad_num=" + (adIndex + 1) + "&ad_len=" + 15 * vodParas.postAdsParas.length),
- !0), i = 0; i < vodParas.postAdsParas.length; i++)
- if (void 0 === vodParas.postAdsParas[i].url) {
- allAdURLLoaded = !1;
- break
- }
- allAdURLLoaded && (clearTimeout(this_.postAdVdnTimeOut_),
- vodh5player.trace("all post ad url loaded"),
- this_.startPostAD())
- }
- }
- ,
- this.parsePostAdVdnDataXHR = function (e, a) {
- var r = this
- , t = r.vodParas;
- if (vodh5player.trace("parsePostAdVdnData index:" + a),
- !r.postAdVdnTimeOutState_) {
- t.postAdsParas[a].url = e.hls_url,
- r.sendAliAnalytic_ad("/play.1.41", "ad_url=" + encodeURIComponent(t.postAdsParas[a].url) + "&ad_v_id=" + t.postAdsParas[a].guid + "&ad_sum=" + t.postAdsParas.length + "&ad_num=" + (a + 1) + "&ad_len=" + 15 * t.postAdsParas.length);
- for (var o = !0, d = 0; d < t.postAdsParas.length; d++)
- if (void 0 === t.postAdsParas[d].url) {
- o = !1;
- break
- }
- o && (clearTimeout(r.postAdVdnTimeOut_),
- vodh5player.trace("all post ad url loaded"),
- r.startPostAD())
- }
- }
- ,
- this.requestContentVDN = function (r) {
- var e = this.HTTP_PRE + vodh5player.VDN_URL + "pid=" + r.videoId + vodh5player.VDN_PARA1
- , a = (new Date).getTime().toString().slice(0, 10)
- , t = "2049"
- , o = ""
- , d = r.fingerprint_uid
- , i = (void 0 !== r.vdn && void 0 !== r.vdn.vn && (t = r.vdn.vn),
- void 0 !== r.vdn && void 0 !== r.vdn.vtoken && "" !== r.vdn.vtoken && (o = r.vdn.vtoken),
- md5(a + t + vodh5player.VDN_AD_STATIC_CHECK + d).toUpperCase())
- , l = (e += "&tsp=" + a + "&vn=" + t + "&vc=" + i + "&uid=" + d + "&wlan=",
- "" !== o && (e += "&vtokenpos=1"),
- void 0 !== r.vdn && void 0 !== r.vdn.pcv && (e += "&pcv=" + r.vdn.pcv),
- this);
- vodh5player.xhrRequest({
- url: e,
- vtoken: o,
- method: "GET",
- responseType: "text",
- data: {},
- customPara: e,
- success: function (e, a) {
- l.parseVodDataFromVdnXhr(r, e, a)
- },
- ontimeout: function (e) {
- vodh5player.trace("content vdn timeout."),
- l.sendAliAnalytic("/play.1.4", "code=" + vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_TIMEOUT + "&msg=error5&url=" + e.url + "&bfirstframeplayed=" + (l.firstFramePlayed_ ? "1" : "0"))
- },
- error: function (e) {
- vodh5player.trace("content vdn load error" + e),
- l.parseVodDataFromVdnXhrError(r)
- }
- })
- }
- ,
- this.parseVodDataFromVdnXhr = function (y, e, a) {
- vodh5player.trace("parsing content vdn data ...");
- try {
- var u = JSON.parse(e)
- } catch (e) {
- return window.console.warn(vodh5player.DEBUG_LABEL + "content vdn data parse error!"),
- this_.sendAliAnalytic("/play.1.4", "code=" + vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_JSON_PARSE + "&msg=error6&url=" + a + "&bfirstframeplayed=" + (this_.firstFramePlayed_ ? "1" : "0")),
- void this.parseVodDataFromVdnXhrError(y)
- }
- try {
- var r;
- if ("no" === u.ack)
- return this.container_ = document.getElementById(y.divId),
- this.container_.className = "vdn-novideo-error pic_box",
- r = "版权原因 无法播放",
- "002" === u.status || "003" === u.status ? r = "暂不支持播放该视频内容" : "004" === u.status ? r = "该视频不存在" : "006" === u.status ? r = "收费视频未定价" : "007" === u.status && (r = "收费视频无观看权限"),
- this.container_.innerHTML = "<div style='height:50px; top:45%; position: relative;'>" + r + "</div>",
- void this_.sendAliAnalytic("/play.1.24", "code=" + vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_COPYRIGHT + "&msg=error7&url=" + a + "&bfirstframeplayed=" + (this_.firstFramePlayed_ ? "1" : "0"));
- if ("yes" === u.ack && "0" === u.public)
- return this.container_ = document.getElementById(y.divId),
- this.container_.className = "vdn-novideo-error pic_box",
- this.container_.innerHTML = "<div style='height:50px; top:45%; position: relative;'>您所在的地区,暂不支持播放该视频</div>",
- void this_.sendAliAnalytic("/play.1.24", "code=" + vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_COPYRIGHT + "&msg=error7&url=" + a + "&bfirstframeplayed=" + (this_.firstFramePlayed_ ? "1" : "0"));
- if (!0 === vodh5player.DRM && !1 === vodh5player.TMP_DRM_CLOSE) {
- if ("" === u.manifest.hls_h5e_url || void 0 === u.manifest.hls_h5e_url)
- return window.console.warn(vodh5player.DEBUG_LABEL + "content vdn hls_enc_url parse error!"),
- void this.parseVodDataFromVdnXhrError(y)
- } else if ("" === u.hls_url || void 0 === u.hls_url)
- return window.console.warn(vodh5player.DEBUG_LABEL + "content vdn hls_url parse error!"),
- void this.parseVodDataFromVdnXhrError(y);
- this.analyticObj.cdnCode = u.hls_cdn_info.cdn_code,
- this.analyticObj.lc_ip = u.lc.ip,
- this.analyticObj.lc_coun = u.lc.country_code,
- this.analyticObj.lc_prov = u.lc.provice_code,
- this.analyticObj.lc_city = u.lc.city_code,
- this.analyticObj.lc_isp = u.lc.isp_code,
- this.analyticObj.client_sid = u.client_sid,
- this.analyticObj.column = u.column,
- this.analyticObj.channel = u.play_channel,
- this.analyticObj.assetName = y.videoId + u.title,
- this.analyticObj.public = u.public;
- var t, _ = vodh5player.DRM ? u.manifest.hls_h5e_url : u.hls_url;
- if (void 0 === _ && (_ = u.hls_url),
- this.analyticObj.streamUrl = _,
- y.isHttps && "http:" === _.substr(0, 5) && (_ = "https:" + _.substr(5),
- vodh5player.trace("https transition:" + _)),
- void 0 !== u.video.totalLength && u.video.totalLength <= 60 && (vodh5player.trace("video duration is less than 60 seconds"),
- y.hasBannerAD = !1,
- y.hasPauseAD = !1,
- y.hasPreAD = !1,
- y.hasPostAD = !1),
- y.ui_cuePoint && (y.cuePoints = u.segments),
- vodh5player.enableVip ? vodh5player.trace("vdn vdnDefaultStream:" + y.vdnDefaultStream + (vodh5player.enableVip ? " (custom config no longer use)" : "")) : "chapters" === u.default_stream ? y.vdnDefaultStream = vodh5player.DEFAULT_QUALITY_LABELS[1] : "chapters2" === u.default_stream ? y.vdnDefaultStream = vodh5player.DEFAULT_QUALITY_LABELS[2] : "chapters3" === u.default_stream ? y.vdnDefaultStream = vodh5player.DEFAULT_QUALITY_LABELS[3] : "chapters4" === u.default_stream ? y.vdnDefaultStream = vodh5player.DEFAULT_QUALITY_LABELS[4] : "chapters5" === u.default_stream ? y.vdnDefaultStream = vodh5player.DEFAULT_QUALITY_LABELS[5] : "chapters6" === u.default_stream ? y.vdnDefaultStream = vodh5player.DEFAULT_QUALITY_LABELS[6] : "chapters7" === u.default_stream ? y.vdnDefaultStream = vodh5player.DEFAULT_QUALITY_LABELS[7] : y.vdnDefaultStream = vodh5player.DEFAULT_QUALITY_LABELS[3],
- vodh5player.cdnHostName = vodh5player.getHostName(_),
- void 0 !== y.posterImg && "" !== y.posterImg || u.video.chapters3 && u.video.chapters3[0] && (y.posterImg = t = u.video.chapters3[0].image),
- void 0 !== y.posterImg && "" !== y.posterImg || void 0 !== t || u.video.chapters4 && u.video.chapters4[0] && (y.posterImg = t = u.video.chapters4[0].image),
- vodh5player.enableVip)
- return vodh5player.trace("load master m3u8 file"),
- void vodh5player.xhrRequest({
- url: _,
- responseType: "text",
- timeout: 6e3,
- data: {},
- success: function (e, a, r) {
- console.log("getAllResponseHeaders:"),
- console.log(r);
- r = new videojs.M3u8Parser;
- if (r.push(e),
- r.end(),
- r.manifest.playlists) {
- var t, o = r.manifest.playlists;
- if (o.map(function (e) {
- e.url = vodh5player.cdnHostName + e.uri,
- e.masterIndex = o.indexOf(e);
- for (var a = 0; a < vodh5player.DEFAULT_QUALITIES_DIVIDE.length; a++)
- e.attributes.BANDWIDTH < vodh5player.DEFAULT_QUALITIES_DIVIDE[0] ? (e.enabled = !1,
- e.label = "LOW") : e.attributes.BANDWIDTH > vodh5player.DEFAULT_QUALITIES_DIVIDE[vodh5player.DEFAULT_QUALITIES_DIVIDE.length - 1] ? (e.enabled = !1,
- e.label = "HI") : e.attributes.BANDWIDTH > vodh5player.DEFAULT_QUALITIES_DIVIDE[a] && e.attributes.BANDWIDTH <= vodh5player.DEFAULT_QUALITIES_DIVIDE[a + 1] && (e.enabled = !0,
- e.label = vodh5player.DEFAULT_QUALITY_LABELS[a],
- e.permition = vodh5player.qualitiesNeedPermission[a],
- vodh5player.qualitiesEnabled[a] || (e.enabled = !1))
- }),
- vodh5player.uniquelabel)
- for (var d = o.length, i = 0; i < d; i++)
- for (var l = 0; l < d; l++)
- i !== l && o[i].label === o[l].label && o[i].enabled && o[l].enabled && o[i].attributes.BANDWIDTH > o[l].attributes.BANDWIDTH && (o[l].enabled = !1);
- vodh5player.trace("DEV>> "),
- console.table(o),
- console.log(o);
- for (var s, n = !0, i = o.length - 1; 0 <= i; i--)
- if (0 === o[i].permition && o[i].enabled) {
- n = !1,
- s = o[i].label;
- break
- }
- for (var p, h, l = 0; l < o.length; l++)
- if (1 === o[l].permition && o[l].enabled) {
- p = o[l].label,
- console.log("lowest1Label:" + p);
- break
- }
- for (l = o.length - 1; -0 < l; l--)
- if (1 === o[l].permition && o[l].enabled) {
- h = o[l].label,
- console.log("highest1Label:" + h);
- break
- }
- if (0 === vodh5player.userLevel) {
- if (n)
- return vodh5player.trace("无免费码率,请登录观看"),
- void this_.noFreeQualityError("无免费码率,请登录观看");
- t = s
- } else
- 0 < vodh5player.userLevel && (h ? t = h : s ? t = s : vodh5player.trace("无有效码率", !0));
- vodh5player.trace("targetQualityLabel:" + t);
- var e = videojs.storePub.get("h5vodlocaldata")
- , c = void 0 !== e && void 0 !== e.lastQuality ? e.lastQuality : "";
- if (c) {
- for (var v = !1, i = o.length - 1; 0 <= i; i--)
- o[i].enabled && o[i].label === c && o[i].permition <= vodh5player.userLevel && (t = c,
- v = !0,
- vodh5player.trace("user saved QualityLabel:" + t));
- v || vodh5player.trace("user saved QualityLabel can not use.")
- }
- for (i = o.length - 1; 0 <= i; i--)
- o[i].permition <= vodh5player.userLevel && (o[i].permition = 0);
- "1" === u.public && "001" === u.status && (this_.vjsplayer = this_.createVJS(y.divId, _, y.posterImg, y.language, o, t),
- this_.vjsplayer.shellstructure = this_,
- vodh5player.playerList.push(this_.vjsplayer))
- } else
- vodh5player.trace("m3u8 has problom!", !0)
- },
- error: function (e) {
- vodh5player.trace("videoUrl load error" + e)
- }
- });
- "1" === u.public && "001" === u.status && (this.vjsplayer = this.createVJS(y.divId, _, y.posterImg, y.language),
- this.vjsplayer.shellstructure = this,
- vodh5player.playerList.push(this.vjsplayer))
- } catch (e) {
- this_.sendAliAnalytic("/play.1.4", "code=" + vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_JSON_PARSE + "&msg=error6&url=" + a + "&bfirstframeplayed=" + (this_.firstFramePlayed_ ? "1" : "0"))
- }
- }
- ,
- this.noFreeQualityError = function (e) {
- this.container_ = document.getElementById(this.vodParas.divId),
- this.container_.className += " vdn-novideo-error pic_box",
- this.container_.innerHTML = "<div id='constructErrorpanel' style='height:50px; top:45%; position: relative;'> " + e + "</div>",
- this.container_.innerHTML = this.container_.innerHTML + "<div style='height:50px; top:45%; position: relative;'> <button onClick='nobrPlay()'>登录</button></div>",
- this_.sendAliAnalytic("/play.1.24", "code=" + vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_TIMEOUT + "&msg=" + e + "&url=&bfirstframeplayed=" + (this_.firstFramePlayed_ ? "1" : "0"))
- }
- ,
- this.trycall = function (e) {
- try {
- e()
- } catch (e) {
- vodh5player.trace(e)
- }
- }
- ,
- this.workerTimeroutError = function (e) {
- console.warn(vodh5player.DEBUG_LABEL + "workerTimeroutError " + this.id),
- this.container_ = document.getElementById(this.vodParas.divId),
- this.container_.className += " vdn-novideo-error pic_box",
- this.container_.innerHTML = "<div style='height:50px; top:45%; position: relative;'>播放器加载超时 " + vodh5player.ERROR_CODE[0] + "</div>",
- this_.sendAliAnalytic("/play.1.24", "code=" + vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_TIMEOUT + "&msg=workertimeout&url=&bfirstframeplayed=" + (this_.firstFramePlayed_ ? "1" : "0"))
- }
- ,
- this.parseVodDataFromVdnXhrError = function (e) {
- void 0 !== e ? (console.warn(vodh5player.DEBUG_LABEL + "404 parseVodDataFromVdnXhrError " + e.divId),
- this.container_ = document.getElementById(e.divId),
- this.container_.className = "vdn-novideo-error pic_box",
- this.container_.innerHTML = "<div style='height:50px; top:45%; position: relative;'>网络开小差了,请稍后再试</div>") : console.warn(vodh5player.DEBUG_LABEL + "404 parseVodDataFromVdnXhrError ")
- }
- ,
- this.createVJS = function (e, a, r, t, o, d) {
- var i = this.vodParas
- , l = !1
- , s = !1
- , n = !1
- , p = !1
- , h = (vodh5player.trace("create vjs ..."),
- void 0 !== t && "" !== t && " " !== t || (t = "zh-CN"),
- this.container_ = document.getElementById(e),
- document.createElement("source"))
- , a = (void 0 !== i.videoSrc ? (h.src = i.videoSrc,
- window.console.warn("test url:" + i.videoSrc)) : h.src = a,
- h.type = "application/x-mpegURL",
- document.createElement("video"))
- , e = (a.setAttribute("id", e + "_player"),
- a.setAttribute("class", "video-js"),
- a.appendChild(h),
- a.style.position = "absolute",
- a.style.width = "100%",
- a.style.height = "100%",
- a.style.left = "0px",
- a.style.top = "0px",
- this.container_.appendChild(a),
- videojs.storePub.get("h5vodlocaldata"))
- , h = -1
- , c = 1 === i.PLAYER_TYPE_INDEX ? (vodh5player.enableQualityLock = !0,
- [6, 5, 4, 3, 2, 1, 7]) : (vodh5player.enableQualityLock = !0,
- [3, 4, 2, 5, 1])
- , v = (void 0 !== e && void 0 !== e.lastQuality ? (v = e.lastQuality,
- h = vodh5player.DEFAULT_QUALITY_LABELS.indexOf(v)) : v = "",
- vodh5player.trace(" savedQuality:" + v + " savedQualityIndex:" + h),
- -1 !== (e = vodh5player.DEFAULT_QUALITY_LABELS.indexOf(i.vdnDefaultStream)) && -1 !== c.indexOf(e) && (c.splice(c.indexOf(e), 1),
- c.unshift(e)),
- -1 !== h && -1 !== c.indexOf(h) && (c.splice(c.indexOf(h), 1),
- c.unshift(h)),
- vodh5player.trace("defaultQuality:" + c + (vodh5player.enableVip ? " (custom config will not be use this array!)" : "")),
- vodh5player.enableQualityLock || (c.length = 0,
- c = null,
- vodh5player.trace("enableQualityLock:false")),
- {
- wrapperVersion: vodh5player.DEV ? "dev " + wrapperversion : wrapperversion,
- wrapperupdate: wrapperupdate,
- enableVip: vodh5player.enableVip,
- skipAdTip: vodh5player.skipAdTip,
- qualityPermitMode: vodh5player.enableVip,
- customQualityList: o,
- customDefaultQuality: d,
- enableQualityLock: vodh5player.enableQualityLock,
- config: this.config,
- logicIndex: this.PLAYER_TYPE_INDEX,
- drmLabel: vodh5player.DRM,
- debug: this.debug,
- debugInfo: vodh5player.debugInfo,
- paras: i,
- poster: r,
- vdnDefaultStream: i.vdnDefaultStream,
- controls: !0,
- setup_loop: !1,
- setup_autoNext: !0,
- autoplay: i.autoplay,
- cuePoints: i.cuePoints,
- preload: "auto",
- language: t,
- playbackRates: [.5, 1, 1.25, 1.5, 2],
- breakpoints: {},
- responsive: !0,
- userActions: {
- hotkeys: {
- muteKey: function (e) {
- return 77 === e.which
- },
- fullscreenKey: function (e) {
- return 70 === e.which
- },
- playPauseKey: function (e) {
- return 80 === e.which || 32 === e.which
- }
- }
- },
- nextImageUrl: "" + i.ui_nextImageUrl,
- nextTitle: "" + i.ui_nextTitle,
- controlBar: {
- nextPanel: i.listMode,
- currentTimeDisplay: !0,
- remainingTimeDisplay: !1,
- seekToLive: !1,
- customControlSpacer: !0,
- audioModeButton: !1,
- playbackQualityMenuButton: i.ui_quality,
- playbackQualityLabels: i.playbackQualityLabels,
- playbackRateMenuButton: i.ui_rate,
- chooseVideoButton: !0 === i.chooseVideo,
- descriptionsButton: !1,
- subsCapsButton: !1,
- audioTrackButton: !1,
- setupMenuButton: i.ui_setup,
- fullscreenToggle: i.ui_fullScreen,
- webfullscreenToggle: i.ui_webFullScreen,
- volumePanel: {
- inline: !1
- }
- },
- videoSnapUrl: vodh5player.VIDEO_SNAP_URL,
- barrageVod: "video" === i.barrageType,
- barrageConfigUrl: vodh5player.BARRAGE_CONFIG_URL,
- barrageContentUrl: "video" === i.barrageType ? "common.newcomment.cntv.cn/data/pandabarrage?" : "common.newcomment.cntv.cn/comment/list?",
- hasBarrage: i._hasBarrage,
- barrageApp: i.barrageApp,
- barrageItemId: i.barrageItemId,
- chooseVideoPanel: !0 === i.chooseVideo,
- chooseVideoData: vodh5player.chooseVideoData,
- textTrackSettings: !1,
- html5: {
- nativeCaptions: !1,
- nativeAudioTracks: !1,
- nativeVideoTracks: !1,
- hls: {
- debug: !1,
- overrideNative: !0
- }
- },
- isHttps: i.isHttps,
- pauseAd: i.hasPauseAD,
- pauseAdUrl: this.PAUSE_AD_URL,
- bannerAd: i.hasBannerAD,
- bannerAdUrl: this.BANNER_AD_URL
- })
- , y = (vodh5player.enableVip ? vodh5player.trace("custom config no longer use Lock quality:defaultQualityArr") : v.html5.hls.selectedIndex = c,
- this)
- , u = videojs(a.getAttribute("id"), v, function () {
- if (y.debug && window.console.log(vodh5player.DEBUG_LABEL + "player s ready, core version:" + videojs.VERSION + "-" + videojs.UPDATE_DATE + "-" + videojs.PLAYER_VERSION),
- y.analyticObj.playerversion = vodh5player.VERSION + "-" + wrapperversion,
- vodh5player.convivaOn && !this.convivaIntegration) {
- vodh5player.trace("conviva init");
- var e = {};
- e.ASSET_NAME = i.videoId,
- e.VIEWER_ID = i.fingerprint_uid,
- e.PLAYER_NAME = vodh5player.PLAYER_NAME,
- e.APP_VERSION = vodh5player.VERSION,
- e.PLAY_SCENE = vodh5player.PLAY_SCENE,
- e.APP_NAME = vodh5player.APP_NAME,
- e.P2P = vodh5player.P2P,
- e.cdnCode = y.analyticObj.cdnCode,
- e.lc_coun = y.analyticObj.lc_coun,
- e.lc_prov = y.analyticObj.lc_prov,
- e.lc_city = y.analyticObj.lc_city,
- e.lc_isp = y.analyticObj.lc_isp,
- e.wrapperversion = vodh5player.DEV ? "dev " + wrapperversion : wrapperversion;
- try {
- this.convivaIntegration = new ConvivaIma3IntegrationVod(this, e)
- } catch (e) {
- console.warn("conviva Error:" + e.message)
- }
- }
- y.analyticObj.createTime = Math.round((new Date).getTime() / 1e3),
- y.sendAliAnalytic("/play.1.3"),
- i.hasPreAD ? vodh5player.trace("safari pread 跳过续播逻辑") : void 0 !== i.startTime && "" !== i.startTime && null !== i.startTime && " " !== i.startTime ? (vodh5player.delayStartTime_ = i.startTime,
- vodh5player.trace("video start at:" + i.startTime + "s")) : (e = u.getSavedPosition(i.videoId),
- vodh5player.delayStartTime_ = e,
- vodh5player.trace("video start at savedPosition: " + e),
- e < 30 && (vodh5player.isStartTimeHasSet_ = !0),
- vodh5player.trace("vodh5player.isStartTimeHasSet_" + vodh5player.isStartTimeHasSet_)),
- u.on("timeupdate", function () {
- y.currentTimeSec_ !== Math.round(u.currentTime()) && (y.currentTimeSec_ = Math.round(u.currentTime()),
- u.saveVideoPosition(i.videoId)),
- vodh5player.isSafari && !u.ads.isInAdMode() && .1 < u.currentTime() && !y.isSafariPreAdHasShowed_ && (vodh5player.trace(" safari 开始广告"),
- y.isSafariPreAdHasShowed_ = !0,
- y.readyForPreroll(u)),
- !vodh5player.isStartTimeHasSet_ && !u.ads.isInAdMode() && 0 < vodh5player.delayStartTime_ && (u.currentTime(vodh5player.delayStartTime_),
- vodh5player.isStartTimeHasSet_ = !0)
- }),
- u.on("adtimeupdate", function () {
- var e, a;
- void 0 !== i.preAdsParas && 0 <= i.preAdsParas.length && (e = i.preAdsParas[i.preAdsIndex].adMiddleMonitor,
- a = i.preAdsParas[i.preAdsIndex].adMiddleMonitorTime,
- void 0 !== e && void 0 !== a && "" !== e && null !== e && Math.round(u.currentTime()) === a && (i.preAdsParas[i.preAdsIndex].adMiddleMonitor = "",
- vodh5player.xhrRequest({
- url: e,
- data: {}
- })))
- }),
- u.on("readyforpreroll", function () {
- s = !0,
- vodh5player.trace("ADS readyforpreroll _ifPrerollReady:" + s),
- p ? console.warn(vodh5player.DEBUG_LABEL + "ADS PREROLL TIMEOUT !") : (l && (l = s = null,
- vodh5player.isSafari || y.readyForPreroll(u)),
- vodh5player.isSafari && u.trigger("nopreroll"))
- }),
- u.on("readyforpostroll", function () {
- vodh5player.trace("<player>e: readyforpostroll"),
- y.readyForPostroll(u)
- }),
- u.on("adsready", function () {
- vodh5player.trace("<player>e: adsready")
- }),
- u.on("adstart", function () {
- vodh5player.trace("<player>e: adstart")
- }),
- u.on("adend", function () {
- vodh5player.trace("<player>e: adend")
- }),
- u.on("adskip", function () {
- vodh5player.trace("<player>e: adskip")
- }),
- u.on("adtimeout", function () {
- vodh5player.trace("<player>e: adtimeout"),
- p = !0
- }),
- u.on("firstplay", function () {
- vodh5player.trace("<player>e: firstplay")
- }),
- u.on("nextvideo", function () {
- vodh5player.trace("<player>e: NextVideo");
- try {
- NextVideo()
- } catch (e) {
- console.warn(vodh5player.DEBUG_LABEL + " disappearance function NextVideo")
- }
- }),
- u.on("vipstatus", function () {
- vodh5player.trace("<player>e: vipstatus");
- try {
- vipstatus()
- } catch (e) {
- console.warn(vodh5player.DEBUG_LABEL + " disappearance function vipstatus")
- }
- }),
- u.on("loginstatus", function () {
- vodh5player.trace("<player>e: loginstatus");
- try {
- loginstatus()
- } catch (e) {
- console.warn(vodh5player.DEBUG_LABEL + " disappearance function loginstatus")
- }
- }),
- u.on("CDN_MEDIA_INFO", function (e) {
- e.cdnMediaInfo.cdncip && (y.analyticObj.cdncip = e.cdnMediaInfo.cdncip),
- e.cdnMediaInfo.cdnsip && (y.analyticObj.cdnsip = e.cdnMediaInfo.cdnsip),
- y.analyticObj.cdncip && !e.cdnMediaInfo.cdncip && vodh5player.trace("cdncip turn invalid!", !0),
- y.analyticObj.cdnsip && !e.cdnMediaInfo.cdnsip && vodh5player.trace("cdnsip turn invalid!", !0)
- }),
- u.on("enterFullWindow", function () {
- vodh5player.trace("<player>e: enterFullWindow"),
- "function" == typeof changeWindowToWebFullSceen && changeWindowToWebFullSceen(this.id())
- }),
- u.on("exitFullWindow", function () {
- vodh5player.trace("<player>e: exitFullWindow"),
- "function" == typeof changeWindowToNormalSceen && changeWindowToNormalSceen(this.id())
- }),
- u.on("changeHLSP2P", function (e) {
- vodh5player.trace("changeHLSP2P:" + y.vodParas.videoId),
- vodh5player.P2P ? vodh5player.hlsp2pLoaded && (e = vodh5player.cdnHostName + e.level.id.substr(2),
- vodh5player.trace(" HLSP2P start,p2purl:" + e),
- "undefined" != typeof HLSP2P && HLSP2P.isSupported() && (void 0 !== window.vjsp2p && (window.vjsp2p.destroy(),
- window.vjsp2p = null),
- window.vjsp2p = HLSP2P.createCommon({
- videoId: u.el().getElementsByTagName("video")[0].id,
- url: e
- }),
- window.vjsp2p.on(HLSP2P.Events.Rollback, function () {
- window.vjsp2p.destroy()
- }))) : vodh5player.trace("cancel p2p")
- }),
- u.on("changeAudioMode", function (e) {
- switch (e.audioMode) {
- case 0:
- void 0 !== y.liveAudio && y.liveAudio.dislinkerDest();
- break;
- case 1:
- void 0 !== y.liveAudio && y.liveAudio.connectDestHeadset();
- break;
- case 2:
- void 0 !== y.liveAudio && y.liveAudio.connectDestLoudspeaker()
- }
- }),
- i.preAdsParas && 0 < i.preAdsParas.length ? (u.addClass("ads"),
- u.trigger("adsready")) : (i.hasPreAD = !1,
- vodh5player.trace("ADS nopreroll 1"),
- y.analyticObj.ready4play1_1 = !0,
- u.trigger("nopreroll")),
- y.container_.dispatchEvent(new Event("vodplayerready"))
- })
- , _ = (u.ready(function () {
- n && (vodh5player.trace("trigger loadstart again"),
- u.trigger("loadstart"),
- n = !1)
- }),
- u.addClass("whs"),
- u.on("loadstart", function () {
- vodh5player.trace("<player>e: loadstart")
- }),
- u.on("error", function () {
- vodh5player.trace("vjs error,code:" + u.error_.code + ",msg:" + u.error_.message),
- y.sendAliAnalytic("/play.1.4", "msg=" + u.error_.message + "&bfirstframeplayed=" + (y.firstFramePlayed_ ? "1" : "0"))
- }),
- u.on("ended", function () {
- vodh5player.trace("<player>e: ended"),
- u.isInPictureInPicture() && u.exitPictureInPicture(),
- y.contentEnded()
- }),
- u.on("loadedmetadata", function () {
- !1 === l && (l = !0),
- vodh5player.trace("<player>e: loadedmetadata"),
- p ? console.warn(vodh5player.DEBUG_LABEL + "ADS PREROLL TIMEOUT !") : s && (y.readyForPreroll(u),
- l = s = null)
- }),
- u.on("loadeddata", function () {
- vodh5player.trace("<player>e: loadeddata"),
- (void 0 === y.vodParas.preAdsParas || y.vodParas.preAdsParas.length <= 0) && y.sendAliAnalytic("/play.1.6")
- }),
- u.on("play", function () {
- if (vodh5player.trace("<player>e: play"),
- 1 < vodh5player.playerList.length)
- for (var e = vodh5player.playerList.length, a = 0; a < e; a++)
- vodh5player.playerList[a] !== this && vodh5player.playerList[a].shellstructure.group === this.shellstructure.group && vodh5player.playerList[a].pause();
- for (var r = document.querySelectorAll("audio"), t = 0; t < r.length; t++)
- r[t].pause()
- }),
- u.on("pause", function () {
- vodh5player.trace("<player>e: pause"),
- y.sendAliAnalytic("/play.1.7")
- }),
- u.on("analyticALI.play.1.13", function () {
- y.sendAliAnalytic("/play.1.13")
- }),
- u.on("analyticALI.play.1.14", function () {
- y.sendAliAnalytic("/play.1.14")
- }),
- u.on("analyticALI.play.1.17", function () {
- y.sendAliAnalytic("/play.1.17")
- }),
- u.on("sourceset", function (e) {
- vodh5player.trace("<player>e: sourceset")
- }),
- u.on("waiting", function (e) {
- vodh5player.trace("<player>e: waiting"),
- y.sendAliAnalytic("/play.1.18"),
- void 0 !== y.analyticObj && (y.analyticObj.freezed = !0)
- }),
- u.on("playing", function (e) {
- vodh5player.trace("<player>e: playing"),
- y.analyticObj.ready4play1_1 && !y.analyticObj.firstplay && (y.firstFramePlayed_ = !0,
- y.analyticObj.ready4play1_1 = !1,
- y.analyticObj.firstplay = !0,
- y.analyticObj.cumulativeTime = 0,
- y.analyticObj.cumulativeTimeTimer = setInterval(y.cumulativeTimeStep, 1e3, y),
- y.analyticObj.heartbeat = setInterval(y.aliHeartbeat, 1e3 * vodh5player.ALI_HEARTBEAT, y),
- y.sendAliAnalytic("/play.1.1"))
- }),
- u.on("canplay", function (e) {
- vodh5player.trace("<player>e: canplay")
- }),
- u.on("canplaythrough", function (e) {
- vodh5player.trace("<player>e: canplaythrough"),
- void 0 !== y.analyticObj && !0 === y.analyticObj.freezed && (y.sendAliAnalytic("/play.1.19"),
- y.analyticObj.freezed = !1)
- }),
- u.on("seeking", function (e) {
- vodh5player.trace("<player>e: seeking"),
- 0 !== u.currentTime() && y.sendAliAnalytic("/play.1.15")
- }),
- u.on("durationchange", function (e) {
- vodh5player.trace("<player>e: durationchange" + u.duration()),
- vodh5player.trace("<player>e: currentTime" + u.currentTime())
- }),
- u.on("fullscreenchange", function (e) {
- vodh5player.trace("<player>e: fullscreenchange"),
- u.isFullscreen() ? y.sendAliAnalytic("/play.1.8") : y.sendAliAnalytic("/play.1.9")
- }),
- u.on("enterpictureinpicture", function (e) {
- vodh5player.trace("<player>e: enterpictureinpicture")
- }),
- u.on("leavepictureinpicture", function (e) {
- vodh5player.trace("<player>e: leavepictureinpicture")
- }),
- u.on("ratechange", function (e) {
- vodh5player.trace("<player>e: ratechange")
- }),
- u.on("qualitychange", function (e) {
- vodh5player.trace("<player>e: qualitychange")
- }),
- !0);
- return u.on("volumechange", function (e) {
- var a;
- _ && (y.sendAliAnalytic("/play.1.16"),
- _ = !1,
- a = setTimeout(function () {
- _ = !0,
- clearTimeout(a)
- }, 300))
- }),
- u
- }
- ,
- this.readyForPreroll = function (t) {
- var o = this
- , d = this.vodParas
- , i = (this.debug && (vodh5player.trace("readyForPreroll() hasPreAD:" + d.hasPreAD),
- d.preAdsParas && vodh5player.trace("preAds:" + d.preAdsParas.length)),
- 0);
- if (!d.hasPreAD || void 0 === d.preAdsParas || 0 === d.preAdsParas.length)
- return vodh5player.trace("ADS nopreroll 2"),
- d.hasPreAD = !1,
- o.analyticObj.ready4play1_1 = !0,
- t.setAdsLabel(),
- void t.trigger("nopreroll");
- t.ads._state.adsReady = !0,
- t.ads.startLinearAdMode();
- for (var e = 0, a = i + 1; a < d.preAdsParas.length; a++)
- e += d.preAdsParas[a].duration;
- t.setAdsLabel(i + 1 + "/" + d.preAdsParas.length, d.preAdsParas[i].clickUrl, e),
- t.src({
- src: "" + d.preAdsParas[i].url,
- type: "application/x-mpegURL"
- });
- var r = d.preAdsParas[i].adStartMonitor
- , r = (null != r && "" !== r && vodh5player.xhrRequest({
- url: r,
- data: {}
- }),
- d.preAdsParas[i].adMonitor3)
- , r = (null != r && "" !== r && vodh5player.xhrRequest({
- url: r,
- data: {}
- }),
- d.preAdsParas[i].adMonitor4);
- null != r && "" !== r && vodh5player.xhrRequest({
- url: r,
- data: {}
- }),
- t.on("adplaying", function () {
- vodh5player.trace("pre adplaying trigger ads-ad-started"),
- t.trigger("ads-ad-started"),
- !0 !== d.preAdsParas[i].sent && (d.preAdsParas[i].sent = !0,
- o.sendAliAnalytic_ad("/play.1.42", "ad_url=" + encodeURIComponent(d.preAdsParas[i].url) + "&ad_v_id=" + d.preAdsParas[i].guid + "&ad_sum=" + d.preAdsParas.length + "&ad_num=" + (i + 1) + "&ad_len=" + 15 * d.preAdsParas.length))
- }),
- t.on("adended", function () {
- if (vodh5player.trace("ADS pre adended"),
- o.sendAliAnalytic_ad("/play.1.43", "ad_url=" + encodeURIComponent(d.preAdsParas[i].url) + "&ad_v_id=" + d.preAdsParas[i].guid + "&ad_sum=" + d.preAdsParas.length + "&ad_num=" + (i + 1) + "&ad_len=" + 15 * d.preAdsParas.length),
- ++i < d.preAdsParas.length) {
- for (var e = 0, a = (d.preAdsIndex = i) + 1; a < d.preAdsParas.length; a++)
- e += d.preAdsParas[a].duration;
- t.setAdsLabel(i + 1 + "/" + d.preAdsParas.length, d.preAdsParas[i].clickUrl, e),
- t.src({
- src: "" + d.preAdsParas[i].url,
- type: "application/x-mpegURL"
- });
- var r = d.preAdsParas[i].adStartMonitor
- , r = (null != r && "" !== r && vodh5player.xhrRequest({
- url: r,
- data: {}
- }),
- d.preAdsParas[i].adMonitor3)
- , r = (null != r && "" !== r && vodh5player.xhrRequest({
- url: r,
- data: {}
- }),
- d.preAdsParas[i].adMonitor4);
- null != r && "" !== r && vodh5player.xhrRequest({
- url: r,
- data: {}
- })
- } else
- d.preAdsIndex = 0,
- o.analyticObj.ready4play1_1 = !0,
- t.setAdsLabel(),
- t.ads.endLinearAdMode(),
- t.off("adended"),
- t.off("adplaying"),
- o.sendAliAnalytic("/play.1.6")
- })
- }
- ,
- this.readyForPostroll = function (e) {
- if (vodh5player.trace("readyForPostroll() hasPostAD:" + this.vodParas.hasPostAD),
- !this.vodParas.hasPostAD || void 0 === this.POST_AD_URL)
- return vodh5player.trace("ADS nopostroll 1" + this.POST_AD_URL),
- void e.trigger("nopostroll");
- var e = this.POST_AD_URL
- , a = (this.vodParas.postAdsParas && (this.vodParas.postAdsParas.length = 0,
- delete this.vodParas.postAdsParas),
- this);
- vodh5player.xhrRequest({
- url: e,
- timeout: vodh5player.VJS_ADS_TIMEOUT,
- data: {},
- success: function (e) {
- vodh5player.trace("postad loaded " + e),
- null === e ? a.parsePostAdsDataError(null) : a.parsePostAdsData(e)
- },
- error: function (e) {
- vodh5player.trace("postad load error" + e),
- a.parsePostAdsDataError(e)
- }
- })
- }
- ,
- this.startPostAD = function () {
- for (var r = 0, t = this.vodParas, o = this.vjsplayer, d = this, e = (o.isInPictureInPicture() && o.exitPictureInPicture(),
- 0), a = r + 1; a < t.postAdsParas.length; a++)
- e += t.postAdsParas[a].duration;
- o.ads.startLinearAdMode(),
- o.setAdsLabel(r + 1 + "/" + t.postAdsParas.length, t.postAdsParas[r].clickUrl, e),
- o.src({
- src: "" + t.postAdsParas[r].url,
- type: "application/x-mpegURL"
- }),
- o.on("adplaying", function () {
- vodh5player.trace("post adplaying trigger ads-ad-started"),
- o.trigger("ads-ad-started"),
- !0 !== t.postAdsParas[r].sent && (t.postAdsParas[r].sent = !0,
- d.sendAliAnalytic_ad("/play.1.42", "ad_url=" + encodeURIComponent(t.postAdsParas[r].url) + "&ad_v_id=" + t.postAdsParas[r].guid + "&ad_sum=" + t.postAdsParas.length + "&ad_num=" + (r + 1) + "&ad_len=" + 15 * t.postAdsParas.length))
- }),
- o.on("adended", function () {
- vodh5player.trace("ADS post adended"),
- d.sendAliAnalytic_ad("/play.1.43", "ad_url=" + encodeURIComponent(t.postAdsParas[r].url) + "&ad_v_id=" + t.postAdsParas[r].guid + "&ad_sum=" + t.postAdsParas.length + "&ad_num=" + (r + 1) + "&ad_len=" + 15 * t.postAdsParas.length);
- for (var e = 0, a = ++r + 1; a < t.postAdsParas.length; a++)
- e += t.postAdsParas[a].duration;
- r < t.postAdsParas.length ? (o.setAdsLabel(r + 1 + "/" + t.postAdsParas.length, t.postAdsParas[r].clickUrl, e),
- o.src({
- src: "" + t.postAdsParas[r].url,
- type: "application/x-mpegURL"
- })) : (vodh5player.trace("all post over"),
- o.setAdsLabel(),
- o.ads.endLinearAdMode(),
- o.off("adended"),
- o.off("adplaying"))
- })
- }
- ,
- this.changeSrc = function (e, a) {
- vodh5player.trace(" changeSrc()");
- var r = this.vjsplayer
- , t = r.currentTime();
- r.src(e),
- !0 === a ? r.currentTime(0) : r.currentTime(t)
- }
- ,
- this.contentEnded = function () {
- vodh5player.trace(" contentEnded()");
- var e = this.vjsplayer;
- if (this.isSafariPreAdHasShowed_ = !0,
- e.loop2())
- e.currentTime(0),
- e.play();
- else {
- try {
- PlayComplete()
- } catch (e) {
- console.warn(vodh5player.DEBUG_LABEL + " disappearance function PlayComplete ,contentEnded")
- }
- if (!0 === e.autoNext())
- try {
- NextVideo()
- } catch (e) {
- console.warn(vodh5player.DEBUG_LABEL + " disappearance function NextVideo ,contentEnded")
- }
- }
- }
- ,
- this.getPreAdVdnError = function (e) {
- console.warn(vodh5player.DEBUG_LABEL + "getPreAdVdnError !" + e)
- }
- ,
- this.getPreAdVdnErrorXHR = function (e) {
- console.warn(vodh5player.DEBUG_LABEL + "getPreAdVdnErrorXHR !" + e)
- }
- ,
- this.getPostAdVdnError = function (e) {
- console.warn(vodh5player.DEBUG_LABEL + "getPostAdVdnError !" + e)
- }
- ,
- this.getPostAdVdnErrorXHR = function (e) {
- console.warn(vodh5player.DEBUG_LABEL + "getPostAdVdnErrorXHR !" + e)
- }
- ,
- this.parsePreAdsDataError = function () {
- console.warn(vodh5player.DEBUG_LABEL + "parsePreAdsDataError !"),
- this.requestContentVDN(this.vodParas)
- }
- ,
- this.parsePostAdsDataError = function (e) {
- console.warn(vodh5player.DEBUG_LABEL + "parsePostAdsDataError !" + e),
- this.vjsplayer.trigger("nopostroll")
- }
- ,
- this.dispose = function (e) {
- console.log('disposedisposedisposedisposedisposedisposedispose1123');
- vodh5player.trace("disposing :" + this.vjsplayer.id()),
- void 0 !== window.vjsp2p && (vodh5player.trace("destroy window.vjsp2p"),
- window.vjsp2p.destroy(),
- window.vjsp2p = null),
- this.liveAudio,
- "undefined" != typeof convivaVideoAnalytics && (vodh5player.trace("cleaning conviva :" + this.vjsplayer.id()),
- convivaVideoAnalytics.reportPlaybackEnded(),
- convivaVideoAnalytics.release(),
- convivaVideoAnalytics = null,
- videoPlayer.convivaVideoAnalytics = null,
- Conviva.Analytics.release()),
- vodh5player.removeElementById(vodh5player.CONVIVA_URL_NAME_1),
- vodh5player.removeElementById(vodh5player.CONVIVA_URL_NAME_2),
- vodh5player.removeElementById(vodh5player.CONVIVA_URL_NAME_3),
- vodh5player.removeElementById(vodh5player.ALI_ANALYTICS_NAME),
- vodh5player.removeElementById(vodh5player.FINGERPRINT2_NAME),
- vodh5player.removeElementById(this.VIDEO_CORE_NAME),
- vodh5player.removeElementById(this.VHS_NAME),
- vodh5player.removeElementById(this.VIDEO_LANG_NAME),
- this.sendAliAnalytic("/play.1.5"),
- clearInterval(this.analyticObj.heartbeat),
- clearInterval(this.analyticObj.cumulativeTimeTimer),
- this.vjsplayer.dispose()
- }
- ,
- this.sendAliAnalytic = function (e, a, r) {
- var t = "";
- null != a && (t += a),
- void 0 === r && (a = this.analyticObj,
- t = (t = (t = (t = (t = (t += "&playScene=" + vodh5player.PLAY_SCENE) + "&playerName=" + vodh5player.PLAYER_NAME) + "&playerversion=" + a.playerversion) + "&streamType=" + a.streamType) + "&streamProtocol=" + a.streamProtocol) + "&playAMR=" + a.playAMR,
- void 0 !== this.vjsplayer ? (null !== this.vjsplayer.getCurentBitrate() ? t += "&bit=" + this.vjsplayer.getCurentBitrate() : t += "&bit=0",
- t += "&loadtime=" + a.loadtime) : t += "&bit=0&loadtime=0",
- t += "&playtime=" + this.analyticObj.cumulativeTime,
- void 0 !== this.vjsplayer ? t += "&playing=" + this.vjsplayer.isPlaying() : t += "&playing=" + !1,
- void 0 !== this.vjsplayer && this.vjsplayer.getQualityLevels() && (t += "&streamMBR=" + this.vjsplayer.getQualityLevels().length),
- t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t += "&v_id=" + this.vodParas.videoId) + "&referURL=" + encodeURIComponent(document.referrer)) + "&curURL=" + encodeURIComponent(window.location.href)) + "&createTime=" + a.createTime) + "&streamUrl=" + encodeURIComponent(a.streamUrl)) + "&cdnCode=" + a.cdnCode) + "&lc_ip=" + a.lc_ip) + "&lc_coun=" + a.lc_coun) + "&lc_prov=" + a.lc_prov) + "&lc_city=" + a.lc_city) + "&lc_isp=" + a.lc_isp) + "&client_sid=" + a.client_sid) + "&column=" + a.column) + "&channel=" + a.channel) + "&assetName=" + a.assetName) + "&public=" + a.public) + "&cdncip=" + a.cdncip) + "&cdnsip=" + a.cdnsip) + "&P2PStyle=" + a.P2PStyle) + "&unixts=" + Math.round((new Date).getTime() / 1e3)),
- "undefined" != typeof goldlog ? goldlog.record(e, "", t, "") : vodh5player.trace("lost alianlytic", !0)
- }
- ,
- this.sendAliAnalytic_ad = function (e, a) {
- var r = ""
- , a = (null != a && (r += a),
- this.analyticObj)
- , r = (r += "&playScene=" + vodh5player.PLAY_SCENE) + ("&playerversion=" + a.playerversion);
- void 0 !== this.vjsplayer ? (null !== this.vjsplayer.getCurentBitrate() ? r += "&bit=" + this.vjsplayer.getCurentBitrate() : r += "&bit=0",
- r += "&loadtime=" + a.loadtime) : r += "&bit=0&loadtime=0",
- r = (r = (r = (r = (r = (r = (r = r + ("&v_id=" + this.vodParas.videoId) + "&type=vod") + "&referURL=" + encodeURIComponent(document.referrer)) + "&curURL=" + encodeURIComponent(window.location.href)) + "&createTime=" + a.createTime) + "&cdnCode=" + a.cdnCode) + "&column=" + a.column) + "&channel=" + a.channel,
- "undefined" != typeof goldlog ? goldlog.record(e, "", r, "") : this.debug && window.console.warn(vodh5player.DEBUG_LABEL + "lost alianlytic")
- }
- ,
- this.cumulativeTimeStep = function (e) {
- console.log(e.vjsplayer.isPlaying());
- e.vjsplayer &&
- e.vjsplayer.isPlaying() &&
- e.vjsplayer.ads &&
- !1 === e.vjsplayer.ads.isInAdMode() &&
- e.analyticObj.cumulativeTime++
- }
- ,
- this.aliHeartbeat = function (e) {
- e.sendAliAnalytic("/play.1.2")
- }
- }
- return vodh5player.playerList = [],
- vodh5player.workerWatcherVCList = [],
- vodh5player.VJS_ADS_TIMEOUT = 6e3,
- "jstest.v.cntv.cn" === document.domain ? vodh5player.RELEASE = !1 : vodh5player.RELEASE = !0,
- vodh5player.DEV = !1,
- !0 === vodh5player.RELEASE && (vodh5player.DEV = !1),
- vodh5player.DEBUG_LABEL = "[vh5] ",
- vodh5player.DEBUG = !1,
- vodh5player.VERSION = "",
- vodh5player.debugInfo = "",
- vodh5player.enableVip = !1,
- vodh5player.skipAdTip = !1,
- vodh5player.DRM = !1,
- vodh5player.TMP_DRM_CLOSE = !1,
- vodh5player.enableQualityLock = !0,
- vodh5player.DEFAULT_QUALITY_LABELS = ["SLD", "LD", "STD", "HD", "SD", "SHD", "720P", "1080P"],
- vodh5player.DEFAULT_QUALITIES_DIVIDE = [0, 25e4, 5e5, 1e6, 15e5, 23e5, 4e6, 6e6, 1e7],
- vodh5player.uniquelabel = !1,
- vodh5player.PLAYER_TYPES = ["normal", "4k"],
- vodh5player.DOMAIN = vodh5player.RELEASE ? "player.cntv.cn/h5vod/" : "jstest.v.cntv.cn/h5vod/",
- vodh5player.rootDomain,
- vodh5player.cdnDomain,
- !0 === vodh5player.DEV && (vodh5player.DOMAIN = "jstest.v.cntv.cn/h5vod/dev/"),
- vodh5player.HTTP_PRE = "https://",
- vodh5player.VDN_AD_URL = "vdn.apps.cntv.cn/api/getVideoInfoAd.do?",
- vodh5player.AD_VDN_TIME_OUT = 6e3,
- vodh5player.VDN_URL = "vdn.apps.cntv.cn/api/getHttpVideoInfo.do?",
- vodh5player.VDN_PARA1 = "&client=flash&im=0",
- vodh5player.VDN_AD_STATIC_CHECK = "47899B86370B879139C08EA3B5E88267",
- vodh5player.PLAYER_NAME = vodh5player.DRM ? "HTML5_VOD_DRM_PLAYER" : "HTML5_VOD_PLAYER",
- vodh5player.PLAY_SCENE = "HTML5.PC",
- vodh5player.APP_NAME = "WEB.HTML5.PC",
- vodh5player.CONFIG_URL = "h5vodconfig.json",
- vodh5player.H5_WORKER = "h5.worker",
- vodh5player.workIsLoading = !1,
- vodh5player.workerLoaded = !1,
- vodh5player.H5_WORKER_NAME = "vodh5_" + vodh5player.H5_WORKER,
- vodh5player.workerModuleInitialized = !1,
- vodh5player.getWorkerStatus = function () {
- var e = {}
- , a = !1
- , r = !1;
- return Object.defineProperty(e, "workertimeout", {
- get: function () {
- return r
- },
- set: function (e) {
- e ? (r = e,
- vodh5player.workerWatcherVCList.forEach(function (e) {
- console.log(e.id),
- e.workerTimeroutError()
- })) : console.log("only TRUE can be set to this value!")
- }
- }),
- Object.defineProperty(e, "initialized", {
- get: function () {
- return a
- },
- set: function (e) {
- e ? (a = e,
- vodh5player.workerWatcherVCList.forEach(function (e) {
- console.log(e.id),
- e.loadChecker()
- })) : console.log("only TRUE can be set to this value!")
- }
- })
- }
- ,
- vodh5player.workerStatus = vodh5player.getWorkerStatus(),
- vodh5player.WORKER_TIMEOUT = 6e3,
- vodh5player.styleLoaded = !1,
- vodh5player.P2P = !1,
- vodh5player.HLSP2P = "hlsp2p.js",
- vodh5player.hlsp2pLoaded = !1,
- vodh5player.HLSP2P_NAME = "vodh5_" + vodh5player.HLSP2P,
- vodh5player.HLSP2P_HAS_INSTANCE_RUNNING = !1,
- vodh5player.CHOOSE_VIDEO_URL = "api.cntv.cn/NewVideo/getVideoListByPrimaryPageId?mode=2&sort=asc&n=96&p=1&serviceId=panda",
- vodh5player.CHOOSE_VIDEO_NAME = "vodh5_choosevideo",
- vodh5player.BARRAGE_CONFIG_URL = "www.cntv.cn/pinglun/liuyan/2019dmbq/index.json",
- vodh5player.convivaOn = !1,
- vodh5player.CONVIVA_URL_1 = "conviva/conviva-core-sdk.js",
- vodh5player.CONVIVA_URL_2 = "conviva/conviva-videojs-module.js",
- vodh5player.CONVIVA_URL_3 = "conviva/conviva-vod.js",
- vodh5player.CONVIVA_URL_NAME_1 = "vod-conviva-core-sdk-4-0-4",
- vodh5player.CONVIVA_URL_NAME_2 = "vod-conviva-videojs-module-4-0-4",
- vodh5player.CONVIVA_URL_NAME_3 = "vod-conviva-cctv-4-0-4",
- vodh5player.alianalyicsOn = !0,
- vodh5player.ALI_ANALYTICS_DOMAIN = "js.data.cctv.com",
- vodh5player.ALI_ANALYTICS_URL = "/__aplus_plugin_cctv.js,aplus_plugin_aplus_u.js",
- vodh5player.ALI_ANALYTICS_NAME = "aliAnalyticsJs237",
- vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_P2P = "10002",
- vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_JSON_PARSE = "998",
- vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_TIMEOUT = "999",
- vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_OTHER = "10000",
- vodh5player.ALI_ANALYTICS_ERROR_CODE_1_24_COPYRIGHT = "10001",
- vodh5player.FINGERPRINT2_URL = "js.player.cntv.cn/creator/fingerprint2.js",
- vodh5player.FINGERPRINT2_NAME = "jsFingerLoader",
- vodh5player.VIDEO_SNAP_URL = "",
- vodh5player.ALI_HEARTBEAT = 20,
- vodh5player.isSafari = -1 < navigator.userAgent.indexOf("Safari") && -1 == navigator.userAgent.indexOf("Chrome"),
- vodh5player.ERROR_CODE = ["0001", "0002", "0003", "0004", "0005", "0006", "0007", "0008", "0009", "0010"],
- vodh5player.ERROR_CODE = ["0001", "0002", "0003", "0004", "0005", "0006", "0007", "0008", "0009", "0010"],
- vodh5player.namespace = getvodplayerNS(),
- vodh5player.namespace.addConfig = function (e) {
- console.warn(vodh5player.DEBUG_LABEL + "addConfig" + e)
- }
- ,
- vodh5player.namespace.pauseAllPlayer = function (e) {
- vodh5player.playerList;
- for (var a = 0; a < vodh5player.playerList.length; a++)
- vodh5player.playerList[a].group === e && vodh5player.playerList[a].pause()
- }
- ,
- vodh5player.namespace.debug = function (e) {
- vodh5player.DEBUG = !0 === e
- }
- ,
- vodh5player.namespace.getVodPlayer = function (e) {
- if (0 === vodh5player.playerList.length)
- return console.warn(vodh5player.DEBUG_LABEL + "there is no players"),
- null;
- if (void 0 === e)
- return vodh5player.playerList[vodh5player.playerList.length - 1];
- for (var a, r = vodh5player.playerList.length, t = 0; t < r; t++)
- if ((a = vodh5player.playerList[t]) && a.id === e)
- return a
- }
- ,
- vodh5player.namespace.getVodPlayers = function () {
- return vodh5player.playerList
- }
- ,
- vodh5player.namespace.createVodPlayer = function (e) {
- var a = ""
- , a = "\n H5vodplayer Release Wrapper:" + wrapperversion + "\n"
- , a = (vodh5player.RELEASE ? window$1.console.log("%c " + a, "color:#2a9934;font-size:8pt;letter-spacing:12pt;line-height:8pt;font-weight:bold;font-family:monospace;") : window$1.console.log("%c " + (a = "\n H5vodplayer DEBUG Wrapper:" + wrapperversion + " warn this`s debug version!\n"), "color:#ff6868;font-size:8pt;letter-spacing:12pt;line-height:8pt;font-weight:bold;font-family:monospace;"),
- vodh5player.trace("vodh5player creating...", !1, e.divId),
- {})
- , r = navigator.userAgent.toLowerCase()
- , t = ((t = r.match(/msie ([\d.]+)/)) ? a.ie = t[1] : (t = r.match(/firefox\/([\d.]+)/)) ? a.firefox = t[1] : (t = r.match(/chrome\/([\d.]+)/)) ? a.chrome = t[1] : (t = r.match(/opera.([\d.]+)/)) ? a.opera = t[1] : (t = r.match(/version\/([\d.]+).*safari/)) && (a.safari = t[1]),
- vodh5player.isSafari && (vodh5player.versionSafari = a.safari),
- vodh5player.rootDomain = document.domain.split(".").slice(-2).join("."),
- "com.cn" === vodh5player.rootDomain && (vodh5player.rootDomain = document.domain.split(".").slice(-3).join(".")),
- -1 < navigator.userAgent.indexOf("Edge") || navigator.userAgent.indexOf("Edg"),
- "undefined" != typeof Conviva && void 0 === Conviva.Analytics && (vodh5player.trace("there is conviva left, clearing ..."),
- Conviva = void 0),
- "function" != typeof getCookie_vdn ? (window.console.warn(vodh5player.DEBUG_LABEL + "lost getCookie_vdn(), check if the dependent file vodplayer.js exist"),
- void 0 === vodh5player.getCookie_vdn("Fingerprint") || "" === vodh5player.getCookie_vdn("Fingerprint") ? vodh5player.trace("create new fingerprint") : e.fingerprint_uid = vodh5player.getCookie_vdn("Fingerprint")) : void 0 === getCookie_vdn("Fingerprint") || "" === getCookie_vdn("Fingerprint") ? vodh5player.trace("create new fingerprint") : e.fingerprint_uid = getCookie_vdn("Fingerprint"),
- new VodConstructer(e.divId));
- if (t.paramTranslation(e),
- !isWasmSupported())
- return vodh5player.wasmSupported_ = !1,
- window$1.console.warn("不支持wasm"),
- (a = document.createElement("link")).type = "text/css",
- a.rel = "stylesheet",
- a.href = vodh5player.HTTP_PRE + vodh5player.DOMAIN + "./css/vodh5player-v2.min.css",
- document.getElementsByTagName("head")[0].appendChild(a),
- (a = document.getElementById(e.divId)).className = "vdn-novideo-error pic_box",
- void ("micromessenger" == r.match(/MicroMessenger/i) && "windows" == r.match(/Windows/i) ? a.innerHTML = "<div style='height:50px; top:40%; position: relative;'>您当前的浏览器不支持视频播放 <br><br> 请使用外部浏览器观看 <br><br> (如果是360、QQ或搜狗浏览器,须使用极速模式观看)</div>" : a.innerHTML = "<div style='height:50px; top:45%; position: relative;'>您当前的浏览器无法支持该视频播放 <br><br> 请到浏览器官方网站更新版本,或更换其他浏览器和设备</div>");
- vodh5player.wasmSupported_ = !0,
- t.loadCore(),
- vodh5player.loadAliAnalyticsJs()
- }
- ,
- vodh5player.namespace.dispose = function (e, a) {
- console.log('进来----------------------');
- vodh5player.trace("disposing ... disposePlugin:" + a),
- e.shellstructure.dispose(a);
- for (var r = !1, t = vodh5player.playerList.length - 1; 0 <= t; t--)
- if (vodh5player.playerList[t] === e) {
- vodh5player.playerList.splice(t, 1),
- r = !0;
- break
- }
- r || console.warn("disposing player isnt in the playerlist")
- }
- ,
- vodh5player.getHostName = function (e) {
- var a;
- return -1 < e.indexOf("//") ? (a = e.indexOf("/", 8),
- e.substring(0, a)) : ""
- }
- ,
- vodh5player.getdomain = function (e) {
- return document.domain
- }
- ,
- vodh5player.xhrRequest = function (r) {
- if ("[object Object]" === String(r)) {
- r.method = r.method ? r.method.toUpperCase() : "GET",
- r.data = r.data || {};
- var e, a = [];
- for (e in r.data)
- a.push("".concat(e, "=", r.data[e]));
- r.data = a.join("&"),
- "GET" === r.method && 0 < r.data.length && (r.url += 0 === location.search.length ? "".concat("?", r.data) : "".concat("&", r.data));
- var t = new XMLHttpRequest;
- t.responseType = r.responseType || "json",
- t.onreadystatechange = function () {
- 4 === t.readyState && (200 === t.status ? r.success && "function" == typeof r.success && r.success(t.response, r.customPara, t.getAllResponseHeaders()) : r.error && "function" == typeof r.error && r.error())
- }
- ,
- t.open(r.method, r.url, !0),
- void 0 !== r.timeout && (t.timeout = r.timeout),
- t.ontimeout = function (e) {
- var a;
- r.ontimeout && "function" == typeof r.ontimeout && ((a = {}).url = r.url,
- r.ontimeout(a))
- }
- ,
- "POST" === r.method && t.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"),
- void 0 !== r.vtoken && "" !== r.vtoken && t.setRequestHeader("vtoken", r.vtoken),
- t.send("POST" === r.method ? r.data : null)
- }
- }
- ,
- vodh5player.loadScript = function (e, a, r, t, o) {
- var d = document.getElementsByTagName("head")[0]
- , i = document.createElement("script");
- i.type = "text/javascript",
- i.onload = function () {
- "function" == typeof a && (o ? setTimeout(function () {
- a(r)
- }, o) : a(r))
- }
- ,
- i.onreadystatechange = function () {
- (8 < clientInfo.broserVersion && 4 == i.readyState && 200 == i.status || clientInfo.broserVersion <= 8 && ("loaded" == i.readyState || "complete" == i.readyState)) && "function" == typeof a && (o ? setTimeout(function () {
- a(r)
- }, o) : a(r))
- }
- ,
- i.onerror = function () {
- "function" == typeof t && t(r)
- }
- ,
- i.src = e,
- d.appendChild(i)
- }
- ,
- vodh5player.createElementByType = function (e, a, r, t, o, d, i) {
- e = document.createElement(e);
- return e.setAttribute("id", a),
- e.style.position = r,
- e.style.width = t,
- e.style.height = o,
- e.style.left = d,
- e.style.top = i,
- e
- }
- ,
- vodh5player.removeElementById = function (e) {
- e = document.getElementById(e);
- null !== e && e.parentNode.removeChild(e)
- }
- ,
- vodh5player.loadAliAnalyticsJs = function () {
- var e;
- null === document.getElementById(vodh5player.ALI_ANALYTICS_NAME) && (0 < ["ipanda.cn", "cctv.cn"].indexOf(vodh5player.rootDomain) && (vodh5player.ALI_ANALYTICS_DOMAIN = "js.data.cctv.cn"),
- (e = vodh5player.createElementByType("script", "", "absolute", "0px", "0px", "0px", "0px")).src = vodh5player.HTTP_PRE + vodh5player.ALI_ANALYTICS_DOMAIN + vodh5player.ALI_ANALYTICS_URL,
- document.getElementsByTagName("head")[0].appendChild(e),
- e.onload = function () {
- e.id = vodh5player.ALI_ANALYTICS_NAME
- }
- )
- }
- ,
- vodh5player.getCookie_vdn = function (e) {
- var a = "";
- if (document.cookie)
- for (var r = document.cookie.split("; "), t = 0; t < r.length; t++) {
- var o = r[t].split("=");
- if (o[0] == e) {
- a = o[1].toString();
- break
- }
- }
- a += "";
- try {
- (!a || a.length < 20) && window.localStorage && (a = localStorage[e] || "")
- } catch (e) {
- a = ""
- }
- return a
- }
- ,
- vodh5player.getFingerprint = function () {
- (new Fingerprint2).get(function (e) {
- vodh5player.setCookie_vdn("Fingerprint", e.toUpperCase(), 7)
- })
- }
- ,
- vodh5player.setCookie_vdn = function (e, a, r) {
- var t;
- r ? ((t = new Date).setTime(t.getTime() + 24 * r * 60 * 60 * 1e3),
- document.cookie = e + "=" + a + ";expires=" + t.toGMTString()) : document.cookie = e + "=" + a;
- try {
- window.localStorage && localStorage.setItem(e, a)
- } catch (e) { }
- }
- ,
- vodh5player.getfingerprint2 = function () {
- var e = document.getElementsByTagName("head")[0]
- , a = vodh5player.createElementByType("script", vodh5player.FINGERPRINT2_NAME, "absolute", "0px", "0px", "0px", "0px");
- a.src = vodh5player.HTTP_PRE + vodh5player.FINGERPRINT2_URL,
- e.appendChild(a),
- void 0 !== a.onload && (a.onload = function () {
- getFingerprint()
- }
- ),
- void 0 !== a.onreadystatechange && (a.onreadystatechange = function () {
- "loaded" != a.readyState && "complete" != a.readyState || getFingerprint()
- }
- )
- }
- ,
- vodh5player.trace = function (e, a, r) {
- var t = new Date
- , t = vodh5player.DEBUG_LABEL + "> " + t.getHours() + ":" + t.getMinutes() + ":" + t.getSeconds() + ":" + t.getMilliseconds();
- r && (t += " {" + r + "}"),
- t += " " + e,
- vodh5player.DEBUG ? a ? window$1.console.warn(t) : window$1.console.log(t) : a && window$1.console.warn(t),
- vodh5player.debugInfo += t + "\r\n"
- }
- ,
- vodh5player
- });
|