@streaming-cdn/rtc-web 1.3.12 → 1.3.14
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/LICENSE.txt +15 -0
- package/NOTICE.md +8 -0
- package/README.md +52 -9
- package/dist/active-speaker.d.ts +25 -0
- package/dist/index.d.ts +341 -0
- package/dist/native-room.d.ts +104 -0
- package/dist/peer-quality.d.ts +80 -0
- package/dist/picture-in-picture.d.ts +40 -0
- package/dist/rtc-web.es.js +1802 -0
- package/dist/rtc-web.umd.js +1 -0
- package/dist/sfu-room.d.ts +96 -0
- package/package.json +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser picture-in-picture for a call.
|
|
3
|
+
*
|
|
4
|
+
* The familiar shape: the call keeps playing in a small always-on-top window
|
|
5
|
+
* while the user works in another tab or application. This controller owns a
|
|
6
|
+
* hidden video element, feeds it the chosen participant's stream (or the
|
|
7
|
+
* local preview as a fallback), and drives the browser's PiP API. Browsers
|
|
8
|
+
* only honour `requestPictureInPicture` from a user gesture, so `enter()`
|
|
9
|
+
* belongs in a click handler; calling it elsewhere reports the browser's
|
|
10
|
+
* refusal rather than pretending.
|
|
11
|
+
*/
|
|
12
|
+
export interface RtcRemoteStreamSource {
|
|
13
|
+
getRemoteStreams(): Array<{
|
|
14
|
+
participant: {
|
|
15
|
+
participantId: string;
|
|
16
|
+
};
|
|
17
|
+
stream: MediaStream;
|
|
18
|
+
}>;
|
|
19
|
+
getLocalStream(): MediaStream | null;
|
|
20
|
+
}
|
|
21
|
+
export interface PictureInPictureOptions {
|
|
22
|
+
/** Called when the browser closes the floating window. */
|
|
23
|
+
onLeave?: () => void;
|
|
24
|
+
/** Test seam; defaults to globalThis.document. */
|
|
25
|
+
document?: Document;
|
|
26
|
+
}
|
|
27
|
+
export interface PictureInPictureController {
|
|
28
|
+
/** Whether this browser can do picture-in-picture at all. */
|
|
29
|
+
readonly supported: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Opens the floating window with the given participant's video, the first
|
|
32
|
+
* remote participant when omitted, or the local preview when nobody else
|
|
33
|
+
* has video yet. Must be called from a user gesture.
|
|
34
|
+
*/
|
|
35
|
+
enter(participantId?: string): Promise<void>;
|
|
36
|
+
exit(): Promise<void>;
|
|
37
|
+
/** Releases the hidden video element and listeners. */
|
|
38
|
+
dispose(): void;
|
|
39
|
+
}
|
|
40
|
+
export declare function createPictureInPictureController(client: RtcRemoteStreamSource, options?: PictureInPictureOptions): PictureInPictureController;
|