-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update room streaming flow (#71)
* feat: handle auto reconnect and get client name from track * feat: getStreamByTrackId and mapping client id and name * fix: remove _onAllowedRenegotiation listener * feat: add client id and name from draftstream * feat: get browser name util * feat: bandwidth controller module * refactor: use private class field * feat: video observer module * feat: update peer to support simulcast, and video observer * fix: wrong variable returned * fix: bind this for observer instances * feat: add validation must be an instance of MediaStreamTrack * feat: add replace track to peer instance type * doc: update the room readme - add more methods on peer object - add more properties on stream object * doc: update stream properties description * feat: add more response data from api * doc: update information related to client * doc: update addStream name example * refactor: remove unused methodss - remove getVideoOutboundTracksLength() - remove getAudioOutboundTracksLength() - remove getAvailable() - remove getOutbountStats() * doc: remove observer video methods from doc * fix: update scalabilityMode to L3T2
- Loading branch information
1 parent
dcd81d9
commit ceb43a2
Showing
14 changed files
with
794 additions
and
57 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,24 @@ | ||
export const CHROME = 'Chrome', | ||
FIREFOX = 'Firefox', | ||
SAFARI = 'Safari', | ||
OPERA = 'Opera', | ||
IE = 'IE', | ||
EDGE = 'Edge' | ||
|
||
export const getBrowserName = () => { | ||
if ( | ||
navigator.userAgent.includes(CHROME) && | ||
navigator.userAgent.includes(EDGE) | ||
) | ||
return EDGE | ||
if ( | ||
navigator.userAgent.includes(CHROME) && | ||
navigator.userAgent.includes(OPERA) | ||
) | ||
return OPERA | ||
if (navigator.userAgent.includes(CHROME)) return CHROME | ||
if (navigator.userAgent.includes(FIREFOX)) return FIREFOX | ||
if (navigator.userAgent.includes(SAFARI)) return SAFARI | ||
if (navigator.userAgent.includes(IE)) return IE | ||
return null | ||
} |
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
51 changes: 51 additions & 0 deletions
51
packages/room/bandwidth-controller/bandwidth-controller-types.d.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import type { RoomPeerType } from '../peer/peer-types.js' | ||
import type { RoomEventType } from '../event/event-types.js' | ||
|
||
export declare namespace RoomBwControllerType { | ||
type BwControllerDependencies = { | ||
event: RoomEventType.InstanceEvent | ||
peer: RoomPeerType.InstancePeer | ||
} | ||
|
||
type TrackInboundStats = { | ||
kind: string | ||
source: string | ||
bytesReceived: number | ||
bitrate: number | ||
lastUpdated: number | ||
} | ||
|
||
type TrackOutboundStats = { | ||
rid: string | ||
kind: string | ||
bytesSent: number | ||
bitrates: number | ||
lastUpdated: number | ||
} | ||
|
||
type PublisherStatsData = { | ||
available_outgoing_bitrate: number | ||
quality_limitation_reason: string | ||
} | ||
|
||
type PublisherStatsReport = { | ||
type: string | ||
data: PublisherStatsData | ||
} | ||
|
||
type InboundTracks = { | ||
[key: string]: TrackInboundStats | ||
} | ||
|
||
type OutboundTracks = { | ||
[key: string]: TrackOutboundStats | ||
} | ||
|
||
type RTCInboundRtpStreamStatsExtra = RTCInboundRtpStreamStats & { | ||
trackIdentifier: string | ||
} | ||
|
||
type RTCOutboundRtpStreamStatsExtra = RTCOutboundRtpStreamStats & { | ||
qualityLimitationReason?: string | ||
} | ||
} |
Oops, something went wrong.