livekit-client 0.15.3 → 0.16.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 (90) hide show
  1. package/dist/api/SignalClient.d.ts +6 -3
  2. package/dist/api/SignalClient.js +70 -28
  3. package/dist/api/SignalClient.js.map +1 -1
  4. package/dist/options.d.ts +5 -0
  5. package/dist/proto/livekit_models.d.ts +30 -0
  6. package/dist/proto/livekit_models.js +219 -1
  7. package/dist/proto/livekit_models.js.map +1 -1
  8. package/dist/proto/livekit_rtc.d.ts +15 -10
  9. package/dist/proto/livekit_rtc.js +36 -22
  10. package/dist/proto/livekit_rtc.js.map +1 -1
  11. package/dist/room/RTCEngine.d.ts +11 -2
  12. package/dist/room/RTCEngine.js +196 -44
  13. package/dist/room/RTCEngine.js.map +1 -1
  14. package/dist/room/Room.d.ts +7 -0
  15. package/dist/room/Room.js +70 -16
  16. package/dist/room/Room.js.map +1 -1
  17. package/dist/room/events.d.ts +5 -3
  18. package/dist/room/events.js +5 -3
  19. package/dist/room/events.js.map +1 -1
  20. package/dist/room/participant/LocalParticipant.d.ts +1 -2
  21. package/dist/room/participant/LocalParticipant.js +7 -6
  22. package/dist/room/participant/LocalParticipant.js.map +1 -1
  23. package/dist/room/participant/RemoteParticipant.js +3 -0
  24. package/dist/room/participant/RemoteParticipant.js.map +1 -1
  25. package/dist/room/participant/publishUtils.js +1 -1
  26. package/dist/room/participant/publishUtils.js.map +1 -1
  27. package/dist/room/participant/publishUtils.test.js +9 -0
  28. package/dist/room/participant/publishUtils.test.js.map +1 -1
  29. package/dist/room/track/LocalTrackPublication.d.ts +2 -0
  30. package/dist/room/track/LocalTrackPublication.js.map +1 -1
  31. package/dist/room/track/RemoteTrackPublication.d.ts +2 -1
  32. package/dist/room/track/RemoteTrackPublication.js +22 -8
  33. package/dist/room/track/RemoteTrackPublication.js.map +1 -1
  34. package/dist/room/track/RemoteVideoTrack.js +12 -7
  35. package/dist/room/track/RemoteVideoTrack.js.map +1 -1
  36. package/dist/room/track/Track.js +28 -20
  37. package/dist/room/track/Track.js.map +1 -1
  38. package/dist/room/track/create.js +5 -0
  39. package/dist/room/track/create.js.map +1 -1
  40. package/dist/room/utils.d.ts +3 -0
  41. package/dist/room/utils.js +16 -1
  42. package/dist/room/utils.js.map +1 -1
  43. package/dist/version.d.ts +2 -2
  44. package/dist/version.js +2 -2
  45. package/package.json +3 -3
  46. package/src/api/SignalClient.ts +444 -0
  47. package/src/connect.ts +100 -0
  48. package/src/index.ts +47 -0
  49. package/src/logger.ts +22 -0
  50. package/src/options.ts +152 -0
  51. package/src/proto/livekit_models.ts +1863 -0
  52. package/src/proto/livekit_rtc.ts +3415 -0
  53. package/src/room/DeviceManager.ts +57 -0
  54. package/src/room/PCTransport.ts +86 -0
  55. package/src/room/RTCEngine.ts +598 -0
  56. package/src/room/Room.ts +840 -0
  57. package/src/room/errors.ts +65 -0
  58. package/src/room/events.ts +398 -0
  59. package/src/room/participant/LocalParticipant.ts +685 -0
  60. package/src/room/participant/Participant.ts +214 -0
  61. package/src/room/participant/ParticipantTrackPermission.ts +32 -0
  62. package/src/room/participant/RemoteParticipant.ts +241 -0
  63. package/src/room/participant/publishUtils.test.ts +105 -0
  64. package/src/room/participant/publishUtils.ts +180 -0
  65. package/src/room/stats.ts +130 -0
  66. package/src/room/track/LocalAudioTrack.ts +112 -0
  67. package/src/room/track/LocalTrack.ts +124 -0
  68. package/src/room/track/LocalTrackPublication.ts +66 -0
  69. package/src/room/track/LocalVideoTrack.test.ts +70 -0
  70. package/src/room/track/LocalVideoTrack.ts +416 -0
  71. package/src/room/track/RemoteAudioTrack.ts +58 -0
  72. package/src/room/track/RemoteTrack.ts +59 -0
  73. package/src/room/track/RemoteTrackPublication.ts +198 -0
  74. package/src/room/track/RemoteVideoTrack.ts +220 -0
  75. package/src/room/track/Track.ts +307 -0
  76. package/src/room/track/TrackPublication.ts +120 -0
  77. package/src/room/track/create.ts +120 -0
  78. package/src/room/track/defaults.ts +23 -0
  79. package/src/room/track/options.ts +229 -0
  80. package/src/room/track/types.ts +8 -0
  81. package/src/room/track/utils.test.ts +93 -0
  82. package/src/room/track/utils.ts +76 -0
  83. package/src/room/utils.ts +62 -0
  84. package/src/version.ts +2 -0
  85. package/.github/workflows/publish.yaml +0 -55
  86. package/.github/workflows/test.yaml +0 -36
  87. package/example/index.html +0 -247
  88. package/example/sample.ts +0 -632
  89. package/example/styles.css +0 -144
  90. package/example/webpack.config.js +0 -33
package/src/options.ts ADDED
@@ -0,0 +1,152 @@
1
+ import { LogLevel, LogLevelDesc } from './logger';
2
+ import {
3
+ AudioCaptureOptions, CreateLocalTracksOptions, TrackPublishDefaults, VideoCaptureOptions,
4
+ } from './room/track/options';
5
+
6
+ /**
7
+ * Options for when creating a new room
8
+ */
9
+ export interface RoomOptions {
10
+ /**
11
+ * AdaptiveStream lets LiveKit automatically manage quality of subscribed
12
+ * video tracks to optimize for bandwidth and CPU.
13
+ * When attached video elements are visible, it'll choose an appropriate
14
+ * resolution based on the size of largest video element it's attached to.
15
+ *
16
+ * When none of the video elements are visible, it'll temporarily pause
17
+ * the data flow until they are visible again.
18
+ */
19
+ adaptiveStream?: boolean;
20
+
21
+ /**
22
+ * enable Dynacast, off by default. With Dynacast dynamically pauses
23
+ * video layers that are not being consumed by any subscribers, significantly
24
+ * reducing publishing CPU and bandwidth usage.
25
+ */
26
+ dynacast?: boolean;
27
+
28
+ /**
29
+ * default options to use when capturing user's audio
30
+ */
31
+ audioCaptureDefaults?: AudioCaptureOptions;
32
+
33
+ /**
34
+ * default options to use when capturing user's video
35
+ */
36
+ videoCaptureDefaults?: VideoCaptureOptions;
37
+
38
+ /**
39
+ * default options to use when publishing tracks
40
+ */
41
+ publishDefaults?: TrackPublishDefaults;
42
+
43
+ /**
44
+ * should local tracks be stopped when they are unpublished. defaults to true
45
+ * set this to false if you would prefer to clean up unpublished local tracks manually.
46
+ */
47
+ stopLocalTrackOnUnpublish?: boolean;
48
+
49
+ /**
50
+ * @internal
51
+ * experimental flag, disable client managed layer pause when publishing capability is limited
52
+ */
53
+ expDisableLayerPause?: boolean;
54
+
55
+ /**
56
+ * @internal
57
+ * experimental flag, introduce a delay before sending signaling messages
58
+ */
59
+ expSignalLatency?: number;
60
+ }
61
+
62
+ /**
63
+ * Options for Room.connect()
64
+ */
65
+ export interface RoomConnectOptions {
66
+ /** autosubscribe to room tracks after joining, defaults to true */
67
+ autoSubscribe?: boolean;
68
+
69
+ /**
70
+ * use to override any RTCConfiguration options.
71
+ */
72
+ rtcConfig?: RTCConfiguration;
73
+ }
74
+
75
+ /**
76
+ * if video or audio tracks are created as part of [[connect]], it'll automatically
77
+ * publish those tracks to the room.
78
+ */
79
+ export interface ConnectOptions extends CreateLocalTracksOptions {
80
+ /** autosubscribe to room tracks upon connect, defaults to true */
81
+ autoSubscribe?: boolean;
82
+
83
+ /**
84
+ * see [[RoomOptions.adaptiveStream]]
85
+ */
86
+ adaptiveStream?: boolean;
87
+
88
+ /**
89
+ * alias for adaptiveStream
90
+ * @deprecated
91
+ */
92
+ autoManageVideo?: boolean;
93
+
94
+ /**
95
+ * see [[RoomOptions.dynacast]]
96
+ */
97
+ dynacast?: boolean;
98
+
99
+ /** configures LiveKit internal log level */
100
+ logLevel?: LogLevel | LogLevelDesc;
101
+
102
+ /**
103
+ * set ICE servers. When deployed correctly, LiveKit automatically uses the built-in TURN servers
104
+ */
105
+ iceServers?: RTCIceServer[];
106
+
107
+ /**
108
+ * use to override any RTCConfiguration options.
109
+ */
110
+ rtcConfig?: RTCConfiguration;
111
+
112
+ /**
113
+ * capture and publish audio track on connect, defaults to false
114
+ *
115
+ * If this option is used, you will not be notified if user denies capture permission.
116
+ */
117
+ audio?: boolean;
118
+
119
+ /**
120
+ * capture and publish video track on connect, defaults to false
121
+ *
122
+ * If this option is used, you will not be notified if user denies capture permission.
123
+ */
124
+ video?: boolean;
125
+
126
+ /**
127
+ * default options to use when capturing user's audio
128
+ */
129
+ audioCaptureDefaults?: AudioCaptureOptions;
130
+
131
+ /**
132
+ * default options to use when capturing user's video
133
+ */
134
+ videoCaptureDefaults?: VideoCaptureOptions;
135
+
136
+ /**
137
+ * default options to use when publishing tracks
138
+ */
139
+ publishDefaults?: TrackPublishDefaults;
140
+
141
+ /**
142
+ * should local tracks be stopped when they are unpublished. defaults to true
143
+ * set this to false if you would prefer to clean up unpublished local tracks manually.
144
+ */
145
+ stopLocalTrackOnUnpublish?: boolean;
146
+
147
+ /**
148
+ * @internal
149
+ * experimental flag, disable client managed layer pause when publishing capability is limited
150
+ */
151
+ expDisableLayerPause?: boolean;
152
+ }