Skip to content

Instantly share code, notes, and snippets.

@photofroggy
Created April 20, 2014 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save photofroggy/11108811 to your computer and use it in GitHub Desktop.
Save photofroggy/11108811 to your computer and use it in GitHub Desktop.
Video Chat Server
Video calls should be associated with a particular channel.
They should also have a host.
Should users have privilege levels?
Data:
User
Connection
Stream(s?)
Privileges?
Call?
Channel
Call
Peer
User
Connection conn
String username
Bool authed
Call call
Peer[] peers
Channel
Call[] calls
String namespace
Call
String id/name
User host
User[] users
Log in?
How would we make this seamless for userscripts?
Would be inconvenient to require the user retrieve a token...
Maybe make an API method for retrieving oauth tokens...
Or maybe just use the dAmn tokens and use the existing API method
in a userscript?
{
cmd: 'login',
username: username,
token: oauth_token?
}
{
cmd: 'login',
status: 0 || 1 || ... 0 = ok
[error: description]
}
Need to be able to request the list of open calls in a channel.
{
cmd: 'call.list',
channel: 'chat:devart'
}
Should return a call listing.
{
cmd: 'call.list',
channel: 'chat:devart',
calls: [
id1,
id2,
...
]
}
Create a call
{
cmd: 'call.create',
channel: 'chat:devart',
id: 'name'
}
Call created
{
cmd: 'call.open',
channel: 'chat:devart',
id: 'name',
host: 'username'
}
Join a call?
{
cmd: 'call.join',
channel: 'chat:devart',
call: id
}
Indicate joined
{
cmd: 'call.join',
channel: 'chat:devart',
call: id,
meta?
}
Leaving
Can only be in one call at a time.
{ cmd: 'call.leave' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment