decord/source/modules/voice_messages/VoiceMessageAnalytics.tsx

41 lines
2 KiB
TypeScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 11018
// Function ID: 85710
2026-07-20 16:05:17 +00:00
// Name: logVoiceMessagePlaybackStarted
2026-07-23 10:11:24 +00:00
// Dependencies: [653, 675, 2]
2026-07-20 16:05:17 +00:00
// Exports: logVoiceMessagePlaybackEnded, logVoiceMessagePlaybackFailed, logVoiceMessagePlaybackStarted
2026-07-23 10:11:24 +00:00
// Module 11018 (logVoiceMessagePlaybackStarted)
import { AnalyticEvents } from "ME";
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const result = require("set").fileFinishedImporting("modules/voice_messages/VoiceMessageAnalytics.tsx");
2026-07-20 16:05:17 +00:00
export const VoiceMessageRecordingResult = { SENT: "sent", CANCELLED_DURATION: "cancelled_duration", CANCELLED_USER_REQUESTED: "cancelled_user_requested", CANCELLED_GESTURE_CONFLICT: "cancelled_gesture_conflict", CANCELLED_ON_BACKGROUND: "cancelled_on_background" };
export const logVoiceMessagePlaybackStarted = function logVoiceMessagePlaybackStarted(messageId, totalDurationSecs, startDurationSecs, id) {
2026-07-23 10:11:24 +00:00
let obj = importDefault(675);
2026-07-20 16:05:17 +00:00
obj = { message_id: messageId, total_duration_secs: totalDurationSecs };
let tmp = startDurationSecs;
if (null != totalDurationSecs) {
tmp = totalDurationSecs;
}
obj.start_duration_secs = Math.min(tmp, startDurationSecs);
obj.sender_user_id = id;
obj.track(AnalyticEvents.VOICE_MESSAGE_PLAYBACK_STARTED, obj);
};
export const logVoiceMessagePlaybackEnded = function logVoiceMessagePlaybackEnded(messageId, totalDurationSecs, endDurationSecs, id, durationListeningSecs) {
2026-07-23 10:11:24 +00:00
let obj = importDefault(675);
2026-07-20 16:05:17 +00:00
obj = { message_id: messageId, total_duration_secs: totalDurationSecs };
let tmp = endDurationSecs;
if (null != totalDurationSecs) {
tmp = totalDurationSecs;
}
obj.end_duration_secs = Math.min(tmp, endDurationSecs);
obj.sender_user_id = id;
obj.duration_listening_secs = durationListeningSecs;
obj.track(AnalyticEvents.VOICE_MESSAGE_PLAYBACK_ENDED, obj);
};
export const logVoiceMessagePlaybackFailed = function logVoiceMessagePlaybackFailed(messageId, error_message) {
2026-07-23 10:11:24 +00:00
let obj = importDefault(675);
2026-07-20 16:05:17 +00:00
obj = { message_id: messageId, error_message };
obj.track(AnalyticEvents.VOICE_MESSAGE_PLAYBACK_FAILED, obj);
};