stormcloud-video-player 0.8.56 → 0.8.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/stormcloud-vp.min.js +1 -3
- package/lib/index.cjs +161 -283
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +12 -29
- package/lib/index.d.ts +12 -29
- package/lib/index.js +141 -227
- package/lib/index.js.map +1 -1
- package/lib/player/AdBreakOrchestrator.cjs +118 -188
- package/lib/player/AdBreakOrchestrator.cjs.map +1 -1
- package/lib/player/AdConfigManager.cjs +103 -200
- package/lib/player/AdConfigManager.cjs.map +1 -1
- package/lib/player/AdConfigManager.d.cts +0 -1
- package/lib/player/AdTimingService.cjs.map +1 -1
- package/lib/player/HlsEngine.cjs.map +1 -1
- package/lib/player/PlaceholderLayer.cjs.map +1 -1
- package/lib/player/PlayerControls.cjs.map +1 -1
- package/lib/player/Scte35CueManager.cjs.map +1 -1
- package/lib/player/Scte35Parser.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +134 -205
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/playerTypes.cjs.map +1 -1
- package/lib/players/FilePlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +134 -205
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +134 -205
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.cjs.map +1 -1
- package/lib/sdk/pal.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +134 -205
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/utils/browserCompat.cjs.map +1 -1
- package/lib/utils/ctvVastSignals.cjs.map +1 -1
- package/lib/utils/devUrl.cjs.map +1 -1
- package/lib/utils/polyfills.cjs.map +1 -1
- package/lib/utils/tracking.cjs +134 -199
- package/lib/utils/tracking.cjs.map +1 -1
- package/lib/utils/trackingIngest.cjs +322 -0
- package/lib/utils/trackingIngest.cjs.map +1 -0
- package/lib/utils/trackingIngest.d.cts +14 -0
- package/lib/utils/vastEnvironmentSignals.cjs.map +1 -1
- package/lib/utils/vastMacros.cjs.map +1 -1
- package/lib/utils/vastTrackingMacros.cjs.map +1 -1
- package/package.json +1 -3
- package/lib/utils/mqttClient.cjs +0 -305
- package/lib/utils/mqttClient.cjs.map +0 -1
- package/lib/utils/mqttClient.d.cts +0 -13
- package/lib/utils/mqttConfig.cjs +0 -139
- package/lib/utils/mqttConfig.cjs.map +0 -1
- package/lib/utils/mqttConfig.d.cts +0 -20
- package/src/certs/emqxsl-ca.crt +0 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/ubuntu24-new/Dev/stormcloud-vp/lib/player/playerTypes.cjs"],"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","__hasOwnProp","prototype","hasOwnProperty","__copyProps","to","from","except"],"mappings":"AAAA
|
|
1
|
+
{"version":3,"sources":["/home/ubuntu24-new/Dev/stormcloud-vp/lib/player/playerTypes.cjs"],"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","__hasOwnProp","prototype","hasOwnProperty","__copyProps","to","from","except","desc","getOwnPropertyNames","call","key","get"],"mappings":"AAAA;;;;;;;;;AACA,IAAIA,YAAYC,EAAAA,qBAAAA,IAAOC,MAAAA,QAAc;IACrC,EAAIC,EAAAA,QAAAA,CAAAA,OAAAA,qCAAAA,SAAAA,EAAmBF,GAAAA,MAAOG,YAAAA,OAAAA,KAAwB,IAAA,YAAA;YAClDC,kCAAAA,2BAAAA;;;gBAAAA,IAAAA,MAAAA;gBACAC,IAAAA,CAAAA,QAAeL,KAAAA,EAAOM,EAAAA,CAAAA,IAAAA,EAAS,CAACC,KAAAA,QAAAA,CAAc,OAC9CC,UAAc,IAAA,KAAA;oBAAA,KAAA,KAACC,IAAD;+BAACA,GAAIC,CAAAA,CAAAA,IAAMC;;oBAAAA,MAAQC,MAAAA,CAAAA,CAAAA,OAAAA,iBAAAA,MAAAA,IAAAA,KAAAA,KAAAA,UAAAA;gBAAAA;;YAFjCR,QAAAA,YAAAA,IAAoBJ,OAAOa,OAAAA,YAAmB,cAA9CT,SAAAA,6BAAAA,QAAAA,yBAAAA;;YAAAA;YAAAA;;;qBAAAA,6BAAAA;oBAAAA;;;oBAAAA;0BAAAA;;;;MAGF,IAAIM,QAAQ,CAAA,OAAOA,qCAAP,SAAOA,KAAG,MAAM,YAAY,OAAOA,SAAS,YAAY;cAC7D,kCAAA,2BAAA;;;;;;;gBACH,IAAI,CAACL,OAAAA,MAAaS,IAAI,CAACL,IAAIM,QAAQA,QAAQJ,QACzCZ,UAAUU,IAAIM,KAAK;oBAAEC,KAAK,CAAA,CAAA,OAALA;+BAAWN,IAAI,CAACK,IAAI","sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/player/playerTypes.ts\nvar playerTypes_exports = {};\nmodule.exports = __toCommonJS(playerTypes_exports);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/ubuntu24-new/Dev/stormcloud-vp/lib/players/FilePlayer.cjs"],"names":[],"mappings":"AAAA","sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/players/FilePlayer.tsx\nvar FilePlayer_exports = {};\n__export(FilePlayer_exports, {\n default: () => FilePlayer\n});\nmodule.exports = __toCommonJS(FilePlayer_exports);\nvar import_react = require(\"react\");\n\n// src/patterns.ts\nvar HLS_EXTENSIONS = /\\.(m3u8)($|\\?)/i;\nvar HLS_PATHS = /\\/hls\\//i;\nvar DASH_EXTENSIONS = /\\.(mpd)($|\\?)/i;\nvar VIDEO_EXTENSIONS = /\\.(mp4|webm|ogg|avi|mov|wmv|flv|mkv)($|\\?)/i;\nvar AUDIO_EXTENSIONS = /\\.(mp3|wav|ogg|aac|wma|flac|m4a)($|\\?)/i;\nvar canPlay = {\n hls: (url) => {\n if (!url || typeof url !== \"string\") return false;\n return HLS_EXTENSIONS.test(url) || HLS_PATHS.test(url);\n },\n dash: (url) => {\n if (!url || typeof url !== \"string\") return false;\n return DASH_EXTENSIONS.test(url);\n },\n video: (url) => {\n if (!url || typeof url !== \"string\") return false;\n return VIDEO_EXTENSIONS.test(url);\n },\n audio: (url) => {\n if (!url || typeof url !== \"string\") return false;\n return AUDIO_EXTENSIONS.test(url);\n },\n file: (url) => {\n if (!url || typeof url !== \"string\") return false;\n return VIDEO_EXTENSIONS.test(url) || AUDIO_EXTENSIONS.test(url);\n }\n};\n\n// src/players/FilePlayer.tsx\nvar FilePlayer = class extends import_react.Component {\n constructor() {\n super(...arguments);\n this.mounted = false;\n this.ready = false;\n this.load = () => {\n if (!this.props.videoElement || !this.props.src) return;\n const video = this.props.videoElement;\n const handleLoadedMetadata = () => {\n if (this.mounted && !this.ready) {\n this.ready = true;\n this.props.onReady?.();\n }\n };\n const handlePlay = () => {\n if (this.mounted) {\n this.props.onPlay?.();\n }\n };\n const handlePause = () => {\n if (this.mounted) {\n this.props.onPause?.();\n }\n };\n const handleEnded = () => {\n if (this.mounted) {\n this.props.onEnded?.();\n }\n };\n const handleError = (error) => {\n if (this.mounted) {\n this.props.onError?.(error);\n }\n };\n const handleLoadedData = () => {\n if (this.mounted) {\n this.props.onLoaded?.();\n }\n };\n video.addEventListener(\"loadedmetadata\", handleLoadedMetadata);\n video.addEventListener(\"play\", handlePlay);\n video.addEventListener(\"pause\", handlePause);\n video.addEventListener(\"ended\", handleEnded);\n video.addEventListener(\"error\", handleError);\n video.addEventListener(\"loadeddata\", handleLoadedData);\n video.src = this.props.src;\n if (this.props.autoplay !== void 0) video.autoplay = this.props.autoplay;\n if (this.props.muted !== void 0) video.muted = this.props.muted;\n if (this.props.loop !== void 0) video.loop = this.props.loop;\n if (this.props.controls !== void 0) video.controls = this.props.controls;\n if (this.props.playsInline !== void 0)\n video.playsInline = this.props.playsInline;\n if (this.props.preload !== void 0)\n video.preload = this.props.preload;\n if (this.props.poster !== void 0) video.poster = this.props.poster;\n this.props.onMount?.(this);\n return () => {\n video.removeEventListener(\"loadedmetadata\", handleLoadedMetadata);\n video.removeEventListener(\"play\", handlePlay);\n video.removeEventListener(\"pause\", handlePause);\n video.removeEventListener(\"ended\", handleEnded);\n video.removeEventListener(\"error\", handleError);\n video.removeEventListener(\"loadeddata\", handleLoadedData);\n };\n };\n this.play = () => {\n if (this.props.videoElement) {\n const video = this.props.videoElement;\n const hasValidSource = video.src || video.currentSrc && video.currentSrc !== \"\" || video.readyState >= 1;\n if (hasValidSource) {\n video.play()?.catch((error) => {\n console.error(\"[FilePlayer] Failed to play:\", error);\n this.props.onError?.(error);\n });\n } else {\n console.warn(\"[FilePlayer] Cannot play: video has no valid source\");\n }\n }\n };\n this.pause = () => {\n if (this.props.videoElement) {\n this.props.videoElement.pause();\n }\n };\n this.stop = () => {\n this.pause();\n if (this.props.videoElement) {\n this.props.videoElement.currentTime = 0;\n }\n };\n this.seekTo = (seconds, keepPlaying) => {\n if (this.props.videoElement) {\n this.props.videoElement.currentTime = seconds;\n if (!keepPlaying) {\n this.pause();\n }\n }\n };\n this.setVolume = (volume) => {\n if (this.props.videoElement) {\n this.props.videoElement.volume = Math.max(0, Math.min(1, volume));\n }\n };\n this.mute = () => {\n if (this.props.videoElement) {\n this.props.videoElement.muted = true;\n }\n };\n this.unmute = () => {\n if (this.props.videoElement) {\n this.props.videoElement.muted = false;\n }\n };\n this.setPlaybackRate = (rate) => {\n if (this.props.videoElement && rate > 0) {\n this.props.videoElement.playbackRate = rate;\n }\n };\n this.setLoop = (loop) => {\n if (this.props.videoElement) {\n this.props.videoElement.loop = loop;\n }\n };\n this.getDuration = () => {\n if (this.props.videoElement && isFinite(this.props.videoElement.duration)) {\n return this.props.videoElement.duration;\n }\n return null;\n };\n this.getCurrentTime = () => {\n if (this.props.videoElement && isFinite(this.props.videoElement.currentTime)) {\n return this.props.videoElement.currentTime;\n }\n return null;\n };\n this.getSecondsLoaded = () => {\n if (this.props.videoElement && this.props.videoElement.buffered.length > 0) {\n return this.props.videoElement.buffered.end(\n this.props.videoElement.buffered.length - 1\n );\n }\n return null;\n };\n this.getInternalPlayer = (key = \"player\") => {\n if (key === \"video\") return this.props.videoElement;\n return null;\n };\n this.enablePIP = async () => {\n if (this.props.videoElement && \"requestPictureInPicture\" in this.props.videoElement) {\n try {\n await this.props.videoElement.requestPictureInPicture();\n } catch (error) {\n console.warn(\"Picture-in-Picture failed:\", error);\n }\n }\n };\n this.disablePIP = async () => {\n if (document.pictureInPictureElement) {\n try {\n await document.exitPictureInPicture();\n } catch (error) {\n console.warn(\"Exit Picture-in-Picture failed:\", error);\n }\n }\n };\n }\n componentDidMount() {\n this.mounted = true;\n this.load();\n }\n componentWillUnmount() {\n this.mounted = false;\n }\n componentDidUpdate(prevProps) {\n if (prevProps.src !== this.props.src) {\n this.load();\n }\n }\n render() {\n return null;\n }\n};\nFilePlayer.displayName = \"FilePlayer\";\nFilePlayer.canPlay = canPlay.file;\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/ubuntu24-new/Dev/stormcloud-vp/lib/players/FilePlayer.cjs","../../src/players/FilePlayer.tsx"],"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","__hasOwnProp","call","__toCommonJS","mod","value","FilePlayer_exports"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YACIA,IAAAA,MAAAA,CAAYC,IAAAA,CAAAA,EAAOC,UAAAA,IAAc,MAAA,KAAA,CAAA,YAAA,CAAA,QAAA,CAAA,MAAA,GAAA,GAAA;gBACjCC,OAAAA,MAAAA,GAAmBF,EAAAA,CAAAA,IAAOG,QAAAA,CAAAA,QAAAA,CAAAA,GAAAA,CAC1BC,EADkD,IAClDA,KAAAA,CAAAA,GAAoBJ,OAAOK,EAAAA,CAAAA,QAAAA,CAAAA,MAAAA,CAAmB,EAAA;YAE9CC,SAAW,kBAACC,QAAQC;YACtB,EAAK,IAAIC,CAAAA,OAAQD,IACfT,UAAUQ,QAAQE,MAAM;YAAEC,KAAKF,GAAG,CAACC,KAAK;YAAEE,EAAAA,WAAY,MAAA,GAAA;gBAAA,uEAAA;YAAK,IAAA,QAAA,SAAA,OAAA,MAAA,KAAA,CAAA,YAAA;YAC/D,OAAA;QACIC,cAAc,qBAACC,IAAIC,MAAMC,QAAQC;QACnC,IAAIF,EAAAA,OAAQ,CAAA,CAAA,GAAA,GAAOA,qCAAP,SAAOA,KAAG,MAAM,YAAY,OAAOA,SAAS,YAAY;;oBAC7D;;;;yCAAA,KAAA,CAAA,YAAA,IAAA,SAAA,oBAAA,OAAA,EAAA,GAAA,CAAA,YAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;4BAAA,GAAIG,MAAJ;kCACH,EAAA,EAAI,CAACC,CAAAA,CAAAA,WAAaC,IAAI,CAACN,IAAII,QAAQA,EAAAA,MAAQF,QACzChB,UAAUc,IAAII,KAAK;;;;;;;;;;;;;yBAAwBN,EAAAA,UAAY,CAAEK,CAAAA,OAAOd,iBAAiBY,MAAMG,IAAG,KAAMD,KAAKL,UAAU;;;;;;0CAAC,uBAAA,QAAA;;;;;;;;;;;;;;gCAFpH,IAAK,KAAA,OAAWP,aAAAA,KAAkBU,0BAA7B,SAAA,6BAAA,QAAA,yBAAA;;;8BAAL;;;;;;;8BAAK,MAAA,IAAA,CAAA,mCAAA;;;;;;;;;;;;;;;;;;8CAAA;;;8BAAA;;;;oDAAA;;;;;;;gBAGP,IAAA,UAAA,GAAA,KAAA,IAAA,CAAA,KAAA,CAAA,GAAA,EAAA;oBACA,IAAA,CAAOD,IAAAA;gBACT;YACA,EAAIO,eAAe,sBAACC;;;0BAAQT,YAAYb,UAAU,CAAC,GAAG,cAAc;;oBAAEuB,GAAAA,IAAO;cAAK,IAAID;;;;;AAEtF,WAAA,WAAA,GAAA,IAA6B;ACnB7B,IAAAE,OAAAA,OAAAA,GAAAA,IAAA,CAAA,GAAA,IAAA","sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/players/FilePlayer.tsx\nvar FilePlayer_exports = {};\n__export(FilePlayer_exports, {\n default: () => FilePlayer\n});\nmodule.exports = __toCommonJS(FilePlayer_exports);\nvar import_react = require(\"react\");\n\n// src/patterns.ts\nvar HLS_EXTENSIONS = /\\.(m3u8)($|\\?)/i;\nvar HLS_PATHS = /\\/hls\\//i;\nvar DASH_EXTENSIONS = /\\.(mpd)($|\\?)/i;\nvar VIDEO_EXTENSIONS = /\\.(mp4|webm|ogg|avi|mov|wmv|flv|mkv)($|\\?)/i;\nvar AUDIO_EXTENSIONS = /\\.(mp3|wav|ogg|aac|wma|flac|m4a)($|\\?)/i;\nvar canPlay = {\n hls: (url) => {\n if (!url || typeof url !== \"string\") return false;\n return HLS_EXTENSIONS.test(url) || HLS_PATHS.test(url);\n },\n dash: (url) => {\n if (!url || typeof url !== \"string\") return false;\n return DASH_EXTENSIONS.test(url);\n },\n video: (url) => {\n if (!url || typeof url !== \"string\") return false;\n return VIDEO_EXTENSIONS.test(url);\n },\n audio: (url) => {\n if (!url || typeof url !== \"string\") return false;\n return AUDIO_EXTENSIONS.test(url);\n },\n file: (url) => {\n if (!url || typeof url !== \"string\") return false;\n return VIDEO_EXTENSIONS.test(url) || AUDIO_EXTENSIONS.test(url);\n }\n};\n\n// src/players/FilePlayer.tsx\nvar FilePlayer = class extends import_react.Component {\n constructor() {\n super(...arguments);\n this.mounted = false;\n this.ready = false;\n this.load = () => {\n if (!this.props.videoElement || !this.props.src) return;\n const video = this.props.videoElement;\n const handleLoadedMetadata = () => {\n if (this.mounted && !this.ready) {\n this.ready = true;\n this.props.onReady?.();\n }\n };\n const handlePlay = () => {\n if (this.mounted) {\n this.props.onPlay?.();\n }\n };\n const handlePause = () => {\n if (this.mounted) {\n this.props.onPause?.();\n }\n };\n const handleEnded = () => {\n if (this.mounted) {\n this.props.onEnded?.();\n }\n };\n const handleError = (error) => {\n if (this.mounted) {\n this.props.onError?.(error);\n }\n };\n const handleLoadedData = () => {\n if (this.mounted) {\n this.props.onLoaded?.();\n }\n };\n video.addEventListener(\"loadedmetadata\", handleLoadedMetadata);\n video.addEventListener(\"play\", handlePlay);\n video.addEventListener(\"pause\", handlePause);\n video.addEventListener(\"ended\", handleEnded);\n video.addEventListener(\"error\", handleError);\n video.addEventListener(\"loadeddata\", handleLoadedData);\n video.src = this.props.src;\n if (this.props.autoplay !== void 0) video.autoplay = this.props.autoplay;\n if (this.props.muted !== void 0) video.muted = this.props.muted;\n if (this.props.loop !== void 0) video.loop = this.props.loop;\n if (this.props.controls !== void 0) video.controls = this.props.controls;\n if (this.props.playsInline !== void 0)\n video.playsInline = this.props.playsInline;\n if (this.props.preload !== void 0)\n video.preload = this.props.preload;\n if (this.props.poster !== void 0) video.poster = this.props.poster;\n this.props.onMount?.(this);\n return () => {\n video.removeEventListener(\"loadedmetadata\", handleLoadedMetadata);\n video.removeEventListener(\"play\", handlePlay);\n video.removeEventListener(\"pause\", handlePause);\n video.removeEventListener(\"ended\", handleEnded);\n video.removeEventListener(\"error\", handleError);\n video.removeEventListener(\"loadeddata\", handleLoadedData);\n };\n };\n this.play = () => {\n if (this.props.videoElement) {\n const video = this.props.videoElement;\n const hasValidSource = video.src || video.currentSrc && video.currentSrc !== \"\" || video.readyState >= 1;\n if (hasValidSource) {\n video.play()?.catch((error) => {\n console.error(\"[FilePlayer] Failed to play:\", error);\n this.props.onError?.(error);\n });\n } else {\n console.warn(\"[FilePlayer] Cannot play: video has no valid source\");\n }\n }\n };\n this.pause = () => {\n if (this.props.videoElement) {\n this.props.videoElement.pause();\n }\n };\n this.stop = () => {\n this.pause();\n if (this.props.videoElement) {\n this.props.videoElement.currentTime = 0;\n }\n };\n this.seekTo = (seconds, keepPlaying) => {\n if (this.props.videoElement) {\n this.props.videoElement.currentTime = seconds;\n if (!keepPlaying) {\n this.pause();\n }\n }\n };\n this.setVolume = (volume) => {\n if (this.props.videoElement) {\n this.props.videoElement.volume = Math.max(0, Math.min(1, volume));\n }\n };\n this.mute = () => {\n if (this.props.videoElement) {\n this.props.videoElement.muted = true;\n }\n };\n this.unmute = () => {\n if (this.props.videoElement) {\n this.props.videoElement.muted = false;\n }\n };\n this.setPlaybackRate = (rate) => {\n if (this.props.videoElement && rate > 0) {\n this.props.videoElement.playbackRate = rate;\n }\n };\n this.setLoop = (loop) => {\n if (this.props.videoElement) {\n this.props.videoElement.loop = loop;\n }\n };\n this.getDuration = () => {\n if (this.props.videoElement && isFinite(this.props.videoElement.duration)) {\n return this.props.videoElement.duration;\n }\n return null;\n };\n this.getCurrentTime = () => {\n if (this.props.videoElement && isFinite(this.props.videoElement.currentTime)) {\n return this.props.videoElement.currentTime;\n }\n return null;\n };\n this.getSecondsLoaded = () => {\n if (this.props.videoElement && this.props.videoElement.buffered.length > 0) {\n return this.props.videoElement.buffered.end(\n this.props.videoElement.buffered.length - 1\n );\n }\n return null;\n };\n this.getInternalPlayer = (key = \"player\") => {\n if (key === \"video\") return this.props.videoElement;\n return null;\n };\n this.enablePIP = async () => {\n if (this.props.videoElement && \"requestPictureInPicture\" in this.props.videoElement) {\n try {\n await this.props.videoElement.requestPictureInPicture();\n } catch (error) {\n console.warn(\"Picture-in-Picture failed:\", error);\n }\n }\n };\n this.disablePIP = async () => {\n if (document.pictureInPictureElement) {\n try {\n await document.exitPictureInPicture();\n } catch (error) {\n console.warn(\"Exit Picture-in-Picture failed:\", error);\n }\n }\n };\n }\n componentDidMount() {\n this.mounted = true;\n this.load();\n }\n componentWillUnmount() {\n this.mounted = false;\n }\n componentDidUpdate(prevProps) {\n if (prevProps.src !== this.props.src) {\n this.load();\n }\n }\n render() {\n return null;\n }\n};\nFilePlayer.displayName = \"FilePlayer\";\nFilePlayer.canPlay = canPlay.file;\n","import { Component } from \"react\";\nimport { canPlay } from \"../patterns\";\n\nexport interface FilePlayerProps {\n src: string;\n videoElement?: HTMLVideoElement;\n onMount?: (player: any) => void;\n onReady?: () => void;\n onPlay?: () => void;\n onPause?: () => void;\n onEnded?: () => void;\n onLoaded?: () => void;\n onError?: (error: any) => void;\n autoplay?: boolean;\n muted?: boolean;\n loop?: boolean;\n controls?: boolean;\n playsInline?: boolean;\n preload?: string;\n poster?: string;\n}\n\nexport default class FilePlayer extends Component<FilePlayerProps> {\n static displayName = \"FilePlayer\";\n\n static canPlay = canPlay.file;\n\n private mounted = false;\n private ready = false;\n\n componentDidMount() {\n this.mounted = true;\n this.load();\n }\n\n componentWillUnmount() {\n this.mounted = false;\n }\n\n componentDidUpdate(prevProps: FilePlayerProps) {\n if (prevProps.src !== this.props.src) {\n this.load();\n }\n }\n\n load = () => {\n if (!this.props.videoElement || !this.props.src) return;\n\n const video = this.props.videoElement;\n\n const handleLoadedMetadata = () => {\n if (this.mounted && !this.ready) {\n this.ready = true;\n this.props.onReady?.();\n }\n };\n\n const handlePlay = () => {\n if (this.mounted) {\n this.props.onPlay?.();\n }\n };\n\n const handlePause = () => {\n if (this.mounted) {\n this.props.onPause?.();\n }\n };\n\n const handleEnded = () => {\n if (this.mounted) {\n this.props.onEnded?.();\n }\n };\n\n const handleError = (error: any) => {\n if (this.mounted) {\n this.props.onError?.(error);\n }\n };\n\n const handleLoadedData = () => {\n if (this.mounted) {\n this.props.onLoaded?.();\n }\n };\n\n video.addEventListener(\"loadedmetadata\", handleLoadedMetadata);\n video.addEventListener(\"play\", handlePlay);\n video.addEventListener(\"pause\", handlePause);\n video.addEventListener(\"ended\", handleEnded);\n video.addEventListener(\"error\", handleError);\n video.addEventListener(\"loadeddata\", handleLoadedData);\n\n video.src = this.props.src;\n if (this.props.autoplay !== undefined) video.autoplay = this.props.autoplay;\n if (this.props.muted !== undefined) video.muted = this.props.muted;\n if (this.props.loop !== undefined) video.loop = this.props.loop;\n if (this.props.controls !== undefined) video.controls = this.props.controls;\n if (this.props.playsInline !== undefined)\n video.playsInline = this.props.playsInline;\n if (this.props.preload !== undefined)\n video.preload = this.props.preload as \"\" | \"metadata\" | \"none\" | \"auto\";\n if (this.props.poster !== undefined) video.poster = this.props.poster;\n\n this.props.onMount?.(this);\n\n return () => {\n video.removeEventListener(\"loadedmetadata\", handleLoadedMetadata);\n video.removeEventListener(\"play\", handlePlay);\n video.removeEventListener(\"pause\", handlePause);\n video.removeEventListener(\"ended\", handleEnded);\n video.removeEventListener(\"error\", handleError);\n video.removeEventListener(\"loadeddata\", handleLoadedData);\n };\n };\n\n play = () => {\n if (this.props.videoElement) {\n const video = this.props.videoElement;\n const hasValidSource =\n video.src ||\n (video.currentSrc && video.currentSrc !== \"\") ||\n video.readyState >= 1;\n\n if (hasValidSource) {\n video.play()?.catch((error) => {\n console.error(\"[FilePlayer] Failed to play:\", error);\n this.props.onError?.(error);\n });\n } else {\n console.warn(\"[FilePlayer] Cannot play: video has no valid source\");\n }\n }\n };\n\n pause = () => {\n if (this.props.videoElement) {\n this.props.videoElement.pause();\n }\n };\n\n stop = () => {\n this.pause();\n if (this.props.videoElement) {\n this.props.videoElement.currentTime = 0;\n }\n };\n\n seekTo = (seconds: number, keepPlaying?: boolean) => {\n if (this.props.videoElement) {\n this.props.videoElement.currentTime = seconds;\n if (!keepPlaying) {\n this.pause();\n }\n }\n };\n\n setVolume = (volume: number) => {\n if (this.props.videoElement) {\n this.props.videoElement.volume = Math.max(0, Math.min(1, volume));\n }\n };\n\n mute = () => {\n if (this.props.videoElement) {\n this.props.videoElement.muted = true;\n }\n };\n\n unmute = () => {\n if (this.props.videoElement) {\n this.props.videoElement.muted = false;\n }\n };\n\n setPlaybackRate = (rate: number) => {\n if (this.props.videoElement && rate > 0) {\n this.props.videoElement.playbackRate = rate;\n }\n };\n\n setLoop = (loop: boolean) => {\n if (this.props.videoElement) {\n this.props.videoElement.loop = loop;\n }\n };\n\n getDuration = (): number | null => {\n if (this.props.videoElement && isFinite(this.props.videoElement.duration)) {\n return this.props.videoElement.duration;\n }\n return null;\n };\n\n getCurrentTime = (): number | null => {\n if (\n this.props.videoElement &&\n isFinite(this.props.videoElement.currentTime)\n ) {\n return this.props.videoElement.currentTime;\n }\n return null;\n };\n\n getSecondsLoaded = (): number | null => {\n if (\n this.props.videoElement &&\n this.props.videoElement.buffered.length > 0\n ) {\n return this.props.videoElement.buffered.end(\n this.props.videoElement.buffered.length - 1\n );\n }\n return null;\n };\n\n getInternalPlayer = (key = \"player\") => {\n if (key === \"video\") return this.props.videoElement;\n return null;\n };\n\n enablePIP = async () => {\n if (\n this.props.videoElement &&\n \"requestPictureInPicture\" in this.props.videoElement\n ) {\n try {\n await (this.props.videoElement as any).requestPictureInPicture();\n } catch (error) {\n console.warn(\"Picture-in-Picture failed:\", error);\n }\n }\n };\n\n disablePIP = async () => {\n if (document.pictureInPictureElement) {\n try {\n await document.exitPictureInPicture();\n } catch (error) {\n console.warn(\"Exit Picture-in-Picture failed:\", error);\n }\n }\n };\n\n render() {\n return null;\n }\n}\n"]}
|
|
@@ -2465,163 +2465,83 @@ function createPalNonceManager() {
|
|
|
2465
2465
|
}
|
|
2466
2466
|
};
|
|
2467
2467
|
}
|
|
2468
|
-
// src/utils/
|
|
2469
|
-
var
|
|
2468
|
+
// src/utils/trackingIngest.ts
|
|
2469
|
+
var DEFAULT_TRACKING_INGEST_CONFIG = {
|
|
2470
2470
|
enabled: true,
|
|
2471
|
-
|
|
2472
|
-
brokerPort: 8883,
|
|
2473
|
-
wsPort: 8084,
|
|
2474
|
-
username: "for-sonifi",
|
|
2475
|
-
password: "sonifi-mqtt",
|
|
2476
|
-
topicPrefix: "adstorm/players",
|
|
2477
|
-
qos: 1
|
|
2471
|
+
baseUrl: "https://player-analytics-ingest-api-760490581852.us-central1.run.app/api/adstorm/player-tracking"
|
|
2478
2472
|
};
|
|
2479
|
-
var
|
|
2480
|
-
function
|
|
2481
|
-
|
|
2482
|
-
}
|
|
2483
|
-
function isMQTTEnabled() {
|
|
2484
|
-
return mqttConfig.enabled;
|
|
2485
|
-
}
|
|
2486
|
-
function buildMQTTBrokerUrl() {
|
|
2487
|
-
if (mqttConfig.brokerUrl) return mqttConfig.brokerUrl;
|
|
2488
|
-
return "wss://".concat(mqttConfig.brokerAddress, ":").concat(mqttConfig.wsPort, "/mqtt");
|
|
2489
|
-
}
|
|
2490
|
-
function buildPlayerTopic(licenseKey, channel) {
|
|
2491
|
-
return "".concat(mqttConfig.topicPrefix, "/").concat(licenseKey, "/").concat(channel);
|
|
2492
|
-
}
|
|
2493
|
-
// src/utils/mqttClient.ts
|
|
2494
|
-
var import_mqtt = __toESM(require("mqtt"), 1);
|
|
2495
|
-
var LOG = "[StormcloudVideoPlayer][MQTT]";
|
|
2496
|
-
var KEEPALIVE_SECONDS = 30;
|
|
2497
|
-
var CONNECT_TIMEOUT_MS = 1e4;
|
|
2498
|
-
var RECONNECT_BASE_MS = 5e3;
|
|
2499
|
-
var RECONNECT_MAX_MS = 6e4;
|
|
2500
|
-
var MAX_RECONNECT_ATTEMPTS = 8;
|
|
2501
|
-
var COOLDOWN_MS = 10 * 6e4;
|
|
2502
|
-
var client = null;
|
|
2503
|
-
var status = "disconnected";
|
|
2504
|
-
var reconnectAttempts = 0;
|
|
2505
|
-
var reconnectTimer = null;
|
|
2506
|
-
var stopped = false;
|
|
2507
|
-
function clearReconnectTimer() {
|
|
2508
|
-
if (reconnectTimer) {
|
|
2509
|
-
clearTimeout(reconnectTimer);
|
|
2510
|
-
reconnectTimer = null;
|
|
2511
|
-
}
|
|
2512
|
-
}
|
|
2513
|
-
function teardownClient() {
|
|
2514
|
-
if (client) {
|
|
2515
|
-
try {
|
|
2516
|
-
client.removeAllListeners();
|
|
2517
|
-
client.end(true);
|
|
2518
|
-
} catch (unused) {}
|
|
2519
|
-
client = null;
|
|
2520
|
-
}
|
|
2521
|
-
}
|
|
2522
|
-
function scheduleReconnect() {
|
|
2523
|
-
if (stopped || !isMQTTEnabled() || reconnectTimer) return;
|
|
2524
|
-
if (reconnectAttempts >= MAX_RECONNECT_ATTEMPTS) {
|
|
2525
|
-
console.warn("".concat(LOG, " giving up after ").concat(reconnectAttempts, " attempts; cooling down for ").concat(COOLDOWN_MS / 6e4, "m"));
|
|
2526
|
-
teardownClient();
|
|
2527
|
-
status = "disconnected";
|
|
2528
|
-
reconnectTimer = setTimeout(function() {
|
|
2529
|
-
reconnectTimer = null;
|
|
2530
|
-
reconnectAttempts = 0;
|
|
2531
|
-
openConnection();
|
|
2532
|
-
}, COOLDOWN_MS);
|
|
2533
|
-
return;
|
|
2534
|
-
}
|
|
2535
|
-
var delay = Math.min(RECONNECT_MAX_MS, RECONNECT_BASE_MS * Math.pow(2, reconnectAttempts));
|
|
2536
|
-
var jitter = Math.floor(Math.random() * 1e3);
|
|
2537
|
-
reconnectAttempts += 1;
|
|
2538
|
-
reconnectTimer = setTimeout(function() {
|
|
2539
|
-
reconnectTimer = null;
|
|
2540
|
-
openConnection();
|
|
2541
|
-
}, delay + jitter);
|
|
2542
|
-
}
|
|
2543
|
-
function openConnection() {
|
|
2544
|
-
if (stopped || !isMQTTEnabled()) return;
|
|
2545
|
-
teardownClient();
|
|
2546
|
-
var url = buildMQTTBrokerUrl();
|
|
2547
|
-
status = "connecting";
|
|
2548
|
-
var clientId = "stormcloud-vp-".concat(Math.random().toString(36).slice(2, 9));
|
|
2549
|
-
try {
|
|
2550
|
-
client = import_mqtt.default.connect(url, {
|
|
2551
|
-
clientId: clientId,
|
|
2552
|
-
username: mqttConfig.username,
|
|
2553
|
-
password: mqttConfig.password,
|
|
2554
|
-
keepalive: KEEPALIVE_SECONDS,
|
|
2555
|
-
clean: true,
|
|
2556
|
-
// Disable MQTT.js internal reconnect; we manage reconnection ourselves.
|
|
2557
|
-
reconnectPeriod: 0,
|
|
2558
|
-
connectTimeout: CONNECT_TIMEOUT_MS,
|
|
2559
|
-
queueQoSZero: false,
|
|
2560
|
-
reschedulePings: true,
|
|
2561
|
-
// Root-cause fix for the Tizen 4.0 "Keepalive timeout" loop: MQTT.js's
|
|
2562
|
-
// default timerVariant "auto" runs the keepalive interval inside a
|
|
2563
|
-
// Blob-URL Web Worker (via worker-timers). On Samsung Tizen 4.0 (old
|
|
2564
|
-
// WebKit) served from a file:// origin that worker can't tick reliably,
|
|
2565
|
-
// so the keepalive counter trips onKeepaliveTimeout almost immediately
|
|
2566
|
-
// after connect. Force the native setInterval timer instead; the main
|
|
2567
|
-
// thread is free because video is decoded by the native AVPlay pipeline.
|
|
2568
|
-
timerVariant: "native"
|
|
2569
|
-
});
|
|
2570
|
-
} catch (err) {
|
|
2571
|
-
status = "error";
|
|
2572
|
-
console.warn("".concat(LOG, " connect() threw:"), err);
|
|
2573
|
-
scheduleReconnect();
|
|
2574
|
-
return;
|
|
2575
|
-
}
|
|
2576
|
-
client.on("connect", function() {
|
|
2577
|
-
status = "connected";
|
|
2578
|
-
reconnectAttempts = 0;
|
|
2579
|
-
clearReconnectTimer();
|
|
2580
|
-
console.info("".concat(LOG, " connected to ").concat(url));
|
|
2581
|
-
});
|
|
2582
|
-
client.on("offline", function() {
|
|
2583
|
-
if (status === "connected") status = "disconnected";
|
|
2584
|
-
console.warn("".concat(LOG, " offline"));
|
|
2585
|
-
scheduleReconnect();
|
|
2586
|
-
});
|
|
2587
|
-
client.on("error", function(err) {
|
|
2588
|
-
status = "error";
|
|
2589
|
-
console.warn("".concat(LOG, " error:"), err.message);
|
|
2590
|
-
scheduleReconnect();
|
|
2591
|
-
});
|
|
2592
|
-
client.on("close", function() {
|
|
2593
|
-
if (status === "connected") status = "disconnected";
|
|
2594
|
-
scheduleReconnect();
|
|
2595
|
-
});
|
|
2473
|
+
var trackingIngestConfig = _object_spread({}, DEFAULT_TRACKING_INGEST_CONFIG);
|
|
2474
|
+
function isTrackingIngestEnabled() {
|
|
2475
|
+
return trackingIngestConfig.enabled === true;
|
|
2596
2476
|
}
|
|
2597
|
-
function
|
|
2598
|
-
|
|
2599
|
-
stopped = false;
|
|
2600
|
-
reconnectAttempts = 0;
|
|
2601
|
-
openConnection();
|
|
2477
|
+
function normalizeIngestBaseUrl(baseUrl) {
|
|
2478
|
+
return baseUrl.replace(/\/+$/, "");
|
|
2602
2479
|
}
|
|
2603
|
-
function
|
|
2604
|
-
|
|
2605
|
-
|
|
2480
|
+
function buildTrackingIngestUrl(channel) {
|
|
2481
|
+
var base = normalizeIngestBaseUrl(trackingIngestConfig.baseUrl);
|
|
2482
|
+
if (channel === "impressions") {
|
|
2483
|
+
return "".concat(base, "/impressions/ingest");
|
|
2606
2484
|
}
|
|
2485
|
+
return "".concat(base, "/metrics/ingest");
|
|
2607
2486
|
}
|
|
2608
|
-
function
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2487
|
+
function ingestPlayerTracking(licenseKey, channel, body) {
|
|
2488
|
+
return _async_to_generator(function() {
|
|
2489
|
+
var response, error;
|
|
2490
|
+
return _ts_generator(this, function(_state) {
|
|
2491
|
+
switch(_state.label){
|
|
2492
|
+
case 0:
|
|
2493
|
+
if (!isTrackingIngestEnabled() || !licenseKey) {
|
|
2494
|
+
return [
|
|
2495
|
+
2,
|
|
2496
|
+
false
|
|
2497
|
+
];
|
|
2498
|
+
}
|
|
2499
|
+
_state.label = 1;
|
|
2500
|
+
case 1:
|
|
2501
|
+
_state.trys.push([
|
|
2502
|
+
1,
|
|
2503
|
+
3,
|
|
2504
|
+
,
|
|
2505
|
+
4
|
|
2506
|
+
]);
|
|
2507
|
+
return [
|
|
2508
|
+
4,
|
|
2509
|
+
fetch(buildTrackingIngestUrl(channel), {
|
|
2510
|
+
method: "POST",
|
|
2511
|
+
headers: {
|
|
2512
|
+
"Content-Type": "application/json",
|
|
2513
|
+
Authorization: "License-Key ".concat(licenseKey)
|
|
2514
|
+
},
|
|
2515
|
+
body: JSON.stringify(body)
|
|
2516
|
+
})
|
|
2517
|
+
];
|
|
2518
|
+
case 2:
|
|
2519
|
+
response = _state.sent();
|
|
2520
|
+
if (!response.ok) {
|
|
2521
|
+
console.warn("[StormcloudVideoPlayer] Tracking ingest failed (".concat(response.status, ") for ").concat(channel));
|
|
2522
|
+
return [
|
|
2523
|
+
2,
|
|
2524
|
+
false
|
|
2525
|
+
];
|
|
2526
|
+
}
|
|
2527
|
+
return [
|
|
2528
|
+
2,
|
|
2529
|
+
true
|
|
2530
|
+
];
|
|
2531
|
+
case 3:
|
|
2532
|
+
error = _state.sent();
|
|
2533
|
+
console.warn("[StormcloudVideoPlayer] Tracking ingest error for ".concat(channel, ":"), error);
|
|
2534
|
+
return [
|
|
2535
|
+
2,
|
|
2536
|
+
false
|
|
2537
|
+
];
|
|
2538
|
+
case 4:
|
|
2539
|
+
return [
|
|
2540
|
+
2
|
|
2541
|
+
];
|
|
2542
|
+
}
|
|
2619
2543
|
});
|
|
2620
|
-
|
|
2621
|
-
} catch (err) {
|
|
2622
|
-
console.warn("".concat(LOG, " publish failed on ").concat(topic, ":"), err);
|
|
2623
|
-
return false;
|
|
2624
|
-
}
|
|
2544
|
+
})();
|
|
2625
2545
|
}
|
|
2626
2546
|
// src/utils/vastEnvironmentSignals.ts
|
|
2627
2547
|
var AIRY_ANDROID_APP_ID = "com.freeairytv.android";
|
|
@@ -3392,7 +3312,7 @@ function getBrowserID(clientInfo) {
|
|
|
3392
3312
|
})();
|
|
3393
3313
|
}
|
|
3394
3314
|
function canPublish(licenseKey) {
|
|
3395
|
-
return Boolean(
|
|
3315
|
+
return Boolean(isTrackingIngestEnabled() && licenseKey);
|
|
3396
3316
|
}
|
|
3397
3317
|
function buildPlayerMetricEvent() {
|
|
3398
3318
|
return _async_to_generator(function() {
|
|
@@ -3434,10 +3354,6 @@ function buildPlayerMetricEvent() {
|
|
|
3434
3354
|
});
|
|
3435
3355
|
}).apply(this, arguments);
|
|
3436
3356
|
}
|
|
3437
|
-
function publishTracking(licenseKey, channel, body) {
|
|
3438
|
-
ensureMQTTClient();
|
|
3439
|
-
publishMQTT(buildPlayerTopic(licenseKey, channel), body);
|
|
3440
|
-
}
|
|
3441
3357
|
function sendInitialTracking(_0) {
|
|
3442
3358
|
return _async_to_generator(function(licenseKey) {
|
|
3443
3359
|
var context, metricEvent, error;
|
|
@@ -3453,9 +3369,9 @@ function sendInitialTracking(_0) {
|
|
|
3453
3369
|
case 1:
|
|
3454
3370
|
_state.trys.push([
|
|
3455
3371
|
1,
|
|
3456
|
-
|
|
3372
|
+
4,
|
|
3457
3373
|
,
|
|
3458
|
-
|
|
3374
|
+
5
|
|
3459
3375
|
]);
|
|
3460
3376
|
return [
|
|
3461
3377
|
4,
|
|
@@ -3466,23 +3382,28 @@ function sendInitialTracking(_0) {
|
|
|
3466
3382
|
];
|
|
3467
3383
|
case 2:
|
|
3468
3384
|
metricEvent = _state.sent();
|
|
3469
|
-
publishTracking(licenseKey, "metrics", {
|
|
3470
|
-
events: [
|
|
3471
|
-
metricEvent
|
|
3472
|
-
]
|
|
3473
|
-
});
|
|
3474
3385
|
return [
|
|
3475
|
-
|
|
3476
|
-
|
|
3386
|
+
4,
|
|
3387
|
+
ingestPlayerTracking(licenseKey, "metrics", {
|
|
3388
|
+
events: [
|
|
3389
|
+
metricEvent
|
|
3390
|
+
]
|
|
3391
|
+
})
|
|
3477
3392
|
];
|
|
3478
3393
|
case 3:
|
|
3394
|
+
_state.sent();
|
|
3395
|
+
return [
|
|
3396
|
+
3,
|
|
3397
|
+
5
|
|
3398
|
+
];
|
|
3399
|
+
case 4:
|
|
3479
3400
|
error = _state.sent();
|
|
3480
3401
|
console.error("[StormcloudVideoPlayer] Error sending initial tracking data:", error);
|
|
3481
3402
|
return [
|
|
3482
3403
|
3,
|
|
3483
|
-
|
|
3404
|
+
5
|
|
3484
3405
|
];
|
|
3485
|
-
case
|
|
3406
|
+
case 5:
|
|
3486
3407
|
return [
|
|
3487
3408
|
2
|
|
3488
3409
|
];
|
|
@@ -3593,9 +3514,9 @@ function sendAdImpressionTracking(_0, _1) {
|
|
|
3593
3514
|
case 1:
|
|
3594
3515
|
_state.trys.push([
|
|
3595
3516
|
1,
|
|
3596
|
-
|
|
3517
|
+
5,
|
|
3597
3518
|
,
|
|
3598
|
-
|
|
3519
|
+
6
|
|
3599
3520
|
]);
|
|
3600
3521
|
return [
|
|
3601
3522
|
4,
|
|
@@ -3605,29 +3526,43 @@ function sendAdImpressionTracking(_0, _1) {
|
|
|
3605
3526
|
];
|
|
3606
3527
|
case 2:
|
|
3607
3528
|
metricEvent = _state.sent();
|
|
3608
|
-
publishTracking(licenseKey, "heartbeat", metricEvent);
|
|
3609
|
-
publishTracking(licenseKey, "impressions", {
|
|
3610
|
-
events: [
|
|
3611
|
-
{
|
|
3612
|
-
player_id: metricEvent.player_id,
|
|
3613
|
-
ad_played_count: 1,
|
|
3614
|
-
ad_url: adImpressionInfo.adUrl,
|
|
3615
|
-
capture_at: adImpressionInfo.timestamp
|
|
3616
|
-
}
|
|
3617
|
-
]
|
|
3618
|
-
});
|
|
3619
3529
|
return [
|
|
3620
|
-
|
|
3621
|
-
|
|
3530
|
+
4,
|
|
3531
|
+
ingestPlayerTracking(licenseKey, "metrics", {
|
|
3532
|
+
events: [
|
|
3533
|
+
metricEvent
|
|
3534
|
+
]
|
|
3535
|
+
})
|
|
3622
3536
|
];
|
|
3623
3537
|
case 3:
|
|
3538
|
+
_state.sent();
|
|
3539
|
+
return [
|
|
3540
|
+
4,
|
|
3541
|
+
ingestPlayerTracking(licenseKey, "impressions", {
|
|
3542
|
+
events: [
|
|
3543
|
+
{
|
|
3544
|
+
player_id: metricEvent.player_id,
|
|
3545
|
+
ad_played_count: 1,
|
|
3546
|
+
ad_url: adImpressionInfo.adUrl,
|
|
3547
|
+
capture_at: adImpressionInfo.timestamp
|
|
3548
|
+
}
|
|
3549
|
+
]
|
|
3550
|
+
})
|
|
3551
|
+
];
|
|
3552
|
+
case 4:
|
|
3553
|
+
_state.sent();
|
|
3554
|
+
return [
|
|
3555
|
+
3,
|
|
3556
|
+
6
|
|
3557
|
+
];
|
|
3558
|
+
case 5:
|
|
3624
3559
|
error = _state.sent();
|
|
3625
3560
|
console.error("[StormcloudVideoPlayer] Error sending ad impression tracking:", error);
|
|
3626
3561
|
return [
|
|
3627
3562
|
3,
|
|
3628
|
-
|
|
3563
|
+
6
|
|
3629
3564
|
];
|
|
3630
|
-
case
|
|
3565
|
+
case 6:
|
|
3631
3566
|
return [
|
|
3632
3567
|
2
|
|
3633
3568
|
];
|
|
@@ -3650,9 +3585,9 @@ function sendHeartbeat(_0) {
|
|
|
3650
3585
|
case 1:
|
|
3651
3586
|
_state.trys.push([
|
|
3652
3587
|
1,
|
|
3653
|
-
|
|
3588
|
+
4,
|
|
3654
3589
|
,
|
|
3655
|
-
|
|
3590
|
+
5
|
|
3656
3591
|
]);
|
|
3657
3592
|
return [
|
|
3658
3593
|
4,
|
|
@@ -3660,19 +3595,28 @@ function sendHeartbeat(_0) {
|
|
|
3660
3595
|
];
|
|
3661
3596
|
case 2:
|
|
3662
3597
|
heartbeatData = _state.sent();
|
|
3663
|
-
publishTracking(licenseKey, "heartbeat", heartbeatData);
|
|
3664
3598
|
return [
|
|
3665
|
-
|
|
3666
|
-
|
|
3599
|
+
4,
|
|
3600
|
+
ingestPlayerTracking(licenseKey, "metrics", {
|
|
3601
|
+
events: [
|
|
3602
|
+
heartbeatData
|
|
3603
|
+
]
|
|
3604
|
+
})
|
|
3667
3605
|
];
|
|
3668
3606
|
case 3:
|
|
3607
|
+
_state.sent();
|
|
3608
|
+
return [
|
|
3609
|
+
3,
|
|
3610
|
+
5
|
|
3611
|
+
];
|
|
3612
|
+
case 4:
|
|
3669
3613
|
error = _state.sent();
|
|
3670
3614
|
console.error("[StormcloudVideoPlayer] Error sending heartbeat:", error);
|
|
3671
3615
|
return [
|
|
3672
3616
|
3,
|
|
3673
|
-
|
|
3617
|
+
5
|
|
3674
3618
|
];
|
|
3675
|
-
case
|
|
3619
|
+
case 5:
|
|
3676
3620
|
return [
|
|
3677
3621
|
2
|
|
3678
3622
|
];
|
|
@@ -5546,7 +5490,6 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
5546
5490
|
];
|
|
5547
5491
|
case 4:
|
|
5548
5492
|
data = _state.sent();
|
|
5549
|
-
this.applyMqttConfigFromResponse(data);
|
|
5550
5493
|
imaPayload = (_data_response = data.response) === null || _data_response === void 0 ? void 0 : (_data_response_ima = _data_response.ima) === null || _data_response_ima === void 0 ? void 0 : (_data_response_ima_publisherdeskima = _data_response_ima["publisherdesk.ima"]) === null || _data_response_ima_publisherdeskima === void 0 ? void 0 : _data_response_ima_publisherdeskima.payload;
|
|
5551
5494
|
if (imaPayload) {
|
|
5552
5495
|
decodedPayload = imaPayload;
|
|
@@ -5580,20 +5523,6 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
5580
5523
|
}).call(this);
|
|
5581
5524
|
}
|
|
5582
5525
|
},
|
|
5583
|
-
{
|
|
5584
|
-
key: "applyMqttConfigFromResponse",
|
|
5585
|
-
value: function applyMqttConfigFromResponse(data) {
|
|
5586
|
-
var _data_response;
|
|
5587
|
-
var mqttConfig2 = (_data_response = data.response) === null || _data_response === void 0 ? void 0 : _data_response.mqtt_config;
|
|
5588
|
-
if (!mqttConfig2 || (typeof mqttConfig2 === "undefined" ? "undefined" : _type_of(mqttConfig2)) !== "object") {
|
|
5589
|
-
return;
|
|
5590
|
-
}
|
|
5591
|
-
applyMQTTConfig(mqttConfig2);
|
|
5592
|
-
if (this.debug) {
|
|
5593
|
-
console.log("[StormcloudVideoPlayer] Applied MQTT config from /ads/web:", mqttConfig2);
|
|
5594
|
-
}
|
|
5595
|
-
}
|
|
5596
|
-
},
|
|
5597
5526
|
{
|
|
5598
5527
|
key: "fetchAndParseVmap",
|
|
5599
5528
|
value: function fetchAndParseVmap(vmapUrl) {
|