Milestone v1 (v2.0.0): Mokosh — Session Capture #1
@@ -29,16 +29,33 @@ export type PortMessageType =
|
|||||||
|
|
||||||
export interface PortMessage {
|
export interface PortMessage {
|
||||||
type: PortMessageType;
|
type: PortMessageType;
|
||||||
chunks?: VideoChunk[];
|
// Wire-format (post-D-12 fix): chunks travel as TransferredVideoChunk[]
|
||||||
|
// because chrome.runtime.Port JSON-serializes payloads, and
|
||||||
|
// JSON.stringify(blob) === "{}" loses binary content. The receive
|
||||||
|
// side reconstructs VideoChunk[] via src/shared/binary.ts.
|
||||||
|
chunks?: TransferredVideoChunk[];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Видеобуфер
|
// In-memory chunk shape used by the offscreen ring buffer and by
|
||||||
|
// mergeVideoChunks after the SW decodes the wire format.
|
||||||
export interface VideoChunk {
|
export interface VideoChunk {
|
||||||
data: Blob;
|
data: Blob;
|
||||||
timestamp: number;
|
timestamp: number;
|
||||||
isFirst?: boolean;
|
isFirst?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wire-format for video chunks traveling across the offscreen↔SW
|
||||||
|
// chrome.runtime.Port boundary. Replaces the previous VideoChunk[]
|
||||||
|
// payload, which failed because Blob is not JSON-serializable.
|
||||||
|
// See debug session d12-blob-port-transfer-fails and the GREEN block
|
||||||
|
// of tests/offscreen/port-serialization.test.ts for the pinned shape.
|
||||||
|
export interface TransferredVideoChunk {
|
||||||
|
data: string; // base64-encoded blob bytes (no data: prefix)
|
||||||
|
type: string; // MIME type to apply when reconstructing the Blob
|
||||||
|
timestamp: number;
|
||||||
|
isFirst?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
// Лог событий пользователя
|
// Лог событий пользователя
|
||||||
export interface UserEvent {
|
export interface UserEvent {
|
||||||
timestamp: number;
|
timestamp: number;
|
||||||
|
|||||||
Reference in New Issue
Block a user