@stinkycomputing/web-live-player 0.1.4 → 0.1.6

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/package.json CHANGED
@@ -1,57 +1,58 @@
1
- {
2
- "name": "@stinkycomputing/web-live-player",
3
- "version": "0.1.4",
4
- "description": "A Player library for Sesame video streams using WebCodecs and MoQ",
5
- "type": "module",
6
- "main": "./dist/web-live-player.cjs",
7
- "module": "./dist/web-live-player.mjs",
8
- "types": "./dist/index.d.ts",
9
- "repository": { "url": "https://github.com/stinkydev/web-live-player"},
10
- "exports": {
11
- ".": {
12
- "import": "./dist/web-live-player.mjs",
13
- "require": "./dist/web-live-player.cjs",
14
- "types": "./dist/index.d.ts"
15
- }
16
- },
17
- "files": [
18
- "dist"
19
- ],
20
- "publishConfig": {
21
- "access": "public"
22
- },
23
- "scripts": {
24
- "dev": "vite",
25
- "build": "vite build -c vite.config.lib.ts",
26
- "build:demo": "vite build",
27
- "preview": "vite preview",
28
- "typecheck": "tsc --noEmit",
29
- "test": "vitest run",
30
- "test:watch": "vitest",
31
- "clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
32
- "prepublishOnly": "npm run clean && npm run typecheck && npm test && npm run build",
33
- "publish:npm": "npm publish --access public"
34
- },
35
- "devDependencies": {
36
- "@types/node": "^20.0.0",
37
- "typescript": "^5.0.0",
38
- "vite": "^4.4.9",
39
- "vite-plugin-dts": "^3.0.0",
40
- "vitest": "^1.0.0"
41
- },
42
- "dependencies": {
43
- "mp4box": "^2.3.0",
44
- "stinky-moq-js": "0.1.21",
45
- "tinyh264": "^0.0.7"
46
- },
47
- "keywords": [
48
- "video",
49
- "streaming",
50
- "webcodecs",
51
- "moq",
52
- "media-over-quic",
53
- "live-video"
54
- ],
55
- "author": "",
56
- "license": "MIT"
57
- }
1
+ {
2
+ "name": "@stinkycomputing/web-live-player",
3
+ "version": "0.1.6",
4
+ "description": "A Player library for Sesame video streams using WebCodecs and MoQ",
5
+ "type": "module",
6
+ "main": "./dist/web-live-player.cjs",
7
+ "module": "./dist/web-live-player.mjs",
8
+ "types": "./dist/index.d.ts",
9
+ "repository": { "url": "https://github.com/stinkydev/web-live-player"},
10
+ "exports": {
11
+ ".": {
12
+ "import": "./dist/web-live-player.mjs",
13
+ "require": "./dist/web-live-player.cjs",
14
+ "types": "./dist/index.d.ts"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "scripts": {
24
+ "dev": "vite",
25
+ "build": "vite build -c vite.config.lib.ts",
26
+ "build:demo": "vite build",
27
+ "preview": "vite preview",
28
+ "typecheck": "tsc --noEmit",
29
+ "test": "vitest run",
30
+ "test:watch": "vitest",
31
+ "clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
32
+ "prepublishOnly": "npm run clean && npm run typecheck && npm test && npm run build",
33
+ "publish:npm": "npm publish --access public"
34
+ },
35
+ "devDependencies": {
36
+ "@types/node": "^20.0.0",
37
+ "typescript": "^5.0.0",
38
+ "vite": "^4.4.9",
39
+ "vite-plugin-dts": "^3.0.0",
40
+ "vitest": "^1.0.0"
41
+ },
42
+ "dependencies": {
43
+ "mp4box": "^2.3.0",
44
+ "stinky-moq-js": "0.1.22",
45
+ "tinyh264": "^0.0.7",
46
+ "@stinkycomputing/sesame-api-client": "1.4.1-beta.10"
47
+ },
48
+ "keywords": [
49
+ "video",
50
+ "streaming",
51
+ "webcodecs",
52
+ "moq",
53
+ "media-over-quic",
54
+ "live-video"
55
+ ],
56
+ "author": "",
57
+ "license": "MIT"
58
+ }
@@ -1,98 +0,0 @@
1
- /**
2
- * Sesame Binary Protocol - TypeScript Implementation
3
- *
4
- * This module provides TypeScript implementation of the Sesame binary protocol
5
- * for serializing and deserializing multimedia data packets.
6
- */
7
- export declare const PROTOCOL_MAGIC = 1297302867;
8
- export declare const PROTOCOL_VERSION = 1;
9
- export declare const HEADER_DATA_SIZE = 32;
10
- export declare const HEADER_CODEC_DATA_SIZE = 24;
11
- export declare const HEADER_METADATA_SIZE = 64;
12
- export declare const FLAG_HAS_CODEC_DATA: number;
13
- export declare const FLAG_HAS_METADATA: number;
14
- export declare const FLAG_IS_KEYFRAME: number;
15
- export declare enum PacketType {
16
- VIDEO_FRAME = 1,
17
- AUDIO_FRAME = 2,
18
- RPC = 3,
19
- MUXED_DATA = 4,
20
- DECODER_DATA = 5
21
- }
22
- export declare enum CodecType {
23
- VIDEO_VP8 = 1,
24
- VIDEO_VP9 = 2,
25
- VIDEO_AVC = 3,
26
- VIDEO_HEVC = 4,
27
- VIDEO_AV1 = 5,
28
- AUDIO_OPUS = 64,
29
- AUDIO_AAC = 65,
30
- AUDIO_PCM = 66
31
- }
32
- export interface HeaderData {
33
- magic: number;
34
- flags: number;
35
- pts: bigint;
36
- id: bigint;
37
- version: number;
38
- header_size: number;
39
- type: PacketType;
40
- reserved: number;
41
- }
42
- export interface HeaderCodecData {
43
- sample_rate: number;
44
- timebase_num: number;
45
- timebase_den: number;
46
- codec_profile: number;
47
- codec_level: number;
48
- width: number;
49
- height: number;
50
- codec_type: CodecType;
51
- channels: number;
52
- bit_depth: number;
53
- reserved: number;
54
- }
55
- export interface HeaderMetadata {
56
- metadata: string;
57
- }
58
- export interface ParsedData {
59
- valid: boolean;
60
- header: HeaderData | null;
61
- metadata: HeaderMetadata | null;
62
- codec_data: HeaderCodecData | null;
63
- payload: Uint8Array | null;
64
- payload_size: number;
65
- }
66
- /**
67
- * Main binary protocol class with static methods for serialization/deserialization
68
- */
69
- export declare class SesameBinaryProtocol {
70
- /**
71
- * Initialize a header data structure with proper defaults
72
- */
73
- static initHeader(type: PacketType, flags: number, pts: bigint, id: bigint): HeaderData;
74
- /**
75
- * Calculate the total header size based on flags
76
- */
77
- static calculateHeaderSize(flags: number): number;
78
- /**
79
- * Validate a header structure
80
- */
81
- static validateHeader(header: HeaderData, totalSize: number): boolean;
82
- /**
83
- * Serialize data into a Uint8Array buffer
84
- */
85
- static serialize(header: HeaderData, metadata?: HeaderMetadata | null, codecData?: HeaderCodecData | null, payload?: Uint8Array | null): Uint8Array | null;
86
- /**
87
- * Parse incoming binary data
88
- */
89
- static parseData(data: Uint8Array): ParsedData;
90
- /**
91
- * Helper: Convert string to fixed-size byte array (null-terminated)
92
- */
93
- private static stringToFixedBytes;
94
- /**
95
- * Helper: Convert fixed-size byte array to string (null-terminated)
96
- */
97
- private static fixedBytesToString;
98
- }