@fastpix/fastpix-node 2.0.0 → 2.0.2

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 (40) hide show
  1. package/README.md +219 -167
  2. package/dist/commonjs/funcs/signingKeysGetSigningKeyById.d.ts +2 -2
  3. package/dist/commonjs/funcs/signingKeysGetSigningKeyById.js +2 -2
  4. package/dist/commonjs/models/operations/getdrmconfiguration.d.ts +2 -2
  5. package/dist/commonjs/models/operations/getdrmconfiguration.d.ts.map +1 -1
  6. package/dist/commonjs/models/operations/getdrmconfiguration.js +2 -2
  7. package/dist/commonjs/models/operations/getdrmconfiguration.js.map +1 -1
  8. package/dist/commonjs/sdk/signingkeys.d.ts +2 -2
  9. package/dist/commonjs/sdk/signingkeys.js +2 -2
  10. package/dist/esm/funcs/signingKeysGetSigningKeyById.d.ts +2 -2
  11. package/dist/esm/funcs/signingKeysGetSigningKeyById.js +2 -2
  12. package/dist/esm/models/operations/getdrmconfiguration.d.ts +2 -2
  13. package/dist/esm/models/operations/getdrmconfiguration.d.ts.map +1 -1
  14. package/dist/esm/models/operations/getdrmconfiguration.js +2 -2
  15. package/dist/esm/models/operations/getdrmconfiguration.js.map +1 -1
  16. package/dist/esm/sdk/signingkeys.d.ts +2 -2
  17. package/dist/esm/sdk/signingkeys.js +2 -2
  18. package/package.json +24 -1
  19. package/samples/ai/ai-features.ts +194 -0
  20. package/samples/analytics/dimensions.ts +113 -0
  21. package/samples/analytics/errors.ts +133 -0
  22. package/samples/analytics/metrics.ts +117 -0
  23. package/samples/analytics/views.ts +120 -0
  24. package/samples/common/config.ts +84 -0
  25. package/samples/common/setup.ts +42 -0
  26. package/samples/comprehensive-example.ts +267 -0
  27. package/samples/index.ts +224 -0
  28. package/samples/live/live-playback.ts +104 -0
  29. package/samples/live/manage-live-stream.ts +176 -0
  30. package/samples/live/start-live-stream.ts +91 -0
  31. package/samples/media/input-video.ts +65 -0
  32. package/samples/media/manage-videos.ts +166 -0
  33. package/samples/media/playback.ts +89 -0
  34. package/samples/media/playlist.ts +201 -0
  35. package/samples/package.json +51 -0
  36. package/samples/security/drm-configurations.ts +125 -0
  37. package/samples/security/signing-keys.ts +154 -0
  38. package/src/funcs/signingKeysGetSigningKeyById.ts +2 -2
  39. package/src/models/operations/getdrmconfiguration.ts +4 -4
  40. package/src/sdk/signingkeys.ts +2 -2
@@ -0,0 +1,224 @@
1
+ /**
2
+ * FastPix Node.js SDK Samples Index
3
+ *
4
+ * This file provides an overview of all available samples and can be used
5
+ * to run multiple samples or get a quick reference of what's available.
6
+ *
7
+ * Run this file to see all available samples:
8
+ * npx tsx index.ts
9
+ */
10
+
11
+ import { createFastpixClient } from "./common/setup.js";
12
+
13
+ // Sample categories and their descriptions
14
+ const sampleCategories = {
15
+ media: {
16
+ name: "Media API Samples",
17
+ description: "Upload, manage, and transform video content",
18
+ samples: [
19
+ {
20
+ file: "media/input-video.ts",
21
+ name: "Input Video",
22
+ description: "Create media from URL and upload from device"
23
+ },
24
+ {
25
+ file: "media/manage-videos.ts",
26
+ name: "Manage Videos",
27
+ description: "List, update, delete, and manage video tracks"
28
+ },
29
+ {
30
+ file: "media/playback.ts",
31
+ name: "Playback",
32
+ description: "Create and manage playback IDs for secure access"
33
+ },
34
+ {
35
+ file: "media/playlist.ts",
36
+ name: "Playlist",
37
+ description: "Create and manage video playlists"
38
+ }
39
+ ]
40
+ },
41
+ live: {
42
+ name: "Live Streaming Samples",
43
+ description: "Stream, manage, and transform live video content",
44
+ samples: [
45
+ {
46
+ file: "live/start-live-stream.ts",
47
+ name: "Start Live Stream",
48
+ description: "Create new live streaming sessions"
49
+ },
50
+ {
51
+ file: "live/manage-live-stream.ts",
52
+ name: "Manage Live Stream",
53
+ description: "Manage active live streams and viewer statistics"
54
+ },
55
+ {
56
+ file: "live/live-playback.ts",
57
+ name: "Live Playback",
58
+ description: "Create and manage live playback access"
59
+ }
60
+ ]
61
+ },
62
+ analytics: {
63
+ name: "Analytics Samples",
64
+ description: "Monitor video performance and quality with comprehensive analytics",
65
+ samples: [
66
+ {
67
+ file: "analytics/views.ts",
68
+ name: "Views",
69
+ description: "Analyze video views and viewer behavior"
70
+ },
71
+ {
72
+ file: "analytics/metrics.ts",
73
+ name: "Metrics",
74
+ description: "Get performance metrics and breakdowns"
75
+ },
76
+ {
77
+ file: "analytics/dimensions.ts",
78
+ name: "Dimensions",
79
+ description: "Explore data dimensions and filter values"
80
+ },
81
+ {
82
+ file: "analytics/errors.ts",
83
+ name: "Errors",
84
+ description: "Track and analyze playback errors"
85
+ }
86
+ ]
87
+ },
88
+ ai: {
89
+ name: "AI Features Samples",
90
+ description: "Enhance video content with AI-powered features",
91
+ samples: [
92
+ {
93
+ file: "ai/ai-features.ts",
94
+ name: "AI Features",
95
+ description: "Generate summaries, chapters, entities, and moderation"
96
+ }
97
+ ]
98
+ },
99
+ security: {
100
+ name: "Security Samples",
101
+ description: "Manage security and authentication",
102
+ samples: [
103
+ {
104
+ file: "security/signing-keys.ts",
105
+ name: "Signing Keys",
106
+ description: "Create and manage signing key pairs for authentication"
107
+ },
108
+ {
109
+ file: "security/drm-configurations.ts",
110
+ name: "DRM Configurations",
111
+ description: "Manage DRM settings and configurations"
112
+ }
113
+ ]
114
+ }
115
+ };
116
+
117
+ function displaySampleIndex() {
118
+ console.log("šŸ“š FastPix Node.js SDK Samples");
119
+ console.log("===============================");
120
+ console.log("Comprehensive examples demonstrating FastPix API usage\n");
121
+
122
+ Object.entries(sampleCategories).forEach(([categoryKey, category]) => {
123
+ console.log(`šŸ“ ${category.name}`);
124
+ console.log(` ${category.description}\n`);
125
+
126
+ category.samples.forEach(sample => {
127
+ console.log(` šŸ“„ ${sample.name}`);
128
+ console.log(` File: ${sample.file}`);
129
+ console.log(` Description: ${sample.description}`);
130
+ console.log(` Run: npx tsx ${sample.file}\n`);
131
+ });
132
+ });
133
+
134
+ console.log("šŸš€ Quick Start Commands:");
135
+ console.log("========================");
136
+ console.log("npm run media # Run all media samples");
137
+ console.log("npm run live # Run all live streaming samples");
138
+ console.log("npm run analytics # Run all analytics samples");
139
+ console.log("npm run ai # Run AI features samples");
140
+ console.log("npm run security # Run security samples");
141
+ console.log("npm run all # Run all samples");
142
+ console.log("\nšŸ“– For detailed instructions, see README.md");
143
+ }
144
+
145
+ function displayQuickReference() {
146
+ console.log("\nšŸ”§ Quick Reference");
147
+ console.log("==================");
148
+ console.log("Common operations you can perform:\n");
149
+
150
+ console.log("šŸ“¹ Media Management:");
151
+ console.log(" • Upload videos from URL or device");
152
+ console.log(" • List, update, and delete media");
153
+ console.log(" • Add audio/subtitle tracks");
154
+ console.log(" • Generate automatic subtitles");
155
+ console.log(" • Create and manage playlists");
156
+ console.log(" • Generate secure playback IDs\n");
157
+
158
+ console.log("šŸ”“ Live Streaming:");
159
+ console.log(" • Create live streams (RTMPS/SRT)");
160
+ console.log(" • Manage stream settings and privacy");
161
+ console.log(" • Enable/disable streams");
162
+ console.log(" • Monitor viewer counts");
163
+ console.log(" • Create live playback access\n");
164
+
165
+ console.log("šŸ“Š Analytics:");
166
+ console.log(" • Track video views and engagement");
167
+ console.log(" • Analyze performance metrics");
168
+ console.log(" • Monitor concurrent viewers");
169
+ console.log(" • Track playback errors");
170
+ console.log(" • Filter data by dimensions\n");
171
+
172
+ console.log("šŸ¤– AI Features:");
173
+ console.log(" • Generate video summaries");
174
+ console.log(" • Create automatic chapters");
175
+ console.log(" • Extract named entities");
176
+ console.log(" • Enable content moderation\n");
177
+
178
+ console.log("šŸ” Security:");
179
+ console.log(" • Create signing key pairs");
180
+ console.log(" • Manage DRM configurations");
181
+ console.log(" • Secure token-based authentication\n");
182
+ }
183
+
184
+ async function testConnection() {
185
+ console.log("\nšŸ”Œ Testing FastPix Connection");
186
+ console.log("=============================");
187
+
188
+ try {
189
+ const fastpix = createFastpixClient();
190
+
191
+ // Test with a simple API call
192
+ const dimensions = await fastpix.dimensions.listDimensions();
193
+ console.log("āœ… Connection successful!");
194
+ console.log(`šŸ“Š Found ${dimensions.listDimensionsSuccessResponse?.data?.dimensions?.length || 0} available dimensions`);
195
+
196
+ return true;
197
+ } catch (error) {
198
+ console.log("āŒ Connection failed!");
199
+ console.log("Please check your credentials in the .env file");
200
+ console.log("Error:", error.message || error);
201
+
202
+ return false;
203
+ }
204
+ }
205
+
206
+ async function main() {
207
+ displaySampleIndex();
208
+ displayQuickReference();
209
+
210
+ const connected = await testConnection();
211
+
212
+ if (connected) {
213
+ console.log("\nšŸŽ‰ You're ready to start using the FastPix SDK samples!");
214
+ console.log("Choose a sample from the list above and run it with:");
215
+ console.log("npx tsx <sample-file>");
216
+ } else {
217
+ console.log("\nāš ļø Please configure your credentials before running samples");
218
+ console.log("1. Copy env.example to .env");
219
+ console.log("2. Add your FastPix credentials");
220
+ console.log("3. Run this file again to test the connection");
221
+ }
222
+ }
223
+
224
+ main().catch(console.error);
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Live Playback API Samples
3
+ *
4
+ * This file demonstrates how to use the Live Playback API to:
5
+ * - Create playback IDs for live streams
6
+ * - Get live playback ID details
7
+ * - Delete live playback IDs
8
+ *
9
+ * Run this sample:
10
+ * npx tsx live/live-playback.ts
11
+ */
12
+
13
+ import { createFastpixClient, runSample } from "../common/setup.js";
14
+ import { logResponse } from "../common/config.js";
15
+
16
+ let streamId: string | undefined;
17
+ let createdPlaybackId: string | undefined;
18
+
19
+ async function getStreamForPlayback() {
20
+ const fastpix = createFastpixClient();
21
+
22
+ // First, get a stream to create playback ID for
23
+ const streams = await fastpix.manageLiveStream.getAllStreams({ limit: 1 });
24
+ const stream = streams.getAllStreamsSuccessResponse?.data?.streams?.[0];
25
+
26
+ if (!stream?.id) {
27
+ console.log("āš ļø No streams found. Please create a stream first using start-live-stream.ts");
28
+ return;
29
+ }
30
+
31
+ streamId = stream.id;
32
+ console.log(`šŸ“ŗ Using stream ID: ${streamId}`);
33
+ return stream;
34
+ }
35
+
36
+ async function createPlaybackIdOfStream() {
37
+ if (!streamId) {
38
+ console.log("āš ļø No stream ID available. Run getStreamForPlayback first.");
39
+ return;
40
+ }
41
+
42
+ const fastpix = createFastpixClient();
43
+
44
+ const result = await fastpix.livePlayback.createPlaybackIdOfStream({
45
+ streamId: streamId,
46
+ requestBody: {
47
+ policy: "public",
48
+ },
49
+ });
50
+
51
+ if (result.createPlaybackIdOfStreamSuccessResponse?.data?.id) {
52
+ createdPlaybackId = result.createPlaybackIdOfStreamSuccessResponse.data.id;
53
+ }
54
+
55
+ logResponse("Create Playback ID of Stream", result);
56
+ return result;
57
+ }
58
+
59
+ async function getLiveStreamPlaybackId() {
60
+ if (!createdPlaybackId) {
61
+ console.log("āš ļø No playback ID available. Run createPlaybackIdOfStream first.");
62
+ return;
63
+ }
64
+
65
+ const fastpix = createFastpixClient();
66
+
67
+ const result = await fastpix.livePlayback.getLiveStreamPlaybackId({
68
+ playbackId: createdPlaybackId,
69
+ });
70
+
71
+ logResponse("Get Live Stream Playback ID", result);
72
+ return result;
73
+ }
74
+
75
+ async function deletePlaybackIdOfStream() {
76
+ if (!createdPlaybackId) {
77
+ console.log("āš ļø No playback ID available. Run createPlaybackIdOfStream first.");
78
+ return;
79
+ }
80
+
81
+ const fastpix = createFastpixClient();
82
+
83
+ const result = await fastpix.livePlayback.deletePlaybackIdOfStream({
84
+ playbackId: createdPlaybackId,
85
+ });
86
+
87
+ logResponse("Delete Playback ID of Stream", result);
88
+ createdPlaybackId = undefined; // Reset the ID since playback ID is deleted
89
+ return result;
90
+ }
91
+
92
+ async function main() {
93
+ console.log("ā–¶ļø Live Playback API Samples");
94
+ console.log("=============================");
95
+
96
+ await runSample("Get Stream for Playback", getStreamForPlayback);
97
+ await runSample("Create Playback ID of Stream", createPlaybackIdOfStream);
98
+ await runSample("Get Live Stream Playback ID", getLiveStreamPlaybackId);
99
+
100
+ // Uncomment to delete the playback ID
101
+ // await runSample("Delete Playback ID of Stream", deletePlaybackIdOfStream);
102
+ }
103
+
104
+ main().catch(console.error);
@@ -0,0 +1,176 @@
1
+ /**
2
+ * Manage Live Stream API Samples
3
+ *
4
+ * This file demonstrates how to use the Manage Live Stream API to:
5
+ * - List all streams
6
+ * - Get stream by ID
7
+ * - Update stream settings
8
+ * - Enable/disable streams
9
+ * - Get viewer count
10
+ * - Complete streams
11
+ * - Delete streams
12
+ *
13
+ * Run this sample:
14
+ * npx tsx live/manage-live-stream.ts
15
+ */
16
+
17
+ import { createFastpixClient, runSample } from "../common/setup.js";
18
+ import { config, logResponse } from "../common/config.js";
19
+
20
+ let streamId: string | undefined;
21
+
22
+ async function listAllStreams() {
23
+ const fastpix = createFastpixClient();
24
+
25
+ const result = await fastpix.manageLiveStream.getAllStreams({
26
+ limit: 10,
27
+ offset: 0,
28
+ });
29
+
30
+ logResponse("List All Streams", result);
31
+
32
+ // Store the first stream ID for other operations
33
+ if (result.getAllStreamsSuccessResponse?.data?.streams?.[0]?.id) {
34
+ streamId = result.getAllStreamsSuccessResponse.data.streams[0].id;
35
+ }
36
+
37
+ return result;
38
+ }
39
+
40
+ async function getStreamById() {
41
+ if (!streamId) {
42
+ console.log("āš ļø No stream ID available. Run listAllStreams first.");
43
+ return;
44
+ }
45
+
46
+ const fastpix = createFastpixClient();
47
+
48
+ const result = await fastpix.manageLiveStream.getLiveStreamById({
49
+ streamId: streamId,
50
+ });
51
+
52
+ logResponse("Get Stream by ID", result);
53
+ return result;
54
+ }
55
+
56
+ async function updateStream() {
57
+ if (!streamId) {
58
+ console.log("āš ļø No stream ID available. Run listAllStreams first.");
59
+ return;
60
+ }
61
+
62
+ const fastpix = createFastpixClient();
63
+
64
+ const result = await fastpix.manageLiveStream.updateLiveStream({
65
+ streamId: streamId,
66
+ requestBody: {
67
+ metadata: {
68
+ name: "Updated Stream Name",
69
+ description: "This stream has been updated via SDK",
70
+ },
71
+ reconnectWindow: 60,
72
+ },
73
+ });
74
+
75
+ logResponse("Update Stream", result);
76
+ return result;
77
+ }
78
+
79
+ async function enableStream() {
80
+ if (!streamId) {
81
+ console.log("āš ļø No stream ID available. Run listAllStreams first.");
82
+ return;
83
+ }
84
+
85
+ const fastpix = createFastpixClient();
86
+
87
+ const result = await fastpix.manageLiveStream.enableLiveStream({
88
+ streamId: streamId,
89
+ });
90
+
91
+ logResponse("Enable Stream", result);
92
+ return result;
93
+ }
94
+
95
+ async function disableStream() {
96
+ if (!streamId) {
97
+ console.log("āš ļø No stream ID available. Run listAllStreams first.");
98
+ return;
99
+ }
100
+
101
+ const fastpix = createFastpixClient();
102
+
103
+ const result = await fastpix.manageLiveStream.disableLiveStream({
104
+ streamId: streamId,
105
+ });
106
+
107
+ logResponse("Disable Stream", result);
108
+ return result;
109
+ }
110
+
111
+ async function getViewerCount() {
112
+ if (!streamId) {
113
+ console.log("āš ļø No stream ID available. Run listAllStreams first.");
114
+ return;
115
+ }
116
+
117
+ const fastpix = createFastpixClient();
118
+
119
+ const result = await fastpix.manageLiveStream.getLiveStreamViewerCountById({
120
+ streamId: streamId,
121
+ });
122
+
123
+ logResponse("Get Viewer Count", result);
124
+ return result;
125
+ }
126
+
127
+ async function completeStream() {
128
+ if (!streamId) {
129
+ console.log("āš ļø No stream ID available. Run listAllStreams first.");
130
+ return;
131
+ }
132
+
133
+ const fastpix = createFastpixClient();
134
+
135
+ const result = await fastpix.manageLiveStream.completeLiveStream({
136
+ streamId: streamId,
137
+ });
138
+
139
+ logResponse("Complete Stream", result);
140
+ return result;
141
+ }
142
+
143
+ async function deleteStream() {
144
+ if (!streamId) {
145
+ console.log("āš ļø No stream ID available. Run listAllStreams first.");
146
+ return;
147
+ }
148
+
149
+ const fastpix = createFastpixClient();
150
+
151
+ const result = await fastpix.manageLiveStream.deleteLiveStream({
152
+ streamId: streamId,
153
+ });
154
+
155
+ logResponse("Delete Stream", result);
156
+ streamId = undefined; // Reset the ID since stream is deleted
157
+ return result;
158
+ }
159
+
160
+ async function main() {
161
+ console.log("šŸ“ŗ Manage Live Stream API Samples");
162
+ console.log("==================================");
163
+
164
+ await runSample("List All Streams", listAllStreams);
165
+ await runSample("Get Stream by ID", getStreamById);
166
+ await runSample("Update Stream", updateStream);
167
+ await runSample("Enable Stream", enableStream);
168
+ await runSample("Get Viewer Count", getViewerCount);
169
+ await runSample("Disable Stream", disableStream);
170
+
171
+ // Uncomment to complete or delete the stream (be careful!)
172
+ // await runSample("Complete Stream", completeStream);
173
+ // await runSample("Delete Stream", deleteStream);
174
+ }
175
+
176
+ main().catch(console.error);
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Start Live Stream API Samples
3
+ *
4
+ * This file demonstrates how to use the Start Live Stream API to:
5
+ * - Create new live streams
6
+ * - Configure stream settings
7
+ *
8
+ * Run this sample:
9
+ * npx tsx live/start-live-stream.ts
10
+ */
11
+
12
+ import { createFastpixClient, runSample } from "../common/setup.js";
13
+ import { config, logResponse } from "../common/config.js";
14
+
15
+ let createdStreamId: string | undefined;
16
+
17
+ async function createNewStream() {
18
+ const fastpix = createFastpixClient();
19
+
20
+ const result = await fastpix.startLiveStream.createNewStream({
21
+ requestBody: {
22
+ metadata: {
23
+ name: config.sampleStreamName,
24
+ description: config.sampleStreamDescription,
25
+ },
26
+ reconnectWindow: 30, // 30 seconds
27
+ privacy: "public",
28
+ },
29
+ });
30
+
31
+ if (result.data?.id) {
32
+ createdStreamId = result.data.id;
33
+ }
34
+
35
+ logResponse("Create New Stream", result);
36
+ return result;
37
+ }
38
+
39
+ async function createPrivateStream() {
40
+ const fastpix = createFastpixClient();
41
+
42
+ const result = await fastpix.startLiveStream.createNewStream({
43
+ requestBody: {
44
+ metadata: {
45
+ name: "Private Sample Stream",
46
+ description: "A private stream created via SDK",
47
+ },
48
+ reconnectWindow: 60, // 60 seconds
49
+ privacy: "private",
50
+ },
51
+ });
52
+
53
+ logResponse("Create Private Stream", result);
54
+ return result;
55
+ }
56
+
57
+ async function createStreamWithCustomSettings() {
58
+ const fastpix = createFastpixClient();
59
+
60
+ const result = await fastpix.startLiveStream.createNewStream({
61
+ requestBody: {
62
+ metadata: {
63
+ name: "Custom Settings Stream",
64
+ description: "A stream with custom settings",
65
+ category: "gaming",
66
+ tags: ["live", "demo", "sdk"],
67
+ },
68
+ reconnectWindow: 45, // 45 seconds
69
+ privacy: "public",
70
+ },
71
+ });
72
+
73
+ logResponse("Create Stream with Custom Settings", result);
74
+ return result;
75
+ }
76
+
77
+ async function main() {
78
+ console.log("šŸ”“ Start Live Stream API Samples");
79
+ console.log("=================================");
80
+
81
+ await runSample("Create New Stream", createNewStream);
82
+ await runSample("Create Private Stream", createPrivateStream);
83
+ await runSample("Create Stream with Custom Settings", createStreamWithCustomSettings);
84
+
85
+ if (createdStreamId) {
86
+ console.log(`\nšŸ“ Created stream ID: ${createdStreamId}`);
87
+ console.log(" You can use this ID with the manage-live-stream.ts sample");
88
+ }
89
+ }
90
+
91
+ main().catch(console.error);
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Input Video API Samples
3
+ *
4
+ * This file demonstrates how to use the Input Video API to:
5
+ * - Create media from URL
6
+ * - Upload media from device
7
+ *
8
+ * Run this sample:
9
+ * npx tsx media/input-video.ts
10
+ */
11
+
12
+ import { createFastpixClient, runSample } from "../common/setup.js";
13
+ import { config, logResponse, logError } from "../common/config.js";
14
+
15
+ async function createMediaFromUrl() {
16
+ const fastpix = createFastpixClient();
17
+
18
+ const result = await fastpix.inputVideo.createMedia({
19
+ inputs: [
20
+ {
21
+ type: "video",
22
+ url: config.sampleVideoUrl,
23
+ },
24
+ ],
25
+ metadata: {
26
+ title: "Sample Video from URL",
27
+ description: "This video was created using the FastPix SDK",
28
+ category: "sample",
29
+ },
30
+ accessPolicy: "public",
31
+ });
32
+
33
+ logResponse("Create Media from URL", result);
34
+ return result;
35
+ }
36
+
37
+ async function uploadMediaFromDevice() {
38
+ const fastpix = createFastpixClient();
39
+
40
+ // Note: This example shows the structure, but you'll need an actual file
41
+ // In a real application, you'd get the file from a file input or file system
42
+ const result = await fastpix.inputVideo.directUploadVideoMedia({
43
+ file: new Blob(["sample video content"], { type: "video/mp4" }),
44
+ metadata: {
45
+ title: "Sample Uploaded Video",
46
+ description: "This video was uploaded directly from device",
47
+ },
48
+ accessPolicy: "public",
49
+ });
50
+
51
+ logResponse("Upload Media from Device", result);
52
+ return result;
53
+ }
54
+
55
+ async function main() {
56
+ console.log("šŸ“¹ Input Video API Samples");
57
+ console.log("==========================");
58
+
59
+ await runSample("Create Media from URL", createMediaFromUrl);
60
+
61
+ // Uncomment to test direct upload (requires actual file)
62
+ // await runSample("Upload Media from Device", uploadMediaFromDevice);
63
+ }
64
+
65
+ main().catch(console.error);