Skip to content

snowem/sdkjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is javascript sdk for snowem media server.

SDK Usage

To publish a stream:

var host = "localhost"
var config = {
  'type': 'camera',
  'localNode': document.getElementById('localVideo'),
  'mediaConstraints': {
    'audio': true,
    'video': true,
  },
}
var publishStream = new snowem.Stream(host, 8443)
publishStream.publish(config)

To play a stream:

var streamid = publishedStream.getStreamID()
var config = {
  'streamid': streamId,
  'remoteNode':  document.getElementById('remoteVideo'),
  'mediaConstraints': {
    'audio': true,
    'video': true
  }
};
var playStream = new snowem.Stream(host, 8443)
playStream.play(config)

Check here for more details on example code. Documentation at here