0.5.2 • Published 3 years ago

hallo-client v0.5.2

Weekly downloads
38
License
MIT
Repository
github
Last release
3 years ago

hallo client

Simple webrtc client for hallo-server.

usage

const iceServers = {
  iceServers: [{ urls: 'stun:stun.l.google.com:19302'}]
}

const showWebcam = () => navigator.mediaDevices.getUserMedia({ audio: false, video: true })
const showMonitor = () => navigator.mediaDevices.getDisplayMedia({ video: {displaySurface: "monitor"} })

// Create new client
const hallo = new HalloClient(iceServers)

// Prepare event handlers
hallo.on('joined', ({username, room, id}) => doStuff())
hallo.on('left', ({username, room, id}) => doStuff())
hallo.on('already_joined', ({username, room, id}) => doStuff())

hallo.on('add_remote_track', ({username, track}) => doStuff())
hallo.on('remove_remote_track', ({username, track}) => doStuff())

hallo.on('add_local_track', ({username, track}) => doStuff())
hallo.on('remove_local_track', ({username, track}) => doStuff())

hallo.on('message', (message) => doStuff())

// Join room
hallo.join("username", "a_room", showWebcam)

// Send message
hallo.send("another_username", {message: "hallo!"})

// Update stream by using new UserMedia
hallo.changeMediaLambda(showMonitor)

// Leave room
hallo.leave()
0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.3.2

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.3.1

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.0

3 years ago

0.0.3

3 years ago

0.1.1

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago