-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Realtime Video SDK with new interface (#886)
* Realtime Video SDK with new interface * room session with the new interface * remove auto subscribe consumer * fix unit tests for video and room session * room member instance * unit tests for room session member * fix stack test * room session playback realtime-api instance * room session recording realtime-api instance * room session stream realtime-api instance * explicit methods for the realtime-api * fix build issue * separate workers for playback, recording and stream * video playground with the new interface * decorated promise for room session playback api * decorated promise for room session recording api * decorated promise for room session stream api * fix unit test cases * unit tests for decorated promises * update video play ground with decorated promise * fix e2e test case for the video * fix unit test * do not unsubscribe events * fix unit test * include changeset * streaming getter for room session * rename types
- Loading branch information
Showing
64 changed files
with
4,596 additions
and
1,441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
'@signalwire/realtime-api': major | ||
'@signalwire/core': major | ||
--- | ||
|
||
- New interface for the realtime-api Video SDK. | ||
- Listen function with _video_, _room_, _playback_, _recording_, and _stream_ objects. | ||
- Listen param with `room.play`, `room.startRecording`, and `room.startStream` functions. | ||
- Decorated promise for `room.play`, `room.startRecording`, and `room.startStream` functions. | ||
|
||
```js | ||
import { SignalWire } from '@signalwire/realtime-api' | ||
|
||
const client = await SignalWire({ project, token }) | ||
|
||
const unsub = await client.video.listen({ | ||
onRoomStarted: async (roomSession) => { | ||
console.log('room session started', roomSession) | ||
|
||
await roomSession.listen({ | ||
onPlaybackStarted: (playback) => { | ||
console.log('plyaback started', playback) | ||
} | ||
}) | ||
|
||
// Promise resolves when playback ends. | ||
await roomSession.play({ url: "http://.....", listen: { onEnded: () => {} } }) | ||
}, | ||
onRoomEnded: (roomSession) => { | ||
console.log('room session ended', roomSession) | ||
} | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 76 additions & 26 deletions
102
internal/playground-realtime-api/src/with-events/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.