Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
a817a45
added maxOpusPlaybackRate param
jpsantosbh Mar 8, 2025
1d8c330
Merge branch 'main' into joao/opus_config
jpsantosbh Mar 11, 2025
ff9f615
testing
jpsantosbh Mar 11, 2025
51ab08a
maxaveragebitrate
jpsantosbh Mar 11, 2025
0670610
add PlaybackRate enum
jpsantosbh Mar 12, 2025
950e8df
replace sdp with sdpTransform
jpsantosbh Mar 20, 2025
c65f62d
renaming parameters
jpsantosbh Mar 20, 2025
0941f1d
hardening
jpsantosbh Mar 20, 2025
94623fc
playground changes
jpsantosbh Mar 21, 2025
20bcb3e
Merge branch 'main' into joao/opus_config
jpsantosbh Mar 21, 2025
c7a4220
Merge branch 'main' into joao/opus_config
jpsantosbh Mar 21, 2025
07c55d2
Fix build
jpsantosbh Mar 25, 2025
db83282
cleanup
jpsantosbh Apr 8, 2025
93d1fb0
manual prettier
jpsantosbh Apr 15, 2025
78a1f78
Update internal/playground-js/src/fabric/index.js
jpsantosbh Apr 15, 2025
81a1b4c
Update packages/js/src/fabric/WSClient.ts
jpsantosbh Apr 15, 2025
8e924e0
flexible audio codec params
jpsantosbh May 6, 2025
8d0f26e
Merge remote-tracking branch 'origin/main' into joao/opus_config
jpsantosbh May 6, 2025
035d424
changeset
jpsantosbh May 6, 2025
dc0c11f
Atualizar o index.html
jpsantosbh May 7, 2025
51c5eea
Atualizar o index.html
jpsantosbh May 7, 2025
6e37d34
Atualizar o index.html
jpsantosbh May 7, 2025
00b65d9
Update internal/playground-js/src/fabric/index.html
jpsantosbh May 7, 2025
aad67a7
UI fixes
jpsantosbh May 7, 2025
41817e3
dependencies fix
jpsantosbh May 7, 2025
b8704ad
build fix
jpsantosbh May 7, 2025
255f0cf
formating
jpsantosbh May 7, 2025
37e545d
Update packages/webrtc/src/RTCPeer.ts
jpsantosbh May 7, 2025
a514e78
Update packages/js/src/fabric/interfaces/wsClient.ts
jpsantosbh May 7, 2025
5f99076
fixes
jpsantosbh May 7, 2025
5d5b474
fix
jpsantosbh May 7, 2025
43d5abe
fix test
jpsantosbh May 7, 2025
eb67f33
test fix
jpsantosbh May 7, 2025
b54aa5a
fix sdpMediaOrderHack
jpsantosbh May 7, 2025
4d49452
don't change the remote description
jpsantosbh May 8, 2025
9b38f4a
Merge branch 'main' into joao/opus_config
jpsantosbh May 26, 2025
7e5704c
cleanup
jpsantosbh May 26, 2025
9e7335b
Update audio codec selection and input handling in the demo
jpsantosbh May 26, 2025
a1ec706
Merge branch 'main' into joao/opus_config
jpsantosbh May 29, 2025
8b5bf4a
Debug streaming tests with new SDP changes
iAmmar7 Jun 4, 2025
07c9b40
comment other e2e tests
iAmmar7 Jun 4, 2025
0fd8b13
run the CI
iAmmar7 Jun 4, 2025
5577b49
enable roomSessionStreaming.spec.ts
iAmmar7 Jun 4, 2025
e3dc5c0
run only roomSessionStreamingAPI.spec.ts
iAmmar7 Jun 4, 2025
8cb25e8
run only streaming project
iAmmar7 Jun 4, 2025
d91b3ad
add logs
iAmmar7 Jun 4, 2025
7d1b730
add more logs
iAmmar7 Jun 4, 2025
88534ea
testing
jpsantosbh Jun 4, 2025
eb4b374
testing
jpsantosbh Jun 4, 2025
aede240
Merge branch 'joao/opus_config' of github.com:signalwire/signalwire-j…
jpsantosbh Jun 4, 2025
97afc46
testing
jpsantosbh Jun 4, 2025
d9f1610
revert
jpsantosbh Jun 4, 2025
4ee022f
wait for the join
iAmmar7 Jun 5, 2025
31af3c1
merge with base branch
iAmmar7 Jun 5, 2025
309263a
join room
iAmmar7 Jun 5, 2025
3e24019
refactor the room joined logic
iAmmar7 Jun 5, 2025
08f2610
refactor the roomSessionStreaming.spec.ts
iAmmar7 Jun 5, 2025
3bfb8e3
refactor roomSessionMultipleStreams.spec.ts
iAmmar7 Jun 5, 2025
68fc513
refactor roomSessionAutomaticStream.spec.ts
iAmmar7 Jun 5, 2025
f66e989
refactor buildVideoWithVideoSDK.spec.ts
iAmmar7 Jun 5, 2025
cb36757
fix video element test
iAmmar7 Jun 5, 2025
cd1785a
refactor and enabled audience tests
iAmmar7 Jun 5, 2025
f28eb81
refactor the utility
iAmmar7 Jun 5, 2025
49c5c71
refactor and enable badNetwork test
iAmmar7 Jun 5, 2025
8d78a9e
enable all the productiontests
iAmmar7 Jun 5, 2025
1666b0b
fix promote demote tests
iAmmar7 Jun 5, 2025
89bf2d1
fix roomSessionLocalStream.spec.ts
iAmmar7 Jun 5, 2025
bd5996f
Merge main into joao/opus_config and resolve conflicts
jpsantosbh Jun 12, 2025
dd63db6
Merge commit '89bf2d1e4a006181367e5ee29113dcd80478af01' into joao/cod…
jpsantosbh Jun 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/cute-zebras-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@signalwire/webrtc': minor
'@signalwire/js': minor
---

Added dial params:

- audioCodecs

The new parameter allows developers to select the audio codec to use with the desired configuration
82 changes: 41 additions & 41 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,55 @@ on:
push:
branches: [main]
pull_request:
branches: [main, dev]
branches: [main, dev, joao/opus_config]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
name: Run unit and stack tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Install deps
uses: ./.github/actions/install
with:
NODE_VERSION: ${{ matrix.node-version }}
- name: Build SDKs
uses: ./.github/actions/build
with:
NODE_VERSION: ${{ matrix.node-version }}
- name: Unit Tests
run: npm test
- name: Stack Tests
run: npm run -w=@sw-internal/stack-tests dev
env:
RELAY_HOST: ${{ secrets.RELAY_HOST }}
RELAY_PROJECT: ${{ secrets.RELAY_PROJECT }}
RELAY_TOKEN: ${{ secrets.RELAY_TOKEN }}
run-browser-js-staging:
name: Browser SDK staging
needs: tests
uses: ./.github/workflows/browser-js-staging.yml
secrets: inherit
# tests:
# name: Run unit and stack tests
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [20.x]
# steps:
# - uses: actions/checkout@v4
# - name: Install deps
# uses: ./.github/actions/install
# with:
# NODE_VERSION: ${{ matrix.node-version }}
# - name: Build SDKs
# uses: ./.github/actions/build
# with:
# NODE_VERSION: ${{ matrix.node-version }}
# - name: Unit Tests
# run: npm test
# - name: Stack Tests
# run: npm run -w=@sw-internal/stack-tests dev
# env:
# RELAY_HOST: ${{ secrets.RELAY_HOST }}
# RELAY_PROJECT: ${{ secrets.RELAY_PROJECT }}
# RELAY_TOKEN: ${{ secrets.RELAY_TOKEN }}
# run-browser-js-staging:
# name: Browser SDK staging
# needs: tests
# uses: ./.github/workflows/browser-js-staging.yml
# secrets: inherit
run-browser-js-production:
name: Browser SDK production
needs: tests
# needs: tests
uses: ./.github/workflows/browser-js-production.yml
secrets: inherit
run-realtime-api-staging:
name: RealtimeAPI SDK staging
needs: tests
uses: ./.github/workflows/realtime-api-staging.yml
secrets: inherit
run-realtime-api-production:
name: RealtimeAPI SDK production
needs: tests
uses: ./.github/workflows/realtime-api-production.yml
secrets: inherit
# run-realtime-api-staging:
# name: RealtimeAPI SDK staging
# needs: tests
# uses: ./.github/workflows/realtime-api-staging.yml
# secrets: inherit
# run-realtime-api-production:
# name: RealtimeAPI SDK production
# needs: tests
# uses: ./.github/workflows/realtime-api-production.yml
# secrets: inherit
33 changes: 13 additions & 20 deletions internal/e2e-js/tests/buildVideoWithVideoSDK.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
SERVER_URL,
createTestRoomSession,
expectMCUVisible,
expectRoomJoined,
expectRoomJoinWithDefaults,
randomizeRoomName,
} from '../utils'

Expand Down Expand Up @@ -62,7 +62,7 @@ test.describe('buildVideoElement with Video SDK', () => {
})

// Join a video room without passing the rootElement
await expectRoomJoined(page)
await expectRoomJoinWithDefaults(page)

expect(await page.$$('div[id^="sw-sdk-"] > video')).toHaveLength(0)
expect(await page.$$('div[id^="sw-overlay-"]')).toHaveLength(0)
Expand All @@ -82,7 +82,7 @@ test.describe('buildVideoElement with Video SDK', () => {
})

// Join a video room without passing the rootElement
await expectRoomJoined(page)
await expectRoomJoinWithDefaults(page)

// Build a video element
const { element } = await page.evaluate(async () => {
Expand Down Expand Up @@ -154,7 +154,7 @@ test.describe('buildVideoElement with Video SDK', () => {
})

// Join a video room and expect both video and member overlays
await expectRoomJoined(page)
await expectRoomJoinWithDefaults(page)

await expectMCUVisible(page)

Expand Down Expand Up @@ -287,9 +287,7 @@ test.describe('buildVideoElement with Video SDK', () => {

const roomName = randomizeRoomName('build-video-element')

await createRoomSession(page, {
roomName,
})
await createRoomSession(page, { roomName })

// Create a video element
await page.evaluate(async () => {
Expand All @@ -306,7 +304,7 @@ test.describe('buildVideoElement with Video SDK', () => {
})

// Join a video room
await expectRoomJoined(page)
await expectRoomJoinWithDefaults(page)

await expectMCUVisible(page)

Expand All @@ -326,12 +324,11 @@ test.describe('buildVideoElement with Video SDK', () => {

const roomName = randomizeRoomName('build-video-element')

await createRoomSession(page, {
roomName,
})
await createRoomSession(page, { roomName })

// Join a video room with rootElement
await expectRoomJoined(page)
await expectRoomJoinWithDefaults(page)
await expectRoomJoinWithDefaults(page)

// Create a video element with the same rootElement
await page.evaluate(async () => {
Expand Down Expand Up @@ -365,12 +362,10 @@ test.describe('buildVideoElement with Video SDK', () => {

const roomName = randomizeRoomName('build-video-element')

await createRoomSession(pageOne, {
roomName,
})
await createRoomSession(pageOne, { roomName })

// Join a video room from pageOne
await expectRoomJoined(pageOne)
await expectRoomJoinWithDefaults(pageOne)
await expectMCUVisible(pageOne)

await test.step('should have correct DOM elements and overlayMap with one member', async () => {
Expand All @@ -381,12 +376,10 @@ test.describe('buildVideoElement with Video SDK', () => {
expect(await getLocalVideoOverlay(pageOne)).toBeDefined()
})

await createRoomSession(pageTwo, {
roomName,
})
await createRoomSession(pageTwo, { roomName })

// Join a video room from pageTwo
await expectRoomJoined(pageTwo)
await expectRoomJoinWithDefaults(pageTwo)
await expectMCUVisible(pageTwo)

await test.step('should have correct DOM elements and overlayMap with two members', async () => {
Expand Down
8 changes: 4 additions & 4 deletions internal/e2e-js/tests/roomSession.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
randomizeRoomName,
setLayoutOnPage,
expectLayoutChanged,
expectRoomJoined,
expectMCUVisible,
expectRoomJoinWithDefaults,
} from '../utils'

test.describe('RoomSession', () => {
Expand Down Expand Up @@ -62,7 +62,7 @@ test.describe('RoomSession', () => {
})

// --------------- Joining the room ---------------
const joinParams = await expectRoomJoined(page)
const joinParams = await expectRoomJoinWithDefaults(page)

expect(joinParams.room).toBeDefined()
expect(joinParams.room_session).toBeDefined()
Expand Down Expand Up @@ -628,7 +628,7 @@ test.describe('RoomSession', () => {
])

// --------------- Joining the 1st room ---------------
await expectRoomJoined(pageOne)
await expectRoomJoinWithDefaults(pageOne)

// Checks that the video is visible
await expectMCUVisible(pageOne)
Expand Down Expand Up @@ -668,7 +668,7 @@ test.describe('RoomSession', () => {
)

// --------------- Joining the 2nd room ---------------
await expectRoomJoined(pageTwo)
await expectRoomJoinWithDefaults(pageTwo)

// Checks that the video is visible
await expectMCUVisible(pageTwo)
Expand Down
14 changes: 10 additions & 4 deletions internal/e2e-js/tests/roomSessionAudienceCount.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
SERVER_URL,
createTestRoomSession,
randomizeRoomName,
expectRoomJoined,
expectRoomJoinWithDefaults,
} from '../utils'

test.describe('RoomSession Audience Count', () => {
Expand Down Expand Up @@ -94,21 +94,27 @@ test.describe('RoomSession Audience Count', () => {
expectedAudienceCount
)

await expectRoomJoined(pageOne)
await expectRoomJoinWithDefaults(pageOne)

const expectorPageTwo = expectAudienceCount(pageTwo)
const audienceCountPageTwoPromise = expectorPageTwo.waitFor(
expectedAudienceCount
)

// join as audience on pageTwo and resolve on `room.joined`
const joinTwoParams: any = await expectRoomJoined(pageTwo)
const joinTwoParams: any = await expectRoomJoinWithDefaults(pageTwo, {
joinAs: 'audience',
})
// expect to have only 1 audience in the room at the moment
expect(joinTwoParams.room_session.audience_count).toBe(1)

const [_, ...pageThreeToFive] = audiencePages
// join as audiences on pageThree to pageFive and resolve on `room.joined`
await Promise.all(pageThreeToFive.map((page) => expectRoomJoined(page)))
await Promise.all(
pageThreeToFive.map((page) =>
expectRoomJoinWithDefaults(page, { joinAs: 'audience' })
)
)

// wait for all the room.audienceCount
await Promise.all([
Expand Down
7 changes: 3 additions & 4 deletions internal/e2e-js/tests/roomSessionAutomaticStream.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ import type { Video } from '@signalwire/js'
import {
SERVER_URL,
createTestRoomSession,
expectRoomJoined,
expectMCUVisible,
createRoom,
createStreamForRoom,
randomizeRoomName,
deleteRoom,
expectRoomJoinWithDefaults,
} from '../utils'

test.describe('Room Session Auto Stream', () => {
const streamingURL = `${process.env.RTMP_SERVER}${process.env.RTMP_STREAM_NAME}`

test('Should Join a Room with existing stream', async ({
test('should join a room with existing stream', async ({
createCustomPage,
}) => {
const roomName = randomizeRoomName('auto-stream-e2e')
Expand All @@ -36,8 +36,7 @@ test.describe('Room Session Auto Stream', () => {
await createStreamForRoom(roomName, streamingURL)

await createTestRoomSession(pageOne, connectionSettings)

await expectRoomJoined(pageOne)
await expectRoomJoinWithDefaults(pageOne)

await expectMCUVisible(pageOne)

Expand Down
6 changes: 4 additions & 2 deletions internal/e2e-js/tests/roomSessionBadNetwork.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {
SERVER_URL,
createTestRoomSession,
randomizeRoomName,
expectRoomJoined,
expectMCUVisible,
expectMCUVisibleForAudience,
expectPageReceiveMedia,
expectMediaEvent,
expectRoomJoinWithDefaults,
} from '../utils'

type Test = {
Expand Down Expand Up @@ -54,7 +54,9 @@ test.describe('roomSessionBadNetwork', () => {
)

// --------------- Joining the room ---------------
const joinParams: any = await expectRoomJoined(page)
const joinParams: any = await expectRoomJoinWithDefaults(page, {
joinAs: row.join_as,
})

expect(joinParams.room).toBeDefined()
expect(joinParams.room_session).toBeDefined()
Expand Down
11 changes: 7 additions & 4 deletions internal/e2e-js/tests/roomSessionCleanup.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Video } from '@signalwire/js'
import { test, expect } from '../fixtures'
import {
createTestRoomSession,
expectRoomJoined,
expectRoomJoinWithDefaults,
leaveRoom,
randomizeRoomName,
SERVER_URL,
Expand All @@ -25,11 +26,12 @@ test.describe('RoomSession', () => {
attachSagaMonitor: true,
})

await expectRoomJoined(page)
await expectRoomJoinWithDefaults(page)

await test.step('the room should have workers and listeners attached', async () => {
const watchers: Record<string, number> = await page.evaluate(() => {
const roomObj = window._roomObj
// @ts-expect-error
const roomObj: Video.RoomSession = window._roomObj

return {
// @ts-expect-error
Expand All @@ -53,7 +55,8 @@ test.describe('RoomSession', () => {

await test.step('the room should not have any workers and listeners attached', async () => {
const watchers: Record<string, number> = await page.evaluate(() => {
const roomObj = window._roomObj
// @ts-expect-error
const roomObj: Video.RoomSession = window._roomObj

return {
// @ts-expect-error
Expand Down
Loading
Loading