@livepeer-frameworks/streamcrafter-core 0.0.1 → 0.1.0

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.
Files changed (43) hide show
  1. package/README.md +61 -0
  2. package/dist/cjs/IngestControllerV2-BSD6O8gz.cjs +5662 -0
  3. package/dist/cjs/IngestControllerV2-BSD6O8gz.cjs.map +1 -0
  4. package/dist/cjs/IngestControllerV2-DZFuxrNk.cjs +5768 -0
  5. package/dist/cjs/IngestControllerV2-DZFuxrNk.cjs.map +1 -0
  6. package/dist/cjs/IngestControllerV2-Mt6aX-DU.cjs +5768 -0
  7. package/dist/cjs/IngestControllerV2-Mt6aX-DU.cjs.map +1 -0
  8. package/dist/cjs/index.cjs +60 -5
  9. package/dist/cjs/index.cjs.map +1 -1
  10. package/dist/cjs/vanilla.cjs +1 -1
  11. package/dist/cjs/vanilla.cjs.map +1 -1
  12. package/dist/esm/IngestControllerV2-BaOxEiTq.js +5606 -0
  13. package/dist/esm/IngestControllerV2-BaOxEiTq.js.map +1 -0
  14. package/dist/esm/IngestControllerV2-DswB_ybx.js +5712 -0
  15. package/dist/esm/IngestControllerV2-DswB_ybx.js.map +1 -0
  16. package/dist/esm/IngestControllerV2-fiwB1xzE.js +5712 -0
  17. package/dist/esm/IngestControllerV2-fiwB1xzE.js.map +1 -0
  18. package/dist/esm/index.js +61 -6
  19. package/dist/esm/index.js.map +1 -1
  20. package/dist/esm/vanilla.js +1 -1
  21. package/dist/esm/vanilla.js.map +1 -1
  22. package/dist/types/core/EncoderManager.d.ts +6 -0
  23. package/dist/types/core/IngestControllerV2.d.ts +7 -0
  24. package/dist/types/core/SceneManager.d.ts +6 -0
  25. package/dist/types/core/WhipClient.d.ts +1 -0
  26. package/dist/types/core/renderers/Canvas2DRenderer.d.ts +1 -0
  27. package/dist/types/core/renderers/WebGLRenderer.d.ts +1 -0
  28. package/dist/types/core/renderers/WebGPURenderer.d.ts +3 -0
  29. package/dist/types/core/renderers/index.d.ts +5 -0
  30. package/dist/types/types.d.ts +5 -0
  31. package/dist/workers/compositor.worker.js +92 -5
  32. package/dist/workers/compositor.worker.js.map +1 -1
  33. package/dist/workers/encoder.worker.js +2 -2
  34. package/dist/workers/encoder.worker.js.map +1 -1
  35. package/package.json +1 -1
  36. package/src/core/EncoderManager.ts +63 -1
  37. package/src/core/IngestControllerV2.ts +114 -98
  38. package/src/core/SceneManager.ts +16 -3
  39. package/src/core/WhipClient.ts +26 -0
  40. package/src/core/renderers/WebGPURenderer.ts +1 -1
  41. package/src/vanilla/StreamCrafterV2.ts +0 -1
  42. package/src/workers/compositor.worker.ts +1 -2
  43. package/src/workers/encoder.worker.ts +2 -2
package/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # @livepeer-frameworks/streamcrafter-core
2
+
3
+ Framework-agnostic core for StreamCrafter: WHIP client, WebRTC transport, WebCodecs encoder, audio mixing, and compositor.
4
+
5
+ ## Documentation
6
+
7
+ Docs: https://docs.frameworks.network
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install @livepeer-frameworks/streamcrafter-core
13
+ ```
14
+
15
+ ## Usage (Vanilla)
16
+
17
+ ```ts
18
+ import { StreamCrafterV2 } from '@livepeer-frameworks/streamcrafter-core';
19
+ import '@livepeer-frameworks/streamcrafter-core/streamcrafter.css';
20
+
21
+ const crafter = new StreamCrafterV2({
22
+ whipUrl: 'https://ingest.example.com/webrtc/your-stream-key',
23
+ profile: 'broadcast',
24
+ });
25
+
26
+ await crafter.startCamera();
27
+ await crafter.startStreaming();
28
+
29
+ // Later
30
+ await crafter.stopStreaming();
31
+ crafter.destroy();
32
+ ```
33
+
34
+ ### Gateway Resolution (Advanced)
35
+
36
+ The vanilla `StreamCrafterV2` constructor requires a **direct WHIP URL**. If you want gateway resolution, use the `IngestClient` (or the React/Svelte wrappers).
37
+
38
+ ```ts
39
+ import { IngestClient, StreamCrafterV2 } from '@livepeer-frameworks/streamcrafter-core';
40
+
41
+ const ingest = new IngestClient({
42
+ gatewayUrl: 'https://api.example.com/graphql',
43
+ streamKey: 'sk_live_...',
44
+ });
45
+
46
+ const endpoints = await ingest.resolve();
47
+ const whipUrl = endpoints?.primary?.whipUrl;
48
+
49
+ if (!whipUrl) throw new Error('No WHIP URL resolved');
50
+
51
+ const crafter = new StreamCrafterV2({ whipUrl, profile: 'broadcast' });
52
+ ```
53
+
54
+ Notes:
55
+ - There is **no default gateway**; you must supply `whipUrl` or resolve it yourself.
56
+
57
+ ## Notes
58
+
59
+ - WebCodecs + Web Workers are used when available for background-safe encoding.
60
+ - For custom UIs, build on the core APIs or use the React/Svelte wrappers.
61
+ - CSS export: `@livepeer-frameworks/streamcrafter-core/streamcrafter.css`