@volorio/media-services 0.2.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.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # @volorio/media-services
2
+
3
+ Server-side helpers for Volorio media service products.
4
+
5
+ ```ts
6
+ import { VolorioMediaServicesClient } from "@volorio/media-services";
7
+
8
+ const media = new VolorioMediaServicesClient({
9
+ apiBaseUrl: "https://api.volorio.com",
10
+ apiKey: process.env.VOLORIO_SERVER_API_KEY!,
11
+ });
12
+
13
+ await media.cloudTranscodings.start({
14
+ roomId: "room_123",
15
+ outputUrl: "rtmp://cdn.example.com/live/stream",
16
+ quality: "fullhd",
17
+ layout: "grid",
18
+ });
19
+
20
+ await media.mediaPushes.start({
21
+ roomId: "room_123",
22
+ outputUrl: "rtmp://cdn.example.com/live/stream",
23
+ quality: "hd",
24
+ layout: "speaker",
25
+ });
26
+
27
+ await media.mediaPulls.start({
28
+ roomId: "room_123",
29
+ sourceUrl: "https://cdn.example.com/live/source.m3u8",
30
+ participantIdentity: "remote_stage",
31
+ });
32
+ ```
33
+
34
+ API keys must stay on your backend. Do not ship server API keys to browser or mobile apps.
@@ -0,0 +1,36 @@
1
+ import { VolorioServerClient, type StartCloudTranscodingInput, type StartMediaPushInput, type StartMediaPullInput, type StartMediaGatewayInput, type StartRecordingInput, type VolorioCloudTranscoding, type VolorioCloudTranscodingOperation, type VolorioMediaGateway, type VolorioMediaGatewayOperation, type VolorioMediaPush, type VolorioMediaPushOperation, type VolorioMediaPull, type VolorioMediaPullOperation, type VolorioMediaServiceOperation, type VolorioRecording, type VolorioRecordingOperation, type VolorioServerClientOptions, type ReconcileMediaServiceOperationInput } from "@volorio/server";
2
+ type VolorioMediaServicesServerClient = Pick<VolorioServerClient, "startRecording" | "stopRecording" | "startMediaGateway" | "stopMediaGateway" | "startCloudTranscoding" | "stopCloudTranscoding" | "startMediaPush" | "stopMediaPush" | "startMediaPull" | "stopMediaPull" | "getMediaServiceOperation" | "reconcileMediaServiceOperation">;
3
+ export type VolorioMediaServicesClientOptions = (VolorioServerClientOptions & {
4
+ serverClient?: undefined;
5
+ }) | {
6
+ serverClient: VolorioMediaServicesServerClient;
7
+ };
8
+ export declare class VolorioMediaServicesClient {
9
+ private readonly serverClient;
10
+ readonly recordings: {
11
+ start: (input: StartRecordingInput) => Promise<VolorioRecordingOperation>;
12
+ stop: (recordingId: string) => Promise<VolorioRecording>;
13
+ };
14
+ readonly mediaGateways: {
15
+ start: (input: StartMediaGatewayInput) => Promise<VolorioMediaGatewayOperation>;
16
+ stop: (gatewayId: string) => Promise<VolorioMediaGateway>;
17
+ };
18
+ readonly cloudTranscodings: {
19
+ start: (input: StartCloudTranscodingInput) => Promise<VolorioCloudTranscodingOperation>;
20
+ stop: (transcodingId: string) => Promise<VolorioCloudTranscoding>;
21
+ };
22
+ readonly mediaPushes: {
23
+ start: (input: StartMediaPushInput) => Promise<VolorioMediaPushOperation>;
24
+ stop: (pushId: string) => Promise<VolorioMediaPush>;
25
+ };
26
+ readonly mediaPulls: {
27
+ start: (input: StartMediaPullInput) => Promise<VolorioMediaPullOperation>;
28
+ stop: (pullId: string) => Promise<VolorioMediaPull>;
29
+ };
30
+ readonly operations: {
31
+ get: (operationId: string) => Promise<VolorioMediaServiceOperation>;
32
+ reconcile: (input: ReconcileMediaServiceOperationInput) => Promise<VolorioMediaServiceOperation>;
33
+ };
34
+ constructor(options: VolorioMediaServicesClientOptions);
35
+ }
36
+ export type { StartCloudTranscodingInput, StartMediaPushInput, StartMediaPullInput, StartMediaGatewayInput, StartRecordingInput, VolorioCloudTranscoding, VolorioCloudTranscodingOperation, VolorioMediaGateway, VolorioMediaGatewayOperation, VolorioMediaPush, VolorioMediaPushOperation, VolorioMediaPull, VolorioMediaPullOperation, VolorioMediaServiceOperation, VolorioRecording, VolorioRecordingOperation, ReconcileMediaServiceOperationInput, };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VolorioMediaServicesClient = void 0;
4
+ const server_1 = require("@volorio/server");
5
+ class VolorioMediaServicesClient {
6
+ serverClient;
7
+ recordings;
8
+ mediaGateways;
9
+ cloudTranscodings;
10
+ mediaPushes;
11
+ mediaPulls;
12
+ operations;
13
+ constructor(options) {
14
+ this.serverClient =
15
+ "serverClient" in options && options.serverClient
16
+ ? options.serverClient
17
+ : new server_1.VolorioServerClient(options);
18
+ this.recordings = {
19
+ start: (input) => this.serverClient.startRecording(input),
20
+ stop: (recordingId) => this.serverClient.stopRecording(recordingId),
21
+ };
22
+ this.mediaGateways = {
23
+ start: (input) => this.serverClient.startMediaGateway(input),
24
+ stop: (gatewayId) => this.serverClient.stopMediaGateway(gatewayId),
25
+ };
26
+ this.cloudTranscodings = {
27
+ start: (input) => this.serverClient.startCloudTranscoding(input),
28
+ stop: (transcodingId) => this.serverClient.stopCloudTranscoding(transcodingId),
29
+ };
30
+ this.mediaPushes = {
31
+ start: (input) => this.serverClient.startMediaPush(input),
32
+ stop: (pushId) => this.serverClient.stopMediaPush(pushId),
33
+ };
34
+ this.mediaPulls = {
35
+ start: (input) => this.serverClient.startMediaPull(input),
36
+ stop: (pullId) => this.serverClient.stopMediaPull(pullId),
37
+ };
38
+ this.operations = {
39
+ get: (operationId) => this.serverClient.getMediaServiceOperation(operationId),
40
+ reconcile: (input) => this.serverClient.reconcileMediaServiceOperation(input),
41
+ };
42
+ }
43
+ }
44
+ exports.VolorioMediaServicesClient = VolorioMediaServicesClient;
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,4CAoByB;AAsBzB,MAAa,0BAA0B;IACpB,YAAY,CAAmC;IAEvD,UAAU,CAGjB;IAEO,aAAa,CAGpB;IAEO,iBAAiB,CAGxB;IAEO,WAAW,CAGlB;IAEO,UAAU,CAGjB;IAEO,UAAU,CAGjB;IAE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C,cAAc,CAAC,KAAK,CAAC;YACzD,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,MAAM,CAAC;SAC1D,CAAC;QACF,IAAI,CAAC,UAAU,GAAG;YAChB,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,wBAAwB,CAAC,WAAW,CAAC;YAC7E,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,8BAA8B,CAAC,KAAK,CAAC;SAC9E,CAAC;IACJ,CAAC;CACF;AA/DD,gEA+DC"}
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@volorio/media-services",
3
+ "version": "0.2.0",
4
+ "private": false,
5
+ "description": "Server-side Volorio media service product helpers for recording, media gateway, cloud transcoding, media push, and media pull.",
6
+ "main": "dist/src/index.js",
7
+ "types": "dist/src/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/src/index.d.ts",
11
+ "default": "./dist/src/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist/src",
16
+ "README.md"
17
+ ],
18
+ "publishConfig": {
19
+ "access": "public",
20
+ "registry": "https://registry.npmjs.org/"
21
+ },
22
+ "scripts": {
23
+ "build": "tsc -p tsconfig.build.json",
24
+ "test": "tsc -p tsconfig.json && node --test dist/test/*.spec.js",
25
+ "pack:local": "pnpm build && npm pack --pack-destination dist"
26
+ },
27
+ "dependencies": {
28
+ "@volorio/server": "^0.2.0"
29
+ }
30
+ }