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感到滿意:)。