janus-simple-videoroom-client 2.0.1 → 2.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.
- package/dist/index.d.ts +12 -2
- package/dist/index.js +2 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,16 @@ interface JanusPublishOptions {
|
|
|
33
33
|
description: string;
|
|
34
34
|
}[];
|
|
35
35
|
}
|
|
36
|
+
interface JanusPublisherConfigureOptions extends JanusPublishOptions {
|
|
37
|
+
keyframe?: boolean;
|
|
38
|
+
streams?: Array<{
|
|
39
|
+
mid: JanusMid;
|
|
40
|
+
keyframe?: boolean;
|
|
41
|
+
send?: boolean;
|
|
42
|
+
min_delay?: number;
|
|
43
|
+
max_delay?: number;
|
|
44
|
+
}>;
|
|
45
|
+
}
|
|
36
46
|
interface JanusSubscriberConfigureOptions {
|
|
37
47
|
mid?: JanusMid;
|
|
38
48
|
send?: boolean;
|
|
@@ -79,8 +89,8 @@ export interface VideoRoomPublisher {
|
|
|
79
89
|
publisherId: string | number;
|
|
80
90
|
onTrackAdded(callback: (track: MediaStreamTrack) => void): void;
|
|
81
91
|
onTrackRemoved(callback: (track: MediaStreamTrack) => void): void;
|
|
82
|
-
configure(configureOptions:
|
|
83
|
-
restart(mediaOptions?: JanusMediaOptions): Promise<void>;
|
|
92
|
+
configure(configureOptions: JanusPublisherConfigureOptions): Promise<void>;
|
|
93
|
+
restart(mediaOptions?: JanusMediaOptions, publishOptions?: JanusPublishOptions): Promise<void>;
|
|
84
94
|
unpublish(): Promise<void>;
|
|
85
95
|
}
|
|
86
96
|
export interface VideoRoomSubscriber {
|
package/dist/index.js
CHANGED
|
@@ -344,15 +344,13 @@ function createVideoRoomPublisher(handle, publisherId, opts) {
|
|
|
344
344
|
});
|
|
345
345
|
});
|
|
346
346
|
},
|
|
347
|
-
restart(mediaOptions = options.mediaOptions) {
|
|
347
|
+
restart(mediaOptions = options.mediaOptions, publishOptions) {
|
|
348
348
|
return __awaiter(this, void 0, void 0, function* () {
|
|
349
349
|
const offerJsep = yield new Promise(function (fulfill, reject) {
|
|
350
350
|
handle.createOffer(Object.assign(Object.assign({}, mediaOptions), { success: fulfill, error: reject }));
|
|
351
351
|
});
|
|
352
352
|
const response = yield handle.sendAsyncRequest({
|
|
353
|
-
message: {
|
|
354
|
-
request: "configure",
|
|
355
|
-
},
|
|
353
|
+
message: Object.assign(Object.assign({}, publishOptions), { request: "configure" }),
|
|
356
354
|
jsep: offerJsep,
|
|
357
355
|
expectResponse: r => r.message.videoroom == "event" && r.message.configured == "ok"
|
|
358
356
|
});
|
package/package.json
CHANGED