This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+197
View File
@@ -0,0 +1,197 @@
// Metro module 14166 (f14167).
import { Logger } from "../../_bundle/log";
import { MobileCustomMuxIntegration } from "./integrations/MobileCustomMuxIntegration";
let c9942_2 = new Logger("MobileMuxWrapper");
export class MobileMuxWrapper {
constructor(a0) {
const r3 = {
__proto__: new.target.prototype,
muxIntegration: null,
seekingEmitted: false,
seekTimeout: null
};
r3.config = a0;
return r3;
}
initialize() {
try {
this.muxIntegration = new MobileCustomMuxIntegration(this.config);
this.muxIntegration.initialize();
c9942_2.info("MobileMuxWrapper initialized successfully");
} catch ($e) {
c9942_2.error("Error initializing MobileMuxWrapper", $e);
this.muxIntegration = null;
}
}
updatePlayheadTime(a0) {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.updatePlayheadTime(a0);
}
}
updateVideoDimensions(a0, a1) {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.updateVideoDimensions(a0, a1);
}
}
updateVideoSourceDimensions(a0, a1) {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.updateVideoSourceDimensions(a0, a1);
}
}
updateVideoSource(a0, a1, a2) {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.updateVideoSource(a0, a1, a2);
}
}
updatePlayerState(a0, a1) {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.updatePlayerState(a0, a1);
}
}
onLoadStart() {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitLoadStart();
}
}
onLoad(a0) {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitLoad(a0);
}
}
onPlay() {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitPlay();
}
}
onPause() {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitPause();
}
}
onPlaying() {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitPlaying();
}
}
onCanPlay() {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitCanPlay();
}
}
onSeek() {
if (this.muxIntegration != null) {
if (!this.seekingEmitted) {
this.muxIntegration.emitSeeking();
this.seekingEmitted = true;
}
if (this.seekTimeout != null) {
clearTimeout(this.seekTimeout);
}
this.seekTimeout = setTimeout(() => {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitSeeked();
}
this.seekingEmitted = false;
this.seekTimeout = null;
}, 100);
}
}
onEnd() {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitEnded();
}
const muxIntegration2 = this.muxIntegration;
if (muxIntegration2 != null) {
muxIntegration2.destroy();
}
}
onError(a0) {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitError(a0);
}
}
onProgress(a0) {
this.updatePlayheadTime(a0);
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitTimeUpdate();
}
}
onBuffer(a0) {
if (!a0) {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitCanPlay();
}
const muxIntegration2 = this.muxIntegration;
if (muxIntegration2 == null ? void 0 : muxIntegration2.hasPlayStarted()) {
const muxIntegration3 = this.muxIntegration;
if (muxIntegration3 != null) {
muxIntegration3.emitPlaying();
}
}
}
}
onReadyForDisplay() {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitPlayerReady();
}
const muxIntegration2 = this.muxIntegration;
if (muxIntegration2 == null ? void 0 : muxIntegration2.hasPlayStarted()) {
const muxIntegration3 = this.muxIntegration;
if (muxIntegration3 != null) {
muxIntegration3.emitPlaying();
}
}
}
onVideoTrackChange(c20999_0, a1) {
const r8 = a1.find((item) => item.trackId === c20999_0);
if (r8 != null) {
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitRenditionChange(r8.width, r8.height, r8.bitrate);
}
}
}
destroy() {
try {
if (this.seekTimeout != null) {
clearTimeout(this.seekTimeout);
this.seekTimeout = null;
}
const muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.destroy();
}
this.muxIntegration = null;
} catch ($e) {
c9942_2.error("Error destroying MobileMuxWrapper", $e);
}
}
getSessionId() {
const muxIntegration = this.muxIntegration;
let r5 = muxIntegration == null ? void 0 : muxIntegration.getSessionId();
if (r5 == null) {
r5 = null;
}
return r5;
}
isInitialized() {
return this.muxIntegration != null;
}
}
+69
View File
@@ -0,0 +1,69 @@
// Metro module 14162 (f14163).
import { Logger } from "../../_bundle/log";
import { SessionManager } from "./utils/SessionManager";
import { MuxIntegration } from "./integrations/MuxIntegration";
import Module14165 from "../../_bundle/Module14165";
let c9912_3 = new Logger("SimpleMuxWrapper");
export class SimpleMuxWrapper {
constructor(a0) {
const r6 = {
__proto__: new.target.prototype,
isMonitoring: false
};
r6.config = a0;
r6.videoElement = a0.videoElement;
r6.sessionId = SessionManager.generateSessionId();
r6.hlsInstance = a0.hlsInstance;
return r6;
}
initialize() {
let debug = this.config.debug;
if (debug == null) {
debug = false;
}
const r6 = {
debug,
disableCookies: true,
respectDoNotTrack: true,
data: MuxIntegration.mapDiscordToMuxMetadata(this.config, this.sessionId)
};
if (this.hlsInstance != null) {
r6.hlsjs = this.hlsInstance;
r6.Hls = this.hlsInstance.constructor;
}
try {
Module14165.monitor(this.videoElement, r6);
this.isMonitoring = true;
} catch ($e) {
c9912_3.error("Error creating Mux monitor", $e);
this.isMonitoring = false;
}
}
endSession() {
if (this.isMonitoring) {
try {
if (typeof Module14165.destroyMonitor === "function") {
Module14165.destroyMonitor(this.videoElement);
}
this.isMonitoring = false;
} catch ($e) {
c9912_3.error("Error ending Mux session", $e);
}
}
}
destroy() {
if (this.isMonitoring) {
try {
if (typeof Module14165.destroyMonitor === "function") {
Module14165.destroyMonitor(this.videoElement);
}
this.isMonitoring = false;
} catch ($e) {
c9912_3.error("Error destroying Mux monitor", $e);
}
}
}
getSessionId() {
return this.sessionId;
}
}
@@ -0,0 +1,22 @@
// Metro module 14168 (f14169).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2025-09-video-qoe-metrics-tracking",
kind: "user",
defaultConfig: {
externalAnalyticsEnabled: false
},
variations: {
0: {
externalAnalyticsEnabled: false
},
1: {
externalAnalyticsEnabled: true
}
}
});
export function getVideoQoEMetricsConfig(a0) {
return apexExperiment.getConfig({
location: a0.location
});
}
+13
View File
@@ -0,0 +1,13 @@
// Metro module 14161 (f14162).
import { SimpleMuxWrapper } from "./SimpleMuxWrapper";
import { MobileMuxWrapper } from "./MobileMuxWrapper";
import { MuxIntegration } from "./integrations/MuxIntegration";
import { MobileCustomMuxIntegration } from "./integrations/MobileCustomMuxIntegration";
import { SessionManager } from "./utils/SessionManager";
import * as _VideoQoEMetricsExperiment from "./experiments/VideoQoEMetricsExperiment";
exports.SimpleMuxWrapper = SimpleMuxWrapper;
exports.MobileMuxWrapper = MobileMuxWrapper;
exports.MuxIntegration = MuxIntegration;
exports.MobileCustomMuxIntegration = MobileCustomMuxIntegration;
exports.SessionManager = SessionManager;
export const getVideoQoEMetricsConfig = _VideoQoEMetricsExperiment.getVideoQoEMetricsConfig;
@@ -0,0 +1,333 @@
// Metro module 14167 (f14168).
import { Logger } from "../../../_bundle/log";
import { SessionManager } from "../utils/SessionManager";
import Module14165 from "../../../_bundle/Module14165";
let c9943_3 = new Logger("MobileCustomMuxIntegration");
const player_version = "1.0.0";
const video_cdn = "Cloudflare";
let c9943_6 = 1000;
export class MobileCustomMuxIntegration {
isInitialized = false;
viewInitEmitted = false;
playerReadyEmitted = false;
playStarted = false;
playingEmitted = false;
currentPlayheadTime = 0;
currentRendition = null;
getPlayheadTime = () => this.currentPlayheadTime * c9943_6;
getStateData = () => this.videoState;
constructor(a0) {
this.config = a0;
this.sessionId = SessionManager.generateSessionId();
this.playerId = `discord-mobile-${this.sessionId}`;
this.videoState = {
player_is_paused: true,
player_width: 0,
player_height: 0,
player_autoplay_on: false,
player_preload_on: true,
video_cdn,
video_series: a0.contentMetadata.questId,
video_producer: a0.contentMetadata.gameId,
video_brand: a0.contentMetadata.gameName,
video_title: a0.contentMetadata.title,
video_stream_type: a0.contentMetadata.videoStreamType,
video_source_url: a0.contentMetadata.contentId,
video_source_mime_type: a0.contentMetadata.videoStreamType === "hls" ? "application/x-mpegURL" : "video/mp4",
video_source_duration: a0.contentMetadata.durationMs
};
}
initialize() {
L7: {
const muxEnvKey = this.getMuxEnvKey();
if (muxEnvKey != null && muxEnvKey.length !== 0) {
try {
const playerId = this.playerId;
let debug = this.config.debug;
if (debug == null) {
debug = false;
}
Module14165.init(playerId, {
debug,
getPlayheadTime: this.getPlayheadTime,
getStateData: this.getStateData,
data: this.mapConfigToMuxData(muxEnvKey)
});
this.isInitialized = true;
c9943_3.info("Mux Data mobile integration initialized", {
playerId: this.playerId
});
break L7;
} catch ($e) {
c9943_3.error("Error initializing Mux mobile integration", $e);
this.isInitialized = false;
break L7;
}
}
c9943_3.info("Mux environment key not available, skipping QoE tracking");
}
}
updatePlayheadTime(a0) {
this.currentPlayheadTime = a0;
}
updateVideoDimensions(a0, a1) {
this.videoState.player_width = a0;
this.videoState.player_height = a1;
}
updateVideoSourceDimensions(a0, a1) {
this.videoState.video_source_width = a0;
this.videoState.video_source_height = a1;
}
updateVideoSource(a0, a1, a2) {
this.videoState.video_source_url = a0;
this.videoState.video_source_mime_type = a1;
this.videoState.video_source_duration = a2 != null ? a2 * c9943_6 : void 0;
}
updatePlayerState(a0, a1) {
this.videoState.player_is_paused = a0;
if (a1 != null) {
this.videoState.player_is_fullscreen = a1;
}
}
emitPlayerReady() {
if (this.isInitialized && !this.playerReadyEmitted) {
try {
Module14165.emit(this.playerId, "playerready");
this.playerReadyEmitted = true;
} catch ($e) {
c9943_3.error("Error emitting playerready event", $e);
}
}
}
emitViewInit() {
if (this.isInitialized && !this.viewInitEmitted) {
try {
Module14165.emit(this.playerId, "viewinit");
this.viewInitEmitted = true;
} catch ($e) {
c9943_3.error("Error emitting viewinit event", $e);
}
}
}
emitLoadStart() {
if (this.isInitialized) {
try {
this.emitViewInit();
} catch ($e) {
c9943_3.error("Error emitting loadstart/viewinit event", $e);
}
}
}
emitLoad(a0) {
if (this.isInitialized) {
try {
this.updateVideoSource(void 0, void 0, a0);
} catch ($e) {
c9943_3.error("Error emitting load events", $e);
}
}
}
emitPlay() {
if (this.isInitialized) {
try {
if (!this.viewInitEmitted) {
this.emitViewInit();
}
this.updatePlayerState(false);
Module14165.emit(this.playerId, "play");
this.playStarted = true;
this.playingEmitted = false;
} catch ($e) {
c9943_3.error("Error emitting play event", $e);
}
}
}
emitPause() {
if (this.isInitialized) {
try {
this.updatePlayerState(true);
Module14165.emit(this.playerId, "pause");
} catch ($e) {
c9943_3.error("Error emitting pause event", $e);
}
}
}
emitPlaying() {
if (this.isInitialized && !this.playingEmitted) {
try {
if (!this.viewInitEmitted) {
this.emitViewInit();
}
if (!this.playStarted) {
Module14165.emit(this.playerId, "play");
this.playStarted = true;
}
Module14165.emit(this.playerId, "playing");
this.playingEmitted = true;
} catch ($e) {
c9943_3.error("Error emitting playing event", $e);
}
}
}
emitWaiting() {
if (this.isInitialized) {
try {
Module14165.emit(this.playerId, "waiting");
} catch ($e) {
c9943_3.error("Error emitting waiting event", $e);
}
}
}
emitCanPlay() {
this.emitPlayerReady();
}
emitSeeking() {
if (this.isInitialized) {
try {
Module14165.emit(this.playerId, "seeking");
} catch ($e) {
c9943_3.error("Error emitting seeking event", $e);
}
}
}
emitSeeked() {
if (this.isInitialized) {
try {
Module14165.emit(this.playerId, "seeked");
} catch ($e) {
c9943_3.error("Error emitting seeked event", $e);
}
}
}
emitEnded() {
if (this.isInitialized) {
try {
Module14165.emit(this.playerId, "ended");
this.emitViewEnd();
} catch ($e) {
c9943_3.error("Error emitting ended event", $e);
}
}
}
emitError(a0) {
if (this.isInitialized) {
try {
Module14165.emit(this.playerId, "error", a0);
} catch ($e) {
c9943_3.error("Error emitting error event", $e);
}
}
}
emitTimeUpdate() {
if (this.isInitialized) {
try {
if (this.playStarted && !this.playingEmitted) {
this.emitPlaying();
}
Module14165.emit(this.playerId, "timeupdate", {
player_playhead_time: this.currentPlayheadTime * c9943_6
});
} catch ($e) {
c9943_3.error("Error emitting timeupdate event", $e);
}
}
}
emitRenditionChange(a0, a1, a2) {
L8: {
if (this.isInitialized) {
if (this.currentRendition != null && this.currentRendition.width === a0 && this.currentRendition.height === a1 && this.currentRendition.bitrate === a2) {
break L8;
}
try {
this.currentRendition = {
width: a0,
height: a1,
bitrate: a2
};
this.updateVideoSourceDimensions(a0, a1);
Module14165.emit(this.playerId, "renditionchange", {
video_source_width: a0,
video_source_height: a1,
video_source_bitrate: a2
});
} catch ($e) {
c9943_3.error("Error emitting renditionchange event", $e);
}
}
}
}
destroy() {
if (this.isInitialized) {
try {
this.emitViewEnd();
Module14165.emit(this.playerId, "destroy");
this.isInitialized = false;
c9943_3.info("Mux Data mobile integration destroyed", {
playerId: this.playerId
});
} catch ($e) {
c9943_3.error("Error destroying Mux mobile integration", $e);
}
}
}
emitViewEnd() {
if (this.isInitialized) {
try {
Module14165.emit(this.playerId, "viewend");
} catch ($e) {
c9943_3.error("Error emitting viewend event", $e);
}
}
}
getSessionId() {
return this.sessionId;
}
hasPlayStarted() {
return this.playStarted;
}
mapConfigToMuxData(a0) {
let gameName = this.config.contentMetadata.gameName;
if (gameName == null) {
gameName = "Discord";
}
return {
env_key: a0,
session_id: this.sessionId,
player_name: "discord-mobile",
player_version,
player_software_name: "react-native-video",
player_software_version: "5.2.1-discord",
player_mux_plugin_name: "discord-mobile-custom-integration",
player_mux_plugin_version: player_version,
video_id: this.config.contentMetadata.contentId,
video_title: this.config.contentMetadata.title,
video_duration: this.config.contentMetadata.durationMs,
video_content_type: this.config.contentMetadata.contentType,
video_series: this.config.contentMetadata.questId,
video_producer: this.config.contentMetadata.gameId,
video_brand: gameName,
video_cdn,
video_stream_type: this.config.contentMetadata.videoStreamType,
view_client_application_name: this.getBuildChannel(),
view_client_application_version: this.getAppVersion(),
experiment_name: this.config.contentMetadata.experimentName
};
}
getAppVersion() {
let appVersion = this.config.appVersion;
if (appVersion == null) {
appVersion = "unknown";
}
return appVersion;
}
getMuxEnvKey() {
return "1qd16mdmdjasipqg3irobln4u";
}
getBuildChannel() {
let releaseChannel = this.config.releaseChannel;
if (releaseChannel == null) {
releaseChannel = "stable";
}
return releaseChannel;
}
}
@@ -0,0 +1,52 @@
// Metro module 14164 (f14165).
export class MuxIntegration {
constructor() {
return {
__proto__: new.target.prototype
};
}
static mapDiscordToMuxMetadata(a0, a1) {
let durationMs = a0.contentMetadata.durationMs;
if (durationMs == null) {
durationMs = a0.contentMetadata.durationSec != null ? 1000 * a0.contentMetadata.durationSec : void 0;
}
let gameName = a0.contentMetadata.gameName;
if (gameName == null) {
gameName = "Discord";
}
return {
env_key: "1qd16mdmdjasipqg3irobln4u",
session_id: a1,
player_name: "discord",
player_version: "1.0.0",
video_id: a0.contentMetadata.contentId,
video_title: a0.contentMetadata.title,
video_duration: durationMs,
video_content_type: a0.contentMetadata.contentType,
video_series: a0.contentMetadata.questId,
video_producer: a0.contentMetadata.gameId,
video_brand: gameName,
video_cdn: "Cloudflare",
video_stream_type: a0.contentMetadata.videoStreamType,
view_client_application_name: this.getBuildChannel(),
view_client_application_version: this.getAppVersion(),
viewer_user_id: a0.userContext?.userId,
viewer_plan: a0.userContext?.userTier
};
}
static getAppVersion() {
return "6099";
}
static getBuildChannel() {
let r5;
try {
r5 = window.GLOBAL_ENV?.RELEASE_CHANNEL;
if (r5 == null) {
r5 = "stable";
}
} catch ($e) {
return "stable";
}
return r5;
}
}
@@ -0,0 +1,11 @@
// Metro module 14163 (f14164).
export class SessionManager {
constructor() {
return {
__proto__: new.target.prototype
};
}
static generateSessionId() {
return `discord-video-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
}
}