Skip to content

Commit f9d601b

Browse files
authored
Merge pull request #89 from zoom/dev
v1.0.2
2 parents 6031e98 + 7b15b22 commit f9d601b

16 files changed

Lines changed: 461 additions & 700 deletions

File tree

.github/docs-template/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ <h3>JavaScript & TypeScript</h3>
385385
<p>Complete API reference for Node.js and TypeScript developers with comprehensive examples, type definitions, and integration guides for real-time media processing.</p>
386386
</a>
387387

388-
<a href="./python/" class="docs-card" role="button" aria-label="Python Documentation">
388+
<a href="./py/" class="docs-card" role="button" aria-label="Python Documentation">
389389
<div class="card-icon">🐍</div>
390390
<h3>Python</h3>
391391
<p>Python bindings documentation featuring usage examples, API reference, and detailed implementation guides for seamless integration with your Python applications.</p>

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
77
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
88
cmake_policy(SET CMP0091 NEW)
99

10+
# ===== Debug options =====
11+
option(RTMS_DEBUG "Enable RTMS debug logging for C SDK callbacks" OFF)
12+
if(RTMS_DEBUG)
13+
add_compile_definitions(RTMS_DEBUG)
14+
message(STATUS "RTMS debug logging enabled")
15+
endif()
16+
1017
# ===== Platform detection =====
1118
if(APPLE)
1219
set(RTMS_PLATFORM "darwin")

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Bindings for real-time audio, video, and transcript streams from Zoom Meetings
44

55
[![npm](https://img.shields.io/npm/v/@zoom/rtms)](https://www.npmjs.com/package/@zoom/rtms)
66
[![PyPI](https://img.shields.io/pypi/v/rtms)](https://pypi.org/project/rtms/)
7-
[![docs](https://img.shields.io/badge/docs-online-blue)](https://zoom.github.io/rtms/js/)
7+
[![docs](https://img.shields.io/badge/docs-online-blue)](https://zoom.github.io/rtms/)
88

99
## Supported Products
1010

@@ -80,10 +80,7 @@ The RTMS SDK requires Python 3.10 or higher.
8080
# Check your Python version
8181
python3 --version
8282

83-
# Install from TestPyPI (Current)
84-
pip install -i https://test.pypi.org/simple/ rtms
85-
86-
# Install from PyPI (Coming Soon)
83+
# Install from PyPI
8784
pip install rtms
8885
```
8986

@@ -432,7 +429,7 @@ source .venv/bin/activate # On Windows: .venv\Scripts\activate
432429
pip install python-dotenv
433430

434431
# Install RTMS SDK
435-
pip install -i https://test.pypi.org/simple/ rtms
432+
pip install rtms
436433
```
437434

438435
Create a `.env` file:

Taskfile.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ version: '3'
33
# Global variables
44
vars:
55
BUILD_TYPE: '{{.BUILD_TYPE | default "Release"}}'
6+
RTMS_DEBUG: '{{.RTMS_DEBUG | default "OFF"}}'
67
NODE_VERSION: "22"
78
PYTHON_VERSION: "3.13"
89
CMAKE_VERSION: "3.25"
@@ -39,7 +40,7 @@ tasks:
3940
build:js:
4041
desc: "Build Node.js bindings (local platform)"
4142
cmds:
42-
- npx cmake-js compile --CDCMAKE_BUILD_TYPE={{.BUILD_TYPE}}
43+
- npx cmake-js compile --CDCMAKE_BUILD_TYPE={{.BUILD_TYPE}} --CDRTMS_DEBUG={{.RTMS_DEBUG}}
4344
sources:
4445
- src/**/*.cpp
4546
- src/**/*.h
@@ -53,7 +54,7 @@ tasks:
5354
build:js:linux:
5455
desc: "Build Node.js bindings for Linux (via Docker)"
5556
cmds:
56-
- docker compose run --rm build task build:js BUILD_TYPE={{.BUILD_TYPE}}
57+
- docker compose run --rm build task build:js BUILD_TYPE={{.BUILD_TYPE}} RTMS_DEBUG={{.RTMS_DEBUG}}
5758

5859
build:js:darwin:
5960
desc: "Build Node.js bindings for macOS"
@@ -284,7 +285,7 @@ tasks:
284285
manual:js:linux:
285286
desc: "Run interactive Node.js manual test in Linux Docker"
286287
cmds:
287-
- docker compose run --rm -it --service-ports test-js sh -c "task build:js && NODE_ENV=test node --trace-deprecation --force-node-api-uncaught-exceptions-policy=true --env-file=.env test.js"
288+
- docker compose run --rm -it --service-ports test-js sh -c "task build:js RTMS_DEBUG={{.RTMS_DEBUG}} && NODE_ENV=test node --trace-deprecation --force-node-api-uncaught-exceptions-policy=true --env-file=.env test.js"
288289

289290
manual:py:linux:
290291
desc: "Run interactive Python manual test in Linux Docker"
@@ -311,7 +312,10 @@ tasks:
311312
desc: "Generate Python API documentation"
312313
cmds:
313314
- mkdir -p docs
314-
- pdoc3 -o docs/py/ --force --html rtms
315+
- pdoc3 -o docs/ --force --html rtms
316+
# pdoc3 creates docs/rtms/, rename to docs/py/ for clean URL
317+
- rm -rf docs/py
318+
- mv docs/rtms docs/py
315319
sources:
316320
- src/**/*.py
317321
- src/**/*.pyi

examples/videosdk.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The API is identical to Meetings. See the [Meetings Node.js Quick Start](meeting
1414

1515
Key differences:
1616
- Webhook event: `session.rtms_started` (Video SDK uses session events)
17+
- Webhook payload contains `session_id` instead of `meeting_uuid`
1718
- Join parameters come from Video SDK webhook payload
1819

1920
```javascript
@@ -32,6 +33,8 @@ rtms.onWebhookEvent(({event, payload}) => {
3233
console.log(`Video SDK video: ${metadata.width}x${metadata.height}`);
3334
});
3435

36+
// Video SDK payload contains session_id (not meeting_uuid)
37+
// The SDK accepts both - just pass the payload directly
3538
client.join(payload);
3639
});
3740
```
@@ -42,6 +45,7 @@ The API is identical to Meetings. See the [Meetings Python Quick Start](meetings
4245

4346
Key differences:
4447
- Webhook event: `session.rtms_started` (Video SDK uses session events)
48+
- Webhook payload contains `session_id` instead of `meeting_uuid`
4549

4650
```python
4751
import rtms
@@ -53,7 +57,8 @@ def handle_webhook(payload):
5357
if payload.get('event') == 'session.rtms_started':
5458
rtms_payload = payload.get('payload', {})
5559
client.join(
56-
meeting_uuid=rtms_payload.get('meeting_uuid'),
60+
# Video SDK uses session_id instead of meeting_uuid
61+
session_id=rtms_payload.get('session_id'),
5762
rtms_stream_id=rtms_payload.get('rtms_stream_id'),
5863
server_urls=rtms_payload.get('server_urls')
5964
)

index.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,7 @@ class Client extends nativeRtms.Client {
947947

948948
const {
949949
meeting_uuid,
950+
session_id,
950951
rtms_stream_id,
951952
server_urls,
952953
signature: providedSignature,
@@ -956,34 +957,40 @@ class Client extends nativeRtms.Client {
956957
pollInterval = 0
957958
} = options;
958959

960+
// Use meeting_uuid for Meeting SDK events, session_id for Video SDK events
961+
const instance_id = meeting_uuid || session_id;
962+
959963
this.pollRate = pollInterval;
960964

961-
Logger.info('client', `Joining meeting: ${meeting_uuid}`, {
965+
Logger.info('client', `Joining ${meeting_uuid ? 'meeting' : 'session'}: ${instance_id}`, {
962966
streamId: rtms_stream_id,
963967
serverUrls: server_urls,
964968
timeout: providedTimeout,
965969
pollInterval
966970
});
967-
971+
972+
if (!instance_id) {
973+
throw new Error('Either meeting_uuid or session_id must be provided');
974+
}
968975

969976
const finalSignature = providedSignature || generateSignature({
970977
client,
971978
secret,
972-
uuid: meeting_uuid,
979+
uuid: instance_id,
973980
streamId: rtms_stream_id
974981
});
975982

976983
try {
977-
ret = super.join(meeting_uuid, rtms_stream_id, finalSignature, server_urls, providedTimeout);
978-
984+
ret = super.join(instance_id, rtms_stream_id, finalSignature, server_urls, providedTimeout);
985+
979986
if (ret) {
980-
Logger.info('client', `Successfully joined meeting: ${meeting_uuid}`);
987+
Logger.info('client', `Successfully joined: ${instance_id}`);
981988
} else {
982-
Logger.error('client', `Failed to join meeting: ${meeting_uuid}`);
989+
Logger.error('client', `Failed to join: ${instance_id}`);
983990
}
984991
} catch (error) {
985992
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
986-
Logger.error('client', `Error joining meeting: ${errorMessage}`, { meeting_uuid });
993+
Logger.error('client', `Error joining: ${errorMessage}`, { instance_id });
987994
throw error;
988995
}
989996

0 commit comments

Comments
 (0)