diff --git a/godot/README.md b/godot/README.md deleted file mode 100644 index 7f00df24..00000000 --- a/godot/README.md +++ /dev/null @@ -1,14 +0,0 @@ -## url parameters -widgetId = $matrix_widget_id -perParticipantE2EE = true -userId = $matrix_user_id -deviceId = $org.matrix.msc3819.matrix_device_id -baseUrl = $org.matrix.msc4039.matrix_base_url - -parentUrl = // will be inserted automatically - -http://localhost?widgetId=&perParticipantE2EE=true&userId=&deviceId=&baseUrl=&roomId= - --> - -http://localhost:3000?widgetId=$matrix_widget_id&perParticipantE2EE=true&userId=$matrix_user_id&deviceId=$org.matrix.msc3819.matrix_device_id&baseUrl=$org.matrix.msc4039.matrix_base_url&roomId=$matrix_room_id diff --git a/godot/favicon.ico b/godot/favicon.ico deleted file mode 100644 index e531e6f2..00000000 Binary files a/godot/favicon.ico and /dev/null differ diff --git a/index.html b/index.html index 2043b2aa..2cf11d1a 100644 --- a/index.html +++ b/index.html @@ -43,15 +43,5 @@ <% if (packageType !== "full") { %>
<% } %> - - - <% if (packageType === "godot") { %> - - - - <% } %> diff --git a/package.json b/package.json index c87d5b01..0b598e97 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "build:embedded": "yarn build:full --config vite-embedded.config.js", "build:embedded:production": "yarn build:embedded", "build:embedded:development": "yarn build:embedded --mode development", - "build:godot": "yarn build:full --config vite-godot.config.js", - "build:godot:development": "yarn build:godot --mode development", + "build:sdk": "yarn build:full --config vite-sdk.config.js", + "build:sdk:development": "yarn build:sdk --mode development", "serve": "vite preview", "prettier:check": "prettier -c .", "prettier:format": "prettier -w .", diff --git a/sdk/README.md b/sdk/README.md new file mode 100644 index 00000000..03801b83 --- /dev/null +++ b/sdk/README.md @@ -0,0 +1,35 @@ +# SDK mode + +EC can be build in sdk mode. This will result in a compiled js file that can be imported in very simple webapps. + +It allows to use matrixRTC in combination with livekit without relying on element call. + +This is done by instantiating the call view model and exposing some useful behaviors (observables) and methods. + +This folder contains an example index.html file that showcases the sdk in use (hosted on localhost:8123 with a webserver ellowing cors (for example `npx serve -l 81234 --cors`)) as a godot engine HTML export template. + +## Widgets + +The sdk mode is particularly interesting to be used in widgets where you do not need to pay attention to matrix login/cs api ... +To create a widget see the example index.html file in this folder. And add it to EW via: +`/addwidget ` (see **url parameters** for more details on ``) + +### url parameters + +``` +widgetId = $matrix_widget_id +perParticipantE2EE = true +userId = $matrix_user_id +deviceId = $org.matrix.msc3819.matrix_device_id +baseUrl = $org.matrix.msc4039.matrix_base_url +``` + +`parentUrl = // will be inserted automatically` + +Full template use as ``: + +``` +http://localhost:3000?widgetId=$matrix_widget_id&perParticipantE2EE=true&userId=$matrix_user_id&deviceId=$org.matrix.msc3819.matrix_device_id&baseUrl=$org.matrix.msc4039.matrix_base_url&roomId=$matrix_room_id +``` + +the `$` prefixed variables will be replaced by EW on widget instantiation. (e.g. `$matrix_user_id` -> `@user:example.com` (url encoding will also be applied automatically by EW) -> `%40user%3Aexample.com`) diff --git a/godot/helper.ts b/sdk/helper.ts similarity index 94% rename from godot/helper.ts rename to sdk/helper.ts index 8f5c710e..7dc2138a 100644 --- a/godot/helper.ts +++ b/sdk/helper.ts @@ -5,6 +5,10 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ +/** + * This file contains helper functions and types for the MatrixRTC SDK. + */ + import { logger as rootLogger } from "matrix-js-sdk/lib/logger"; import { scan } from "rxjs"; diff --git a/godot/index.html b/sdk/index.html similarity index 95% rename from godot/index.html rename to sdk/index.html index 39bcf484..c66274ff 100644 --- a/godot/index.html +++ b/sdk/index.html @@ -4,8 +4,8 @@ Godot MatrixRTC Widget