Skip to content

Commit

Permalink
Merge pull request #309 from millicast/develop
Browse files Browse the repository at this point in the history
Release v0.1.43
  • Loading branch information
Santiago-Souto authored Jan 22, 2024
2 parents 108044e + b64cc3b commit 567d779
Show file tree
Hide file tree
Showing 26 changed files with 397 additions and 624 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ node_modules
coverage
dist
docs
docs-translations
.env
test-environment.js
**/.DS_Store
92 changes: 92 additions & 0 deletions developer-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,95 @@ Or if you want to navigate docs in your localhost run:
npx lerna run start-docs --stream
```
In the logs you find the link where you can access to docs. By default is running at http://localhost:5000.

### SDK Components
```mermaid
classDiagram
class EventEmitter {
+emit(eventName: string | symbol, ...args: any[]) boolean
+on(eventName: string | symbol, listener: (...args: any[]) => void) EventEmitter
}
class BaseWebRTC {
<<Abstract>>
+string streamName
#PeerConnection webRTCPeer
#Signaling signaling
#tokenGeneratorCallback tokenGenerator
+isActive() bool
+stop()
+async reconnect(data)
+getRTCPeerConnection() RTCPeerConnection
}
class PeerConnection{
$getCapabilities() MillicastCapability
+async addRemoteTrack(media, streams) RTCRtpTransceiver
+async createRTCPeer(config)
+async closeRTCPeer()
+initStats()
+stopStats()
+async getRTCLocalSDP(options) string
+async setRTCRemoteSDP(sdp)
+updateBandwidthRestriction(sdp, bitrate) string
+async updateBitrate(bitrate)
}
class Signaling {
+async connect() WebSocket
+close()
+async cmd(command, data?) Object
+async publish(sdp, options) string
+async subscribe(sdp, options) string
}
class Publish {
+async connect(options)
+async record()
+async unrecord()
}
class View {
+async connect(options)
+async select(layer)
+async addRemoteTrack(media, streams)
+async project(sourceId, mapping)
+async unproject(mediaIds)
}
class Director {
<<Singleton>>
+getPublisher(publishToken, streamName, streamType?)
+getSubscriber(streamName, streamAccountId, subscribeToken?)
}
class SdpParser {
<<Singleton>>
+setStereo(sdp) string
+setDTX(sdp) string
+setVideoBitrate(sdp, bitrate) string
+setSimulcast(sdp, codec) string
}
class Logger {
<<Singleton>>
+get() Logger
+getLevel() LogLevel
+setLevel()
+debug(string)
+info(string)
+warn(string)
+error(string)
+time(string)
}
EventEmitter <|-- BaseWebRTC
EventEmitter <|-- PeerConnection
EventEmitter <|-- Signaling
BaseWebRTC <|-- Publish
BaseWebRTC <|-- View
BaseWebRTC *-- PeerConnection
BaseWebRTC *-- Signaling
Signaling <-- SdpParser
PeerConnection <-- SdpParser
Publish <-- Director : getPublisher
View <-- Director: getSubscriber
BaseWebRTC <-- Logger
Director <-- Logger
Signaling <-- Logger
PeerConnection <-- Logger
Publish <-- Logger
View <-- Logger
SdpParser <-- Logger
```
10 changes: 5 additions & 5 deletions packages/millicast-publisher-demo/src/publisher.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ document.addEventListener("DOMContentLoaded", async (event) => {

const BroadcastMillicastStream = async () => {
try{
await millicastPublishUserMedia.connect({ bandwidth, events: events })
const params = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams, prop) => searchParams.get(prop),
});
let priority = parseInt(params.priority);
await millicastPublishUserMedia.connect({ bandwidth, events: events, priority })
isBroadcasting = true;
broadcastHandler();
setUserCount();
Expand Down Expand Up @@ -414,12 +418,9 @@ document.addEventListener("DOMContentLoaded", async (event) => {
txt.style.position = 'fixed';
txt.style.left = '-9999px';
document.body.appendChild(txt);
//console.log('view: ', txt);

let iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
//let txt = input;
if (iOS) {
console.log('IS iOS!');
txt.setAttribute('contenteditable', true);
txt.setAttribute('readonly', false);
let range = document.createRange();
Expand All @@ -431,7 +432,6 @@ document.addEventListener("DOMContentLoaded", async (event) => {
txt.setAttribute('contenteditable', false);
txt.setAttribute('readonly', true);
} else {
//console.log('NOT iOS!');
txt.select();
}
document.execCommand('copy');
Expand Down
31 changes: 0 additions & 31 deletions packages/millicast-sdk/docs-translations/en/Director.json

This file was deleted.

29 changes: 0 additions & 29 deletions packages/millicast-sdk/docs-translations/en/Logger.json

This file was deleted.

Loading

0 comments on commit 567d779

Please sign in to comment.