topaz
1.0.0
基于Kolson25/Webrtc-Multi-Peer-Video-Audio,该项目旨在尝试WEBRTC。
您可以在topaz.h91.co上尝试一下
要运行该项目,只需在文件夹中复制Docker-compose.yml并运行以下命令:
docker-compose up -d
要测试它,您必须访问https:// localhost:3000。
确保使用SSL(例如,通过反向代理),或者您无法访问相机。
为了开发,我使用了Ngrok,它对HTTPS可靠,甚至与远程人员进行测试:-)
您可以复制并设置自己的config.json.dist。目前,配置仅适用于聊天插件。
要创建一个插件,您将需要创建一个具有以下结构的JS文件:
module . exports = function ( config , formatResponse ) {
return {
supports ( username , avatar , message ) {
// return true if the plugin should be used.
// for example : return message.startsWith("/hello")
return true
} ,
transform ( username , avatar , message ) {
if ( config . some_random_config == "SOME VALUE" ) {
console . log ( "do something" )
}
// should return a formatResponse in order to be processable.
return formatResponse ( message , avatar , message )
} ,
} ;
} ;支持是用于检查插件是否应操纵消息的功能。检测某人已被引用,或者字符串启动/包含某些内容可能会很有用。
转换采用用户名,化身,消息,如果支持返回为真,将应用转换。您可以使用FormatResponse返回良好格式,也可以使用以下语法手动进行:
{
"author" : " username " ,
"avatar" : {
"avatar" : " bear " ,
"color" : " red " ,
"image" : " <svg.../> "
},
"message" : " SOME MESSAGE "
}
为了启用插件,将其添加到_plugins.js文件:示例:
module . exports = {
me : "./plugins/me.js" ,
giphy : "./plugins/giphy.js" ,
pluginName : "./path/to/file.js"
}该插件名称用于检索config.json中存储的配置。
{
"plugins" : {
"giphy" : {
"api_key" : " GIPHY API KEY "
},
"pluginName" : {
"some_random_config" : " SOME_VALUE "
}
}
}屏幕共享是在早期开发中,尝试一下,在浏览器上启动一个新标签,然后转到/screen.html我试图合并两者,但对我来说似乎有些复杂,因为我不觉得与JavaScript感到满意:)。