49 lines
1.0 KiB
JavaScript
49 lines
1.0 KiB
JavaScript
'use strict'
|
|
/**
|
|
* @author Nicolas Stein
|
|
* @category Core
|
|
* @subcategory Libraries
|
|
* @requires MessageBus
|
|
*/
|
|
class Ptp {
|
|
|
|
/**
|
|
*
|
|
* @param {*} config
|
|
* @param {*} userInfo
|
|
*/
|
|
constructor(config, userInfo){
|
|
this.config = config
|
|
this.userInfo = userInfo
|
|
if(!app.MessageBus) {
|
|
throw('Ptp depends upon MessageBus which is absent !')
|
|
}
|
|
}
|
|
|
|
/* uses msgBus to check get remoteUser online browsers
|
|
Remote UIs let the user accept the invite (and it selects which browser to use for Ptp)
|
|
Accepting the invite is done by sending back his browserId
|
|
Remote can only accept invite if Ptp is enabled, & userAgent is compatible.
|
|
|
|
Resolves to null or browserId
|
|
|
|
*/
|
|
invite(remoteUser){
|
|
return(new Promise(
|
|
|
|
))
|
|
}
|
|
|
|
/*
|
|
uses msgBus to make the WRTC initial handshake
|
|
*/
|
|
wrHandshake(remoteBrowserId){
|
|
return(new Promise(
|
|
|
|
))
|
|
}
|
|
}
|
|
|
|
app.registerClass('Ptp', Ptp);
|
|
|