Skip to content

Commit

Permalink
Deploying to docs from @ ff6d9f5 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
Santiago-Souto committed Aug 14, 2024
1 parent 4486826 commit e78bc25
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 35 deletions.
2 changes: 1 addition & 1 deletion BaseWebRTC.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion PeerConnection.html

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions PeerConnection.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
}

/**
* Add remote receving track.
* Add remote receiving track.
* @param {String} media - Media kind ('audio' | 'video').
* @param {Array<MediaStream>} streams - Streams the track will belong to.
* @return {Promise<RTCRtpTransceiver>} Promise that will be resolved when the RTCRtpTransceiver is assigned an mid value.
Expand All @@ -194,7 +194,7 @@
*/
updateBandwidthRestriction (sdp, bitrate) {
if (this.mode === ConnectionType.Viewer) {
logger.error('Viewer attempting to udpate bitrate, this is not allowed')
logger.error('Viewer attempting to update bitrate, this is not allowed')
throw new Error('It is not possible for a viewer to update the bitrate.')
}

Expand All @@ -210,7 +210,7 @@
*/
async updateBitrate (bitrate = 0) {
if (this.mode === ConnectionType.Viewer) {
logger.error('Viewer attempting to udpate bitrate, this is not allowed')
logger.error('Viewer attempting to update bitrate, this is not allowed')
throw new Error('It is not possible for a viewer to update the bitrate.')
}
if (!this.peer) {
Expand All @@ -223,7 +223,7 @@
await this.peer.setLocalDescription(this.sessionDescription)
const sdp = this.updateBandwidthRestriction(this.peer.remoteDescription.sdp, bitrate)
await this.setRTCRemoteSDP(sdp)
logger.info('Bitrate restirctions updated: ', `${bitrate > 0 ? bitrate : 'unlimited'} kbps`)
logger.info('Bitrate restrictions updated: ', `${bitrate > 0 ? bitrate : 'unlimited'} kbps`)
}

/**
Expand Down Expand Up @@ -276,9 +276,9 @@
*/
static getCapabilities (kind) {
const browserData = new UserAgent()
const browserCapabilites = RTCRtpSender.getCapabilities(kind)
const browserCapabilities = RTCRtpSender.getCapabilities(kind)

if (browserCapabilites) {
if (browserCapabilities) {
const codecs = {}
let regex = new RegExp(`^video/(${Object.values(VideoCodec).join('|')})x?$`, 'i')

Expand All @@ -290,7 +290,7 @@
}
}

for (const codec of browserCapabilites.codecs) {
for (const codec of browserCapabilities.codecs) {
const matches = codec.mimeType.match(regex)
if (matches) {
const codecName = matches[1].toLowerCase()
Expand All @@ -306,10 +306,10 @@
}
}

browserCapabilites.codecs = Object.keys(codecs).map((key) => { return { codec: key, ...codecs[key] } })
browserCapabilities.codecs = Object.keys(codecs).map((key) => { return { codec: key, ...codecs[key] } })
}

return browserCapabilites
return browserCapabilities
}

/**
Expand Down
30 changes: 20 additions & 10 deletions PeerConnectionStats.js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Publish.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Publish.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
if (this.options?.metadata && this.worker) {
this.worker.postMessage({
action: 'metadata-sei-user-data-unregistered',
uuid: uuid,
uuid,
payload: message
})
} else {
Expand Down
4 changes: 2 additions & 2 deletions View.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions View.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
}

/**
* Add remote receving track.
* Add remote receiving track.
* @param {String} media - Media kind ('audio' | 'video').
* @param {Array<MediaStream>} streams - Streams the track will belong to.
* @return {Promise<RTCRtpTransceiver>} Promise that will be resolved when the RTCRtpTransceiver is assigned an mid value.
Expand Down Expand Up @@ -289,10 +289,11 @@
const metadata = event.data.metadata
metadata.mid = event.data.mid
metadata.track = this.tracksMidValues[event.data.mid]

const uuid = metadata.uuid
metadata.uuid = uuid.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), '')
metadata.uuid = metadata.uuid.replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, '$1-$2-$3-$4-$5')
if (metadata.uuid) {
const uuid = metadata.uuid
metadata.uuid = uuid.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), '')
metadata.uuid = metadata.uuid.replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, '$1-$2-$3-$4-$5')
}
if (metadata.timecode) {
metadata.timecode = new Date(decoder.decode(metadata.timecode))
}
Expand All @@ -306,10 +307,9 @@
logger.info('The content could not be converted to JSON, returning raw bytes instead')
}
}

// for backwards compatibility, emit the old event as well
this.emit('onMetadata', metadata)
this.emit('metadata', metadata)
// FIXME : Remove in v0.3.0
this.emit('onMetadata', metadata)
}
}

Expand Down
2 changes: 1 addition & 1 deletion data/search.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion global.html

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions utils_BaseWebRTC.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@

this.webRTCPeer.on(webRTCEvents.connectionStateChange, (state) => {
Diagnostics.setConnectionState(state)
if (state === 'connected') {
Diagnostics.setConnectionTime(new Date())
}
if ((state === 'failed' || (state === 'disconnected' && this.alreadyDisconnected)) && this.firstReconnection) {
this.firstReconnection = false
this.reconnect({ error: new Error('Connection state change: RTCPeerConnectionState disconnected') })
Expand Down

0 comments on commit e78bc25

Please sign in to comment.