architwin 1.2.2 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +1614 -643
  2. package/lib/architwin.d.ts +11 -21
  3. package/lib/architwin.js +1 -1
  4. package/lib/atwinui/components/toolbar/index.d.ts +2 -2
  5. package/lib/atwinui/components/toolbar/index.js +2 -2
  6. package/lib/atwinui/components/toolbar/modal.d.ts +3 -1
  7. package/lib/atwinui/components/toolbar/modal.js +29 -8
  8. package/lib/atwinui/components/toolbar/tagListPane.js +5 -1
  9. package/lib/atwinui/index.d.ts +2 -1
  10. package/lib/atwinui/index.js +2 -2
  11. package/lib/convert.d.ts +1 -13
  12. package/lib/convert.js +6 -47
  13. package/lib/loaders/planeGeometry2.d.ts +10 -0
  14. package/lib/loaders/planeGeometry2.js +56 -3
  15. package/lib/minimap.d.ts +7 -1
  16. package/lib/minimap.js +42 -2
  17. package/lib/tag.d.ts +2 -1
  18. package/lib/tag.js +3 -1
  19. package/lib/types.d.ts +13 -11
  20. package/lib/types.js +2 -0
  21. package/package.json +2 -2
  22. package/pre_deploy.sh +53 -0
  23. package/lib/architwin.min.js +0 -1
  24. package/lib/atwinui/components/toolbar/menu-bar.d.ts +0 -4
  25. package/lib/atwinui/components/toolbar/menu-bar.js +0 -35
  26. package/lib/atwinui/components/toolbar/sidebar-container.d.ts +0 -5
  27. package/lib/atwinui/components/toolbar/sidebar-container.js +0 -27
  28. package/lib/components/Container.d.ts +0 -4
  29. package/lib/components/Container.js +0 -12
  30. package/lib/components/componentBuilder.d.ts +0 -4
  31. package/lib/components/componentBuilder.js +0 -53
  32. package/lib/components/events.d.ts +0 -9
  33. package/lib/components/events.js +0 -151
  34. package/lib/components/index.d.ts +0 -5
  35. package/lib/components/index.js +0 -52
  36. package/lib/mediascreen.d.ts +0 -8
  37. package/lib/mediascreen.js +0 -242
  38. package/lib/supervizTypes.js +0 -95
package/README.md CHANGED
@@ -32,10 +32,10 @@ ArchiTwin Library
32
32
  - [Adding a Media Screen](#adding-a-media-screen)
33
33
  - [Media Screen Parameter Reference](#media-screen-parameter-reference)
34
34
  - [Attaching an image or video to a Media Screen](#attaching-an-image-or-video-to-a-media-screen)
35
+ - [Hiding expand/dock buttons of Media Screens](#hiding-expanddock-buttons-of-media-screens)
35
36
  - [Setting Video Playback in the Space](#setting-video-playback-in-the-space)
36
37
  - [Setting Animation Control in the Space](#setting-animation-control-in-the-space)
37
38
  - [Copying object To Your Space](#copying-object-to-your-space)
38
- - [Adding Object, Getting Object, Updating Object, Deleting Object in the Database](#adding-object-getting-object-updating-object-deleting-object-in-the-database)
39
39
  - [Navigate to Object](#navigate-to-object)
40
40
  - [Deleting Object To Your Space](#deleting-object-to-your-space)
41
41
  - [Replacing Object To Your Space](#replacing-object-to-your-space)
@@ -45,7 +45,7 @@ ArchiTwin Library
45
45
  - [Tag Interfaces](#tag-interfaces)
46
46
  - [Object Interfaces](#object-interfaces)
47
47
  - [Meeting Interfaces](#meeting-interfaces)
48
- - [Meeting Guide](#meeting-guide)
48
+ <!-- - [Meeting Guide](#meeting-guide)
49
49
  - [Create Meeting](#create-meeting)
50
50
  - [Start Meeting](#start-meeting)
51
51
  - [Stop Meeting](#stop-meeting)
@@ -57,35 +57,47 @@ ArchiTwin Library
57
57
  - [Meeting Custom Avatar](#meeting-custom-avatar)
58
58
  - [Meeting Device Control](#meeting-device-control)
59
59
  - [Meeting Bar Position](#meeting-bar-position)
60
- - [Meeting Status](#meeting-status)
60
+ - [Meeting Status](#meeting-status) -->
61
+ - [Meeting UI Guide](#meeting-ui-guide)
62
+ - [Enable Meeting Sidebar](#enable-meeting-sidebar)
63
+ - [Create Meeting](#create-meeting)
64
+ - [Pre-Meeting Setup](#pre-meeting-setup)
65
+ - [Join Meeting](#jpin-meeting)
66
+ - [In-Meeting](#in-meeting)
61
67
  - [Function Reference](#function-reference)
62
68
  - [Space](#space)
63
69
  - [connectSpace()](#connectspace)
64
70
  - [Config Options](#config-options)
65
71
  - [Minimap Config](#minimap-config)
72
+ - [Toolbar Config](#toolbar-config)
73
+ - [App Config](#app-config)
74
+ - [Restriction Config](#restriction-config)
75
+ - [Debug Config](#debug-config)
66
76
  - [disconnectSpace()](#disconnectspace)
67
77
  - [Tags](#tags)
68
78
  - [getTags()](#gettags)
69
79
  - [gotoTag()](#gototag)
70
- - [renderTag()](#rendertag)
71
- - [getMpTags()](#getmptags)
72
- - [getMpTag()](#getmptag)
73
- - [showTags()](#showtags)
74
- - [disposeTags()](#disposetags)
75
- - [disposeTag()](#disposetag)
76
- - [attachTagMedia()](#attachtagmedia)
77
- - [detachTagMedia()](#detachtagmedia)
78
- - [moveTag()](#movetag)
79
- - [editTagLabel()](#edittaglabel)
80
- - [editTagDescription()](#edittagdescription)
81
- - [editTagIcon()](#edittagicon)
82
- - [editTagStem()](#edittagstem)
83
- - [editTagColor()](#edittagcolor)
80
+ - [renderTag()](#rendertag)
81
+ - [getMpTags()](#getmptags)
82
+ - [getMpTag()](#getmptag)
83
+ - [showTags()](#showtags)
84
+ - [disposeTags()](#disposetags)
85
+ - [disposeTag()](#disposetag)
86
+ - [attachTagMedia()](#attachtagmedia)
87
+ - [detachTagMedia()](#detachtagmedia)
88
+ - [moveTag()](#movetag)
89
+ - [editTagLabel()](#edittaglabel)
90
+ - [editTagDescription()](#edittagdescription)
91
+ - [editTagIcon()](#edittagicon)
92
+ - [editTagStem()](#edittagstem)
93
+ - [editTagColor()](#edittagcolor)
84
94
  - [Sweeps](#sweeps)
85
95
  - [getSweeps()](#getsweeps)
86
96
  - [moveToSweep()](#movetosweep)
87
97
  - [getNearbySweeps()](#getnearbysweeps)
88
98
  - [getCurrentSweep()](#getcurrentsweep)
99
+ - [getCurrentSweepPosition()](#getcurrentsweepposition)
100
+ - [getAllSweeps()](#getallsweeps)
89
101
  - [Video](#video)
90
102
  - [playVideo()](#playvideo)
91
103
  - [pauseVideo()](#pausevideo)
@@ -103,7 +115,6 @@ ArchiTwin Library
103
115
  - [captureSpaceScreenshot()](#capturespacescreenshot)
104
116
  - [Objects](#objects)
105
117
  - [getNearbyObjects()](#getnearbyobjects)
106
- - [addObjectToSpace()](#addobjecttospace)
107
118
  - [addMediaScreen()](#addmediascreen)
108
119
  - [setTransformMode()](#settransformmode)
109
120
  - [revertTransform()](#reverttransform)
@@ -111,30 +122,58 @@ ArchiTwin Library
111
122
  - [setAnimationState()](#setanimationstate)
112
123
  - [showObjectDimensions()](#showobjectdimensions)
113
124
  - [copyObject()](#copyobject)
114
- - [addObject()](#addobject)
115
- - [getObject()](#getobject)
116
- - [updateObject()](#updateobject)
117
125
  - [deleteObject()](#deleteobject)
118
- - [goTo3dx()](#goto3dx)
119
126
  - [deleteObjectFromSpace()](#deleteobjectfromspace)
120
127
  - [replaceObject()](#replaceobject)
121
128
  - [addTextMarkupScreen()](#addtextmarkupscreen)
122
129
  - [setTextMarkupScreenContent()](#settextmarkupscreencontent)
123
- - [getNearestSweepFromObject()](#getnearestsweepfromobject)
124
- - [Meeting](#meeting)
125
- - [createMeeting()](#createmeeting)
126
- - [startMeeting()](#startmeeting)
127
- - [stopMeeting()](#stopmeeting)
128
- - [getMeeting()](#getmeeting)
129
- - [getMeetingParticipants()](#getmeetingparticipants)
130
- - [getSpaceMeetings()](#getspacemeetings)
131
- - [generateMeetingURL()](#generatemeetingurl)
132
- - [isMeetingExists()](#ismeetingexists)
133
- - [isMeetingActive()](#ismeetingactive)
134
- - [updateMeetingTitle()](#updatemeetingtitle)
135
- - [updateMeetingStart()](#updatemeetingstart)
136
- - [updateMeetingStatus()](#updatemeetingstatus)
137
- - [updateMeetingSpace()](#updatemeetingspace)
130
+ - [getNearestSweepFromObject()](#getnearestsweepfromobject)
131
+ - [setSelectedObject()](#setselectedobject)
132
+ - [getSelectedObject()](#getselectedobject)
133
+ - [clearSelectedObject()](#clearselectedobject)
134
+ - [goToModel()](#gotomodel)
135
+ - [get3DXObjects()](#get3dxobjects)
136
+ - [setLibrary()](#setlibrary)
137
+ - [getLibrary()](#getlibrary)
138
+ - [disposeModel()](#disposemodel)
139
+ <!-- - [Meeting](#meeting)
140
+ - [createMeeting()](#createmeeting)
141
+ - [startMeeting()](#startmeeting)
142
+ - [stopMeeting()](#stopmeeting)
143
+ - [getMeeting()](#getmeeting)
144
+ - [getMeetingParticipants()](#getmeetingparticipants)
145
+ - [getSpaceMeetings()](#getspacemeetings)
146
+ - [generateMeetingURL()](#generatemeetingurl)
147
+ - [isMeetingExists()](#ismeetingexists)
148
+ - [isMeetingActive()](#ismeetingactive)
149
+ - [updateMeetingTitle()](#updatemeetingtitle)
150
+ - [updateMeetingStart()](#updatemeetingstart)
151
+ - [updateMeetingStatus()](#updatemeetingstatus)
152
+ - [updateMeetingSpace()](#updatemeetingspace) -->
153
+ - [Virtual Meeting](#virtual-meeting)
154
+ - [createMeeting()](#createmeeting)
155
+ - [joinMeeting()](#joinmeeting)
156
+ - [leaveMeeting()](#leavemeeting)
157
+ - [startVideo()](#startvideo)
158
+ - [stopVideo()](#stopvideo)
159
+ - [startLocalVideo()](#startlocalvideo)
160
+ - [stopLocalVideo()](#stoplocalvideo)
161
+ - [startAudio()](#startaudio)
162
+ - [stopAudio()](#stopaudio)
163
+ - [muteAudio()](#muteaudio)
164
+ - [unMuteAudio()](#unmuteaudio)
165
+ - [muteLocalAudio()](#mutelocalaudio)
166
+ - [unMuteLocalAudio()](#unmutelocalaudio)
167
+ - [getDevices()](#getdevices)
168
+ - [switchMicrophone()](#switchmicrophone)
169
+ - [switchSpeaker()](#switchspeaker)
170
+ - [switchCamera()](#switchcamera)
171
+ - [getMicList()](#getmiclist)
172
+ - [getSpeakerList()](#getspeakerlist)
173
+ - [getCameraList()](#getcameralist)
174
+ - [createLocalVideoTrack()](#createlocalvideotrack)
175
+ - [createLocalAudioTrack()](#createlocalaudiotrack)
176
+ - [initializeHTMLElements()](#initializehtmlelements)
138
177
 
139
178
  ## Installation
140
179
  ### Install Using NPM
@@ -553,10 +592,40 @@ You can subscribe your method to more than one event. Currently, we support subs
553
592
  **SUPPORTED EVENTS**
554
593
 
555
594
  - CLICK
595
+ - HOVER
596
+ - DRAG
597
+ - BRAG_BEGIN
556
598
  - DRAG_END
557
599
  - LOADING_PHASE
558
600
  - STARTING_PHASE
559
601
  - PLAYING_PHASE
602
+ - PLACED_TAG
603
+ - TAG_SAVED
604
+ - TAG_DISPOSED
605
+ - MEDIASCREEN_EXPANDED
606
+ - MEDIASCREEN_MINIMIZED
607
+ - MEDIA_PLAY
608
+ - MEDIA_PAUSE
609
+ - MEDIA_MUTE
610
+ - MEDIA_UNMUTE
611
+ - PARTICIPANT_ADDED
612
+ - PARTICIPANT_REMOVED
613
+ - PARTICIPANT_VIDEO_ON
614
+ - PARTICIPANT_VIDEO_OFF
615
+ - PARTICIPANT_AUDIO_STATE
616
+ - MEETING_ENDED
617
+ - SELECTED_TAG
618
+ - MODEL_RENDERED
619
+ - MODEL_DISPOSED
620
+ - TAG_MESSAGE_OPENED
621
+ - TAG_MESSAGE_SENT
622
+ - TAG_MESSAGE_RETRIEVED
623
+ - TAG_RECEPIENT_CHANGED
624
+ - TAG_LINK_COPIED
625
+ - TAG_LINK_GENERATED
626
+ - SET_TAG_ICON
627
+ - VIEW_TAG_MESSAGE
628
+ - TOOLBAR_LOADED
560
629
 
561
630
  For more information regarding the loading,starting, and playing phase events. Please refer to [this section](#executing-methods-on-specific-app-phases)
562
631
 
@@ -1171,7 +1240,7 @@ Tags are interactive elements that can be added to a 3D Space. Tags are essentia
1171
1240
 
1172
1241
  To render a tag in the Space, you can use [renderTag()](#rendertag) method. The [renderTag()](#rendertag) method accepts payload input.
1173
1242
 
1174
- *Example*
1243
+ *Example:*
1175
1244
  ```typescript
1176
1245
  import * as atwin from 'architwin'
1177
1246
 
@@ -1209,7 +1278,7 @@ const tag = {
1209
1278
 
1210
1279
  To remove a tag in the Space, you can use [disposeTags()](#disposetags). The [disposeTags()](#disposetags) has no parameter.
1211
1280
 
1212
- *Example*
1281
+ *Example:*
1213
1282
  ```typescript
1214
1283
  import * as atwin from 'architwin'
1215
1284
 
@@ -1230,7 +1299,7 @@ removeTagsFromSpace();
1230
1299
 
1231
1300
  Removing a specific tag in the Space, the [disposeTag](#disposetag) is the right method to use.
1232
1301
 
1233
- *Example*
1302
+ *Example:*
1234
1303
  ```typescript
1235
1304
  import * as atwin from 'architwin'
1236
1305
 
@@ -1250,7 +1319,7 @@ Tags are customizables, you customize tag labels, description, stem, icon and it
1250
1319
 
1251
1320
  [editTagLabel()](#edittaglabel) is the right method to change or edit the label of a specific tag.
1252
1321
 
1253
- *Example*
1322
+ *Example:*
1254
1323
  ```typescript
1255
1324
  import * as atwin from 'architwin'
1256
1325
 
@@ -1270,7 +1339,7 @@ try {
1270
1339
  To edit or change the description of a tag, the [editTagDescription()](#edittagdescription) is the method you can use.
1271
1340
 
1272
1341
 
1273
- *Example*
1342
+ *Example:*
1274
1343
  ```typescript
1275
1344
  import * as atwin from 'architwin'
1276
1345
 
@@ -1289,7 +1358,7 @@ try {
1289
1358
 
1290
1359
  You can also choose not show or hide the tag stem by invoking [editTagStem()](#edittagstem).
1291
1360
 
1292
- *Example*
1361
+ *Example:*
1293
1362
  ```typescript
1294
1363
  import * as atwin from 'architwin'
1295
1364
 
@@ -1308,7 +1377,7 @@ try {
1308
1377
 
1309
1378
  Tag icon also editable, you can utilize the [editTagIcon()](#edittagicon) method for this.
1310
1379
 
1311
- *Example*
1380
+ *Example:*
1312
1381
  ```typescript
1313
1382
  import * as atwin from 'architwin'
1314
1383
 
@@ -1328,7 +1397,7 @@ try {
1328
1397
 
1329
1398
  You can also change the color of the tag itself, just use the [editTagColor()](#edittagcolor) method.
1330
1399
 
1331
- *Example*
1400
+ *Example:*
1332
1401
  ```typescript
1333
1402
  import * as atwin from 'architwin'
1334
1403
 
@@ -1347,7 +1416,7 @@ try {
1347
1416
 
1348
1417
  Ataching media to a tag is also possible, you can utilize the [attachTagMedia()](#attachtagmedia) method.
1349
1418
 
1350
- *Example*
1419
+ *Example:*
1351
1420
  ```typescript
1352
1421
  import * as atwin from 'architwin'
1353
1422
 
@@ -1366,7 +1435,7 @@ try {
1366
1435
 
1367
1436
  You can also remove the attached media, just call the [detachTagMedia()](#detachtagmedia) method.
1368
1437
 
1369
- *Example*
1438
+ *Example:*
1370
1439
  ```typescript
1371
1440
  import * as atwin from 'architwin'
1372
1441
 
@@ -1817,7 +1886,7 @@ await atwin.getTargetPosition(myCallbackFunction)
1817
1886
 
1818
1887
  In this example, we are using a link pointing to the media stored in an s3 bucket as the mediaUrl and a random media screen id. You will have to substitute the id with an actual id of a rendered media screen.
1819
1888
 
1820
- Example with image:
1889
+ *Example with image:*
1821
1890
  ```typescript
1822
1891
  import * as atwin from 'architwin';
1823
1892
 
@@ -1831,7 +1900,7 @@ atwin.attachMediaScreenContent(targetMediaScreenId, validUrl, 'image')
1831
1900
  ...
1832
1901
  ```
1833
1902
 
1834
- Example with video:
1903
+ *Example with video:*
1835
1904
  ```typescript
1836
1905
  import * as atwin from 'architwin';
1837
1906
 
@@ -1861,7 +1930,7 @@ export interface IObjectData {
1861
1930
  }
1862
1931
  ```
1863
1932
 
1864
- *Example*
1933
+ *Example:*
1865
1934
  ```typescript
1866
1935
  import * as atwin from 'architwin';
1867
1936
 
@@ -1915,7 +1984,7 @@ Inorder to set the playback of a video, you may use the [setVideoPlayback()](#se
1915
1984
 
1916
1985
  If you wish to change the action of the playback, add a parameter such as 'play','pause', 'mute', 'unmute' depending on your preference.
1917
1986
 
1918
- Example:
1987
+ *Example:*
1919
1988
  ```typescript
1920
1989
  import * as atwin from 'architwin';
1921
1990
 
@@ -2005,194 +2074,12 @@ if (atwin.selectedObject.object) {
2005
2074
  ```
2006
2075
  **NOTE:** rotation_offset can be manipulated in order to mirror the object
2007
2076
 
2008
- ### Adding Object, Getting Object, Updating Object, Deleting Object in the Database
2009
-
2010
- **Adding Object**: Adding an object in the database refers to the process of creating and inserting a new record into a data table. This involves providing the necessary data and attributes that define the object, and then store the object in the database. The newly added object becomes a part of the dataset and can be retrieved and manipulated as needed.
2011
-
2012
- In order to add an object in the database, you may use the [addObject()](#addobject) method. Assuming that you have already setup to have an event listener for file upload.
2013
-
2014
- | parameter | type | required | default | values |
2015
- | :----: | :----: | :---: | :---: | :---: |
2016
- | payload | FileUpload | yes | | |
2017
-
2018
- ```typescript
2019
- import * as atwin from 'architwin';
2020
-
2021
- ...
2022
-
2023
- let upload = {
2024
- file: null,
2025
- filename: '',
2026
- upload_filename: '',
2027
- user_id: 1,
2028
- object_key: '',
2029
- description: '',
2030
- name: '',
2031
- object_type: ''
2032
- }
2033
-
2034
- // this function handles the file upload of the user
2035
- function handleFileUpload(e: Event) {
2036
- if (!e.target) {
2037
- return
2038
- }
2039
- if (!upload) {
2040
- console.error("Upload object is undefined")
2041
- return
2042
- }
2043
- upload.file = e.target.files[0];
2044
- if (!upload.file) {
2045
- console.error("File is undefined")
2046
- return
2047
- }
2048
-
2049
- // the name of the file - ex. image
2050
- upload.name = upload.file.name
2051
- // the filename of the file - ex. image.jpg
2052
- upload.filename = upload.file.name
2053
- // the file type of the file - ex. JPG
2054
- upload.object_type = upload.filename.slice((upload.filename.lastIndexOf(".") - 1 >>> 0) + 2).toUpperCase()
2055
- // id to user_id
2056
- upload.user_id = 1
2057
- // this will become the unique id or filename of the file when stored to amazon
2058
- upload.object_key = "asdhj-231d-2asd-2jks9-8d8s2"
2059
-
2060
- //@ts-ignore
2061
- e.target.value = ''
2062
- }
2063
-
2064
- // this function handles the object to be added in the database
2065
- async function handleAddObject() {
2066
- if (!upload) {
2067
- alert("Object payload is empty")
2068
- return
2069
- }
2070
- if (!upload.name) {
2071
- alert("Enter a valid file name")
2072
- return
2073
- }
2074
- await atwin.addObject(upload)
2075
- }
2076
-
2077
- ...
2078
- ```
2079
-
2080
- **Getting Object**: Getting an object in the database refers to the action of retrieving a specific record from a data table. Once retrieved, the object's information and attributes can be utilized for various purposes, such as displaying data to the user or displaying the object into the space.
2081
-
2082
- In order to get an object in the database, you may use the [getObject()](#getobject) method.
2083
-
2084
- | parameter | type | required | default | values |
2085
- | :----: | :----: | :---: | :---: | :---: |
2086
- | id | number | yes | | |
2087
-
2088
- ```typescript
2089
- import * as atwin from 'architwin';
2090
-
2091
- ...
2092
-
2093
- const objectId:number = 5
2094
- let objectPayload:I3DObject;
2095
-
2096
- // this function handles the object to be retrieved in the database
2097
- async function handleGetObject() {
2098
- if (!objectId) {
2099
- return
2100
- }
2101
- const objectData = await atwin.getObject(objectId)
2102
- if (objectData) {
2103
- objectPayload = objectData
2104
- }
2105
- }
2106
-
2107
- ...
2108
- ```
2109
-
2110
- Now that you already get the object and store it in the variable objectPayload, you may now place the object in the space by using [addObjectToSpace()](#addobjecttospace) method and pass the objectPayload in the parameter.
2111
-
2112
- ```typescript
2113
- import * as atwin from 'architwin';
2114
-
2115
- ...
2116
-
2117
- if (objectPayload) {
2118
- await atwin.addObjectToSpace(objectPayload)
2119
- }
2120
-
2121
- ...
2122
- ```
2123
- **Updating Object**: Updating an object in the database involves modifying the attributes or properties of an existing record from a data table.
2124
-
2125
- In order to update an object in the database, you may use the [updateObject()](#updateobject) method.
2126
-
2127
- | parameter | type | required | default | values |
2128
- | :----: | :----: | :---: | :---: | :---: |
2129
- | id | number | yes | | |
2130
- | payload | FileUpload | yes | | |
2131
-
2132
- ```typescript
2133
- import * as atwin from 'architwin';
2134
-
2135
- ...
2136
-
2137
- const objectId:number = 5
2138
- let objectPayload:I3DObject
2139
-
2140
- // this function handles the object to be retrieved in the database
2141
- async function handleGetObject() {
2142
- if (!objectId) {
2143
- return
2144
- }
2145
- const objectData = await atwin.getObject(objectId)
2146
- if (objectData) {
2147
- objectPayload = objectData
2148
- }
2149
- }
2150
-
2151
- // this function handles the object to be updated in the database
2152
- async function handleUpdateObject() {
2153
- if (!objectId) {
2154
- return
2155
- }
2156
- if (!objectPayload) {
2157
- return
2158
- }
2159
- await atwin.updateObject(objectID, objectPayload)
2160
- }
2161
-
2162
- ...
2163
- ```
2164
- **Deleting Object**: Deleting an object in the database refers to the process of removing a specific record from a data table. This operation permanently erases the object from the database, making its data and attributes no longer accessible.
2165
-
2166
- In order to delete an object in the databse, you may use the [deleteObject()](#deleteobject) method.
2167
-
2168
- | parameter | type | required | default | values |
2169
- | :----: | :----: | :---: | :---: | :---: |
2170
- | id | number | yes | | |
2171
-
2172
- ```typescript
2173
- import * as atwin from 'architwin';
2174
-
2175
- ...
2176
-
2177
- const objectId:number = 5
2178
-
2179
- // this function handles the object to be deleted in the database
2180
- async function handleDeleteObject() {
2181
- if (!objectId) {
2182
- return
2183
- }
2184
-
2185
- atwin.deleteObject(objectId)
2186
- }
2187
-
2188
- ...
2189
- ```
2190
2077
 
2191
2078
  ### Navigate to Object
2192
2079
 
2193
2080
  Navigating to an object in space refers to the process of moving the camera's location near to the object.
2194
2081
 
2195
- Assuming that you have already selected an object to navigate to, you may now navigate to the object by using [goTo3dx()](#goto3dx) method.
2082
+ Assuming that you have already selected an object to navigate to, you may now navigate to the object by using [goToModel()](#goToModel) method.
2196
2083
 
2197
2084
  | parameter | type | required | default | values |
2198
2085
  | :----: | :----: | :---: | :---: | :---: |
@@ -2203,7 +2090,7 @@ import * as atwin from 'architwin';
2203
2090
 
2204
2091
  ....
2205
2092
 
2206
- await atwin.goTo3dx(objectId)
2093
+ await atwin.goToModel(objectId)
2207
2094
 
2208
2095
  ....
2209
2096
 
@@ -2238,7 +2125,7 @@ async function handleDeleteObjectFromSpace() {
2238
2125
 
2239
2126
  Replacing an object in space refers to the process of substituting a pre-existing 2D or 3D object within a 3D environment or space with another object. This action involves removing the original object and introducing a new one in its place, while maintaining the object's location and any associated properties or attributes.
2240
2127
 
2241
- Assuming that you have already selected an object to be replaced, you may now delete the object by using [replaceObject()](#replaceobject) method.
2128
+ Assuming that you have already selected an object to be replaced, you may now replace the object by using [replaceObject()](#replaceobject) method.
2242
2129
 
2243
2130
  | parameter | type | required | default | values |
2244
2131
  | :----: | :----: | :---: | :---: | :---: |
@@ -2604,7 +2491,7 @@ interface IMpParticipant{
2604
2491
  ```
2605
2492
 
2606
2493
 
2607
- ## Meeting Guide
2494
+ <!-- ## Meeting Guide
2608
2495
 
2609
2496
  Hosting Live Virtual Meetings in 3D Space
2610
2497
 
@@ -3031,7 +2918,84 @@ export const enum MeetingStatus {
3031
2918
  STOPPED = 2,
3032
2919
  CANCELLED = 3,
3033
2920
  }
3034
- ````
2921
+ ```` -->
2922
+
2923
+
2924
+ ## Meeting UI Guide
2925
+
2926
+ Hosting Live Virtual Meetings inside 3D Space using Video SDK
2927
+
2928
+ This meeting feature utilizes the Video SDK to host virtual conferences within a 3D Space View. It includes a custom-designed meeting UI displayed as a sidebar on the left side of the screen. This allows the user to create, share, and join meetings using a meeting link provided by the host.
2929
+
2930
+ The next few sections will explain how you can get started in creating or hosting your own virtual meeting inside your 3D Spaces.
2931
+
2932
+ ### Enable Meeting Sidebar
2933
+
2934
+ Before you can start hosting or joining meetings, make sure that meeting sidebar is enabled in [toolbar Config](#toolbar-config).
2935
+
2936
+ *Example:*
2937
+
2938
+ ```typescript
2939
+ const config = {
2940
+ //Other config values...
2941
+ toolbarConfig: {
2942
+ active: isAtwinSideBarEnabled.value,
2943
+ lang: lang.value,
2944
+ menuItems: {
2945
+ meeting: true
2946
+ }
2947
+ },
2948
+ } as IMPConfig;
2949
+ ```
2950
+
2951
+ ### Create Meeting
2952
+
2953
+ Once the meeting sidebar is enabled, click the video icon in the toolbar, and the first screen that appears will be the create meeting screen.
2954
+
2955
+ The following data are required to proceed from the create meeting screen:
2956
+ - **Meeting Topic** : string - The name or topic of the meeting.
2957
+ - **Fullname** : string - The name of the participant.
2958
+
2959
+ <img src="https://i.ibb.co/WHbTfMF/createmeeting.png" />
2960
+
2961
+ ### Pre-Meeting Setup
2962
+
2963
+ This screen will allow users to set up their audio, speakers, and camera settings before entering the virtual conference.
2964
+
2965
+ #### Features
2966
+
2967
+ - **Audio**: Users can mute/unmute audio before joining the meeting.
2968
+ - **Camera**: Users can disable/enable camera view before joining the meeting.
2969
+ - **Choose Avatar**: Users can select an avatar and set as their profile during the meeting.
2970
+
2971
+ ##### Select video and audio device
2972
+
2973
+ - **Video**: Users can select any connected camera device they wish to use.
2974
+ - **Speaker**: Users can select any connected speaker device they wish to use.
2975
+ - **Microphone**: Users can select any connected microphone device they wish to use.
2976
+
2977
+ <img src="https://i.ibb.co/nwJ2pms/atwin-pre-meeting.png"/>
2978
+
2979
+ ### Join Meeting
2980
+
2981
+ Once a user visits the meeting link provided by the host, they will be automatically directed to the 3D Space view specific to that meeting. At the same time, the `join meeting` screen will be displayed, allowing users to enter the meeting. To proceed, users are required to input their name in the "Fullname" field before joining the meeting.
2982
+
2983
+ <img src="https://i.ibb.co/wWyvdhZ/atwin-join-meeting.png"/>
2984
+
2985
+ ### In-Meeting
2986
+
2987
+ This screen is where the virtual conference will take place. Both the host and participants can see and interact with each other through visual and audio communication.
2988
+
2989
+ #### Features
2990
+
2991
+ - **Meeting Controls**: The list of meeting controls includes settings, screen sharing, and toggles for video and audio.
2992
+ - **Settings**: This three-dots represents the settings of the sidebar. This is where users can view the list of participants, can follow a participant inside space view, and copy the meeting link.
2993
+ - **Share screen**: This screen button will allow users to share their screen to other participants within the meeting.
2994
+ - **Video**: This video icon button toggles the user's camera on or off.
2995
+ - **Audio**: This audio icon button toggles the user's microphone on or off.
2996
+
2997
+ <img src="https://i.ibb.co/hKG6BX5/atwin-in-meeting.png" />
2998
+
3035
2999
 
3036
3000
  ## Function Reference
3037
3001
  Some Functions are **async**; when invoking them, Use keyword **await** or **.then** syntax
@@ -3131,24 +3095,82 @@ If the parameters 'objectId,' 'tag,' and 'sweep' are present in the URL with val
3131
3095
  ##### Config Options
3132
3096
 
3133
3097
  ```typescript
3134
- export interface IMPConfig{
3135
- iframeId: string, // required
3136
- appKey?: string,
3137
- bundlePath?: string,
3138
- viewMode?: string
3139
- play?: 0 | 1,
3140
- qs?: 0 | 1,
3141
- tour?: 0 | 1 | 2 | 3,
3142
- vr?: 0 | 1,
3143
- mapConfig?: {
3144
- mapId: string
3145
- position?: string //topRight | topLeft | bottomRight | bottomLeft
3146
- fixedSized: {
3147
- width: number //Numerical pixel values
3148
- height?: number //Numerical pixel values
3149
- }
3150
- zIndex?: number
3151
- }
3098
+ export interface IMPConfig {
3099
+ iframeId: string;
3100
+ appKey?: string;
3101
+ bundlePath?: string;
3102
+ mapId?: string;
3103
+ meetingApiKey?: string,
3104
+ showOriginalTags?: boolean,
3105
+ // Launching 3D Showcase
3106
+ help?: 0 | 1 | 2;
3107
+ nt?: 0 | 1;
3108
+ play?: 0 | 1;
3109
+ qs?: 0 | 1;
3110
+ // Visibility
3111
+ brand?: 0 | 1;
3112
+ dh?: 0 | 1;
3113
+ tour?: 0 | 1 | 2 | 3;
3114
+ gt?: 0 | 1;
3115
+ hr?: 0 | 1;
3116
+ mls?: 0 | 1 | 2;
3117
+ mt?: 0 | 1;
3118
+ tagNav?: 0 | 1;
3119
+ pin?: 0 | 1;
3120
+ portal?: 0 | 1;
3121
+ // User Interface
3122
+ f?: 0 | 1;
3123
+ fp?: 0 | 1;
3124
+ // LOCALIZATION
3125
+ lang?: MP_LANG;
3126
+ // GUIDED TOURS
3127
+ kb?: 0 | 1;
3128
+ lp?: 0 | 1;
3129
+ st?: Number; // Number of milliseconds to wait at each highlight during a Guided Tour. Default is 3500 ms.
3130
+ title?: 0 | 1 | 2;
3131
+ tourcta?: 0 | 1 | 2;
3132
+ // Transition speed (meters per second) when moving between highlights. Recommend speed is in range of 1 to 3, default of 2. Your highlight reel must be set to "Walkthrough" mode (not slideshow)
3133
+ wts?: Number;
3134
+ // Set this parameter to start the tour automatically and define the number of seconds after initial fly-in before the Guided Tour automatically starts. Help is not shown. Set to a negative number to not start the Guided Tour.
3135
+ ts?: Number;
3136
+ hl?: 0 | 1 | 2;
3137
+ vr?: 0 | 1;
3138
+ //OTHERS,
3139
+ nozoom?: 0 | 1;
3140
+ search?: 0 | 1;
3141
+ wh?: 0 | 1;
3142
+ prod?: boolean; //sets appropriate file path of showcase based on value
3143
+ viewMode?: VIEW_MODE | string //determines if viewer of space can utilize features like transform controls
3144
+ fetchObjectsOnLoad?: {
3145
+ active?:boolean
3146
+ apiEndpoint?:string //Custom api endpoint to fetch space/showcase objects from. Supports azusa and open_at endpoint. Default points to open_at endpoint
3147
+ }
3148
+ mapConfig?: IMapConfig
3149
+ mediaScreenConfig?: ISharedScreen
3150
+ toolbarConfig?: IToolbarConfig
3151
+ avatartwinConfig?: {
3152
+ avatartwinKey: string
3153
+ }
3154
+ meetConfig?: {
3155
+ sdkKey: string
3156
+ secretKey: string
3157
+ }
3158
+ appConfigKeys?:{
3159
+ mpKey: string //required
3160
+ embedlyKey: string //for rendering attachments
3161
+ meetSdkKey?: string //zoom sdk key
3162
+ meetSecretKey?: string //zoom secret key
3163
+ avatartwinKey?: string //superviz key
3164
+ appName?: string // app name / title
3165
+ }
3166
+ debug?: {
3167
+ //If debug valu is not defined, Only error logs are shown by default
3168
+ //Valid log levels are trace,warn,error,info,trace,silent
3169
+ logLevel: string
3170
+ },
3171
+ restrictionConfig?:{
3172
+ isTagReadOnly?: boolean
3173
+ }
3152
3174
  }
3153
3175
  ```
3154
3176
 
@@ -3186,7 +3208,7 @@ This will resolve internally to `"assets/customBundleName/showcase.html?somepara
3186
3208
  - 0 Hide the VR button.
3187
3209
  - 1 Default Show the VR button.
3188
3210
 
3189
- **Example:**
3211
+ *Example:*
3190
3212
  ```javascript
3191
3213
  import * as atwin from 'architwin'
3192
3214
 
@@ -3234,7 +3256,7 @@ You can technically forego the at_showcase_container class of the parent div wit
3234
3256
  - **position** - (optional) Specify where to place the minimap. Valid positions are topLeft, topRight, bottomRight, bottomLeft. By default, the map is placed at the topRight corner if this value is not set.
3235
3257
  - **fixedSized** - (optional) Specify a fixed width of the minimap. By default, the minimap has width of 100px and expands to 250px upon mouse hover. Please take note that setting a fixed width of your minimap will disable the hover-to-expand animation. Any numberic value you provide will be translated into pixel units
3236
3258
 
3237
- Example:
3259
+ *Example:*
3238
3260
 
3239
3261
  ```typescript
3240
3262
  const config = {
@@ -3265,68 +3287,340 @@ Example:
3265
3287
 
3266
3288
  - **zIndex** - (optional) Set the z-index of the map. In cases where you have UI elements that coincide with the position of the minimap. You set the z-index value of the minimap to determine what order the minimap should be rendered.
3267
3289
 
3290
+ ##### Toolbar Config
3268
3291
 
3269
- #### disconnectSpace()
3270
-
3271
- Utilize this asynchronous function for disconnecting and efficiently cleaning up resources linked to the connected 3D space. It stops any playing videos, disposes of tags, clears objects and states, and ultimately disconnects while clearing the currently displayed Space.
3292
+ To activate a toolbar display within your 3D Space, you can set the following key-value pairs in your configuration object.
3272
3293
 
3273
- *Function Signature*
3294
+ *Example:*
3274
3295
  ```typescript
3275
- async function disconnectSpace(): Promise<void>
3296
+ const config = {
3297
+ //Other config values...
3298
+ toolbarConfig: {
3299
+ active: true,
3300
+ lang: 'en', // Supported language: en and ja,
3301
+ themeConfig: {
3302
+ customizations: {
3303
+ toolbarOffset: {
3304
+ top: 55,
3305
+ },
3306
+ },
3307
+ }
3308
+ },
3309
+ } as IMPConfig;
3276
3310
  ```
3311
+ **Toolbar Config Options**
3312
+ This setup will define and showcase the active menu items within the toolbar. These items consist of the tag list, object list, minimap, screenshot, and theme picker. Apart from the tag list menu, other items can be optional.
3277
3313
 
3278
- *Example*
3279
- ````typescript
3280
- import * as atwin from 'architwin'
3314
+ - **menuItems** - (optional) By default, all items are active. With this configuration, you can specify menu items that you wish to disable in the toolbar.
3315
+ - **meeting:** Allows virtual meetings.
3316
+ - **models:** Allows adding of objects (3D, images, etc.) inside 3D Space.
3317
+ - **minimap:** Displays a minimap of your 3D Space.
3281
3318
 
3282
- atwin.disconnectSpace();
3283
- ````
3284
- -----
3285
- ### Tags
3319
+ *Example:*
3286
3320
 
3287
- #### getTags()
3321
+ ```typescript
3322
+ const config = {
3323
+ //Other config values...
3324
+ toolbarConfig: {
3325
+ active: isAtwinSideBarEnabled.value,
3326
+ lang: lang.value,
3327
+ menuItems: {
3328
+ meeting: false
3329
+ }
3330
+ },
3331
+ } as IMPConfig;
3332
+ ```
3288
3333
 
3289
- This method returns an array of `ITag` containing information of all tags in the space.
3334
+ **Toolbar Theme Config Options**
3335
+ This configuration enables customization of the toolbar display within the 3D space.
3290
3336
 
3291
- *Function Signature*
3337
+ - **customizations** - (optional) Specify the color theme, and position of the toolbar.
3338
+ - **toolbarOffset:** Determines the toolbar's position (top, right, bottom, left).
3339
+
3340
+ *Example:*
3292
3341
  ```typescript
3293
- async function getTags(space: ISpace): Promise<ITag[] | null>;
3342
+ const config = {
3343
+ //Other config values...
3344
+ toolbarConfig: {
3345
+ active: true,
3346
+ lang: 'en',
3347
+ themeConfig: {
3348
+ customizations: {
3349
+ toolbarOffset: {
3350
+ top: 55,
3351
+ },
3352
+ },
3353
+ }
3354
+ },
3355
+ } as IMPConfig;
3294
3356
  ```
3295
3357
 
3296
- *Parameter Table*
3297
- | parameter | type | required | default | values |
3298
- | :----: | :----: | :---: | :---: | :---: |
3299
- | space | ISpace | yes | | |
3358
+ ##### App Config
3300
3359
 
3301
- *Example*
3302
- ```typescript
3303
- import * as atwin from 'architwin'
3360
+ (Optional) This configuration unifies the management of secret keys utilized within the application.
3304
3361
 
3305
- const space = /* specify the space object */;
3306
- const tags = await atwin.getTags(space);
3307
- if (tags) {
3308
- console.log('Tags:', tags);
3309
- } else {
3310
- console.log('No tags found or an error occurred.');
3311
- }
3362
+ *Example:*
3363
+ ```typescript
3364
+ const config = {
3365
+ //Other config values...
3366
+ appConfigKeys:{
3367
+ embedlyKey: "embedly_key_here"
3368
+ meetSdkKey?: "zoom_sdk_key_here"
3369
+ meetSecretKey?: "zoom_secret_key_here"
3370
+ },
3371
+ } as IMPConfig;
3312
3372
  ```
3313
3373
 
3374
+ **App Key Config Options**
3375
+ - **embedlyKey** - This key is for rendering media attachments in tags.
3376
+ - **meetSdkKey** - This is the video sdk key.
3377
+ - **meetSecretKey** - This is the video sdk secret key.
3314
3378
 
3315
- #### gotoTag()
3379
+ ##### Restriction Config
3316
3380
 
3317
- This method enables direct navigation to the tag within the space, identified by a specific ID.
3381
+ (Optional) This configuration allows the app to disable certain features inside the Space View. Currently, the configuration supports restricting the tag feature to make tags read-only.
3318
3382
 
3319
- *Function Signature*
3383
+ *Example:*
3320
3384
  ```typescript
3321
- async function gotoTag(tagId: string): Promise<void>
3385
+ const config = {
3386
+ //Other config values...
3387
+ restrictionConfig: {
3388
+ isTagReadOnly: false
3389
+ },
3390
+ } as IMPConfig;
3391
+
3392
+ ...
3393
+ // set to true if restriction is needed
3394
+ config.restrictionConfig!.isTagReadOnly = true
3322
3395
  ```
3323
3396
 
3324
- *Parameter Table*
3325
- | parameter | type | required | default | values |
3326
- | :----: | :---: | :---: | :---: | :---: |
3327
- | tagId | string | yes | | any string |
3397
+ ##### Debug Config
3328
3398
 
3329
- *Example*
3399
+ (Optional) This configuration determines the log levels displayed in the app's console log. If the debug value is not defined, only error logs are shown by default. Valid log levels include trace, warn, error, info, and silent.
3400
+
3401
+ *Example:*
3402
+ ```typescript
3403
+ const config = {
3404
+ //Other config values...
3405
+ debug:{
3406
+ logLevel: 'trace'
3407
+ },
3408
+ } as IMPConfig;
3409
+ ```
3410
+
3411
+
3412
+ ##### Toolbar Config
3413
+
3414
+ To activate a toolbar display within your 3D Space, you can set the following key-value pairs in your configuration object.
3415
+
3416
+ *Example:*
3417
+ ```typescript
3418
+ const config = {
3419
+ //Other config values...
3420
+ toolbarConfig: {
3421
+ active: true,
3422
+ lang: 'en', // Supported language: en and ja,
3423
+ themeConfig: {
3424
+ customizations: {
3425
+ toolbarOffset: {
3426
+ top: 55,
3427
+ },
3428
+ },
3429
+ }
3430
+ },
3431
+ } as IMPConfig;
3432
+ ```
3433
+ **Toolbar Config Options**
3434
+ This setup will define and showcase the active menu items within the toolbar. These items consist of the tag list, object list, minimap, screenshot, and theme picker. Apart from the tag list menu, other items can be optional.
3435
+
3436
+ - **menuItems** - (optional) By default, all items are active. With this configuration, you can specify menu items that you wish to disable in the toolbar.
3437
+ - **meeting:** Allows virtual meetings.
3438
+ - **models:** Allows adding of objects (3D, images, etc.) inside 3D Space.
3439
+ - **minimap:** Displays a minimap of your 3D Space.
3440
+
3441
+ *Example:*
3442
+
3443
+ ```typescript
3444
+ const config = {
3445
+ //Other config values...
3446
+ toolbarConfig: {
3447
+ active: isAtwinSideBarEnabled.value,
3448
+ lang: lang.value,
3449
+ menuItems: {
3450
+ meeting: false
3451
+ }
3452
+ },
3453
+ } as IMPConfig;
3454
+ ```
3455
+
3456
+ **Toolbar Theme Config Options**
3457
+ This configuration enables customization of the toolbar display within the 3D space.
3458
+
3459
+ - **customizations** - (optional) Specify the color theme, and position of the toolbar.
3460
+ - **toolbarOffset:** Determines the toolbar's position (top, right, bottom, left).
3461
+
3462
+ *Example:*
3463
+ ```typescript
3464
+ const config = {
3465
+ //Other config values...
3466
+ toolbarConfig: {
3467
+ active: true,
3468
+ lang: 'en',
3469
+ themeConfig: {
3470
+ customizations: {
3471
+ toolbarOffset: {
3472
+ top: 55,
3473
+ },
3474
+ },
3475
+ }
3476
+ },
3477
+ } as IMPConfig;
3478
+ ```
3479
+
3480
+ ##### App Config
3481
+
3482
+ (Optional) This configuration unifies the management of secret keys utilized within the application.
3483
+
3484
+ *Example:*
3485
+ ```typescript
3486
+ const config = {
3487
+ //Other config values...
3488
+ appConfigKeys:{
3489
+ embedlyKey: "embedly_key_here"
3490
+ meetSdkKey?: "zoom_sdk_key_here"
3491
+ meetSecretKey?: "zoom_secret_key_here"
3492
+ },
3493
+ } as IMPConfig;
3494
+ ```
3495
+
3496
+ **App Key Config Options**
3497
+ - **embedlyKey** - This key is for rendering media attachments in tags.
3498
+ - **meetSdkKey** - This is the video sdk key.
3499
+ - **meetSecretKey** - This is the video sdk secret key.
3500
+
3501
+ ##### Restriction Config
3502
+
3503
+ (Optional) This configuration allows the app to disable certain features inside the Space View. Currently, the configuration supports restricting the tag feature to make tags read-only.
3504
+
3505
+ *Example:*
3506
+ ```typescript
3507
+ const config = {
3508
+ //Other config values...
3509
+ restrictionConfig: {
3510
+ isTagReadOnly: false
3511
+ },
3512
+ } as IMPConfig;
3513
+
3514
+ ...
3515
+ // set to true if restriction is needed
3516
+ config.restrictionConfig!.isTagReadOnly = true
3517
+ ```
3518
+
3519
+ ##### Debug Config
3520
+
3521
+ (Optional) This configuration determines the log levels displayed in the app's console log. If the debug value is not defined, only error logs are shown by default. Valid log levels include trace, warn, error, info, and silent.
3522
+
3523
+ *Example:*
3524
+ ```typescript
3525
+ const config = {
3526
+ //Other config values...
3527
+ debug:{
3528
+ logLevel: 'trace'
3529
+ },
3530
+ } as IMPConfig;
3531
+ ```
3532
+
3533
+ **Displaying the minimap outside the iFrame**
3534
+
3535
+ There may be instances where you need to display the provided minimap outside of the 3D space displayed by your iFrame. In such cases, you may access the ``setMap`` method of the `minimap` object to display the minimap elsewhere. Do take note that there can only be one instance of the minimap displayed at a time. We may add the ability to display multiple minimaps at the same time in future releases.
3536
+
3537
+ The setMap method requires the following parameters
3538
+
3539
+ *Parameter Table*
3540
+ | parameter | type | required | default | values |
3541
+ | :----: | :----: | :---: | :---: | :---: |
3542
+ | mpSdk | MpSdk | yes | none |Matterport SDK instance |
3543
+ | appKey | string | yes | none |Your matterport app key|
3544
+ | mapId | string | yes | none |id of the element that will hold the map|
3545
+
3546
+ **NOTE:** You can get the instance of mpSdk by using the `getAtwinSdk` method
3547
+
3548
+ Here's an example on how to do it.
3549
+
3550
+ **Step 1: Create an element and give it the id of at-map**
3551
+ ```html
3552
+ <div id="at-map"></div>
3553
+ ```
3554
+
3555
+ **Step 2: Run the setMap method and pass the required parameters**
3556
+ ```typescript
3557
+ import * as atwin from 'architwin'
3558
+
3559
+ const sdk = getAtwinSdk()
3560
+ atwin.minimap.setMap(sdk,'YOUR-APP-KEY','at-map')
3561
+ ```
3562
+
3563
+ #### disconnectSpace()
3564
+
3565
+ Utilize this asynchronous function for disconnecting and efficiently cleaning up resources linked to the connected 3D space. It stops any playing videos, disposes of tags, clears objects and states, and ultimately disconnects while clearing the currently displayed Space.
3566
+
3567
+ *Function Signature*
3568
+ ```typescript
3569
+ async function disconnectSpace(): Promise<void>
3570
+ ```
3571
+
3572
+ *Example:*
3573
+ ````typescript
3574
+ import * as atwin from 'architwin'
3575
+
3576
+ atwin.disconnectSpace();
3577
+ ````
3578
+ -----
3579
+ ### Tags
3580
+
3581
+ #### getTags()
3582
+
3583
+ This method returns an array of `ITag` containing information of all tags in the space.
3584
+
3585
+ *Function Signature*
3586
+ ```typescript
3587
+ async function getTags(space: ISpace): Promise<ITag[] | null>;
3588
+ ```
3589
+
3590
+ *Parameter Table*
3591
+ | parameter | type | required | default | values |
3592
+ | :----: | :----: | :---: | :---: | :---: |
3593
+ | space | ISpace | yes | | |
3594
+
3595
+ *Example:*
3596
+ ```typescript
3597
+ import * as atwin from 'architwin'
3598
+
3599
+ const space = /* specify the space object */;
3600
+ const tags = await atwin.getTags(space);
3601
+ if (tags) {
3602
+ console.log('Tags:', tags);
3603
+ } else {
3604
+ console.log('No tags found or an error occurred.');
3605
+ }
3606
+ ```
3607
+
3608
+
3609
+ #### gotoTag()
3610
+
3611
+ This method enables direct navigation to the tag within the space, identified by a specific ID.
3612
+
3613
+ *Function Signature*
3614
+ ```typescript
3615
+ async function gotoTag(tagId: string): Promise<void>
3616
+ ```
3617
+
3618
+ *Parameter Table*
3619
+ | parameter | type | required | default | values |
3620
+ | :----: | :---: | :---: | :---: | :---: |
3621
+ | tagId | string | yes | | any string |
3622
+
3623
+ *Example:*
3330
3624
  ```typescript
3331
3625
  import * as atwin from 'architwin'
3332
3626
 
@@ -3336,30 +3630,32 @@ await atwin.gotoTag(tagId);
3336
3630
 
3337
3631
  ### renderTag()
3338
3632
 
3339
- The [renderTag()](#rendertag) is used for rendering a tag in the space based on the provided payload and some additional parameters.
3633
+ The [renderTag()](#rendertag) is used for rendering a tag in the space based on the provided payload.
3340
3634
 
3341
3635
  *Function Signature*
3342
3636
  ```typescript
3343
- async function renderTag(payload: {
3344
- tag: MpSdk.Tag.Descriptor,
3345
- attachments?: string[],
3346
- icon?: string
3347
- }): Promise<ITag>
3637
+ async function renderTag(payload:
3638
+ { tag: MpSdk.Tag.Descriptor },
3639
+ addTo_tags: boolean = true
3640
+ ): Promise<MpSdk.Tag.TagData>
3348
3641
  ```
3349
3642
 
3350
3643
  *Parameter Table*
3351
3644
  | parameter | type | required | default | values |
3352
3645
  | :----: | :---: | :---: | :---: | :---: |
3353
3646
  | payload | { } | yes | | |
3647
+ | addTo_tags | boolean | no | true | true/false |
3354
3648
 
3355
- *Example*
3649
+ **Setting of addTo_tags:**
3650
+ - **true**: Insert the rendered tag into an array that contains all the rendered tags.
3651
+ - **false**: Renders the tag but does not insert it into the array containing all the rendered tags.
3652
+
3653
+ *Example:*
3356
3654
  ```typescript
3357
3655
  import * as atwin from 'architwin'
3358
3656
 
3359
3657
  const payload = {
3360
- tag: { /* Define your tag descriptor here */ },
3361
- attachments: ['attachment1.png', 'attachment2.png'],
3362
- icon: 'icon.png'
3658
+ tag: { /* Define your tag descriptor here */ }
3363
3659
  };
3364
3660
 
3365
3661
  try {
@@ -3379,12 +3675,7 @@ This function retrieves all tags in the space.
3379
3675
  function getMpTags(): ITag[]
3380
3676
  ```
3381
3677
 
3382
- *Parameter Table*
3383
- | parameter | type | required | default | values |
3384
- | :----: | :---: | :---: | :---: | :---: |
3385
- | payload | { } | yes | | |
3386
-
3387
- *Example*
3678
+ *Example:*
3388
3679
  ```typescript
3389
3680
  import * as atwin from 'architwin'
3390
3681
 
@@ -3413,7 +3704,7 @@ function getMpTag(tagId: string): ITag | undefined
3413
3704
  | :----: | :---: | :---: | :---: | :---: |
3414
3705
  | tagId | string | yes | | valid tag ID |
3415
3706
 
3416
- *Example*
3707
+ *Example:*
3417
3708
  ```typescript
3418
3709
  import * as atwin from 'architwin'
3419
3710
 
@@ -3435,18 +3726,24 @@ if (tag) {
3435
3726
 
3436
3727
  The showTags function is an asynchronous function that takes an array of ITag objects (tags) as its parameter. It processes each tag in the array, performs various operations related to displaying the tags in a specific context. These operations include adding tags, attaching media, and potentially editing tag icons.
3437
3728
 
3729
+ Also, this function provides the option to display tags along with tag icons, if desired.
3730
+
3438
3731
  *Function Signature*
3439
3732
  ```typescript
3440
- async function showTags(tags: ITag[]): Promise<void>
3733
+ async function showTags(
3734
+ tags: ITag[],
3735
+ _withIcon: boolean = false
3736
+ ): Promise<void>
3441
3737
  ```
3442
3738
 
3443
3739
  *Parameter Table*
3444
3740
  | parameter | type | required | default | values |
3445
3741
  | :----: | :---: | :---: | :---: | :---: |
3446
- | tags | array of ITag | yes | | |
3742
+ | tags | array | yes | | array of ITag |
3743
+ | _withIcon | boolean | no | false | true/false |
3447
3744
 
3448
3745
 
3449
- *Example*
3746
+ *Example:*
3450
3747
  ```typescript
3451
3748
  import * as atwin from 'architwin'
3452
3749
 
@@ -3457,9 +3754,16 @@ const tagsToDisplay = [
3457
3754
  // ...
3458
3755
  ];
3459
3756
 
3757
+ // If no tag icon display
3460
3758
  try {
3461
3759
  await atwin.showTags(tagsToDisplay);
3462
- console.log('Tags displayed successfully.');
3760
+ } catch (error) {
3761
+ console.error('Error displaying tags:', error);
3762
+ }
3763
+
3764
+ // If with tag icon display
3765
+ try {
3766
+ await atwin.showTags(tagsToDisplay, true);
3463
3767
  } catch (error) {
3464
3768
  console.error('Error displaying tags:', error);
3465
3769
  }
@@ -3474,7 +3778,7 @@ This method is designed to remove tags from a space. Tags are typically used for
3474
3778
  async function disposeTags(): Promise<void>
3475
3779
  ```
3476
3780
 
3477
- *Example*
3781
+ *Example:*
3478
3782
  ```typescript
3479
3783
  import * as atwin from 'architwin'
3480
3784
 
@@ -3508,7 +3812,7 @@ async function disposeTag(payload: { tagId: string }): Promise<void>
3508
3812
  | payload | { } | yes | | |
3509
3813
 
3510
3814
 
3511
- *Example*
3815
+ *Example:*
3512
3816
  ```typescript
3513
3817
  import * as atwin from 'architwin'
3514
3818
 
@@ -3542,7 +3846,7 @@ async function attachTagMedia(payload: {
3542
3846
  | payload | { }| yes | | |
3543
3847
 
3544
3848
 
3545
- *Example*
3849
+ *Example:*
3546
3850
  ```typescript
3547
3851
  import * as atwin from 'architwin'
3548
3852
 
@@ -3578,7 +3882,7 @@ async function detachTagMedia(payload: {
3578
3882
  | :----: | :---: | :---: | :---: | :---: |
3579
3883
  | payload | { } | yes | | |
3580
3884
 
3581
- *Example*
3885
+ *Example:*
3582
3886
  ```typescript
3583
3887
  import * as atwin from 'architwin'
3584
3888
 
@@ -3609,7 +3913,7 @@ async function moveTag(tagId: string, callback?: Function): Promise<void>
3609
3913
  | :----: | :---: | :---: | :---: | :---: |
3610
3914
  | tagId | string | yes | | valid tag ID |
3611
3915
 
3612
- *Example*
3916
+ *Example:*
3613
3917
  ```typescript
3614
3918
  import * as atwin from 'architwin'
3615
3919
 
@@ -3633,7 +3937,7 @@ This asynchronous function is provided to modify the label of a particular tag,
3633
3937
  async function editTagLabel(payload: {
3634
3938
  tagId: string,
3635
3939
  label: string
3636
- }): Promise<void>
3940
+ })
3637
3941
  ```
3638
3942
 
3639
3943
  *Parameter Table*
@@ -3641,7 +3945,7 @@ async function editTagLabel(payload: {
3641
3945
  | :----: | :---: | :---: | :---: | :---: |
3642
3946
  | payload | { } | yes | | |
3643
3947
 
3644
- *Example*
3948
+ *Example:*
3645
3949
  ```typescript
3646
3950
  import * as atwin from 'architwin'
3647
3951
 
@@ -3667,7 +3971,7 @@ This asynchronous function is available for modifying the description of a desig
3667
3971
  async function editTagDescription(payload: {
3668
3972
  tagId: string,
3669
3973
  description: string
3670
- }): Promise<void>
3974
+ })
3671
3975
  ```
3672
3976
 
3673
3977
  *Parameter Table*
@@ -3676,7 +3980,7 @@ async function editTagDescription(payload: {
3676
3980
  | payload | { } | yes | | |
3677
3981
 
3678
3982
 
3679
- *Example*
3983
+ *Example:*
3680
3984
  ```typescript
3681
3985
  import * as atwin from 'architwin'
3682
3986
 
@@ -3703,7 +4007,7 @@ async function editTagIcon(payload: {
3703
4007
  tagId: string,
3704
4008
  icon?: string,
3705
4009
  color: MpSdk.Color | string
3706
- }): Promise<void>
4010
+ })
3707
4011
  ```
3708
4012
 
3709
4013
  *Parameter Table*
@@ -3711,7 +4015,7 @@ async function editTagIcon(payload: {
3711
4015
  | :----: | :---: | :---: | :---: | :---: |
3712
4016
  | payload | { } | yes | | |
3713
4017
 
3714
- *Example*
4018
+ *Example:*
3715
4019
  ```typescript
3716
4020
  import * as atwin from 'architwin'
3717
4021
 
@@ -3738,7 +4042,7 @@ The `editTagStem()` asynchronous function is available for adjusting the visibil
3738
4042
  async function editTagStem(payload: {
3739
4043
  tagId: string,
3740
4044
  stemVisible: boolean
3741
- }): Promise<void>
4045
+ })
3742
4046
  ```
3743
4047
 
3744
4048
  *Parameter Table*
@@ -3746,7 +4050,7 @@ async function editTagStem(payload: {
3746
4050
  | :----: | :---: | :---: | :---: | :---: |
3747
4051
  | payload | { } | yes | | |
3748
4052
 
3749
- *Example*
4053
+ *Example:*
3750
4054
  ```typescript
3751
4055
  import * as atwin from 'architwin'
3752
4056
 
@@ -3772,7 +4076,7 @@ This `editTagColor` asynchronous function is provided for modifying the color of
3772
4076
  async function editTagColor(payload: {
3773
4077
  tagId: string,
3774
4078
  color: MpSdk.Color
3775
- }): Promise<void>
4079
+ })
3776
4080
  ```
3777
4081
 
3778
4082
  *Parameter Table*
@@ -3781,7 +4085,7 @@ async function editTagColor(payload: {
3781
4085
  | payload | { } | yes | | |
3782
4086
 
3783
4087
 
3784
- *Example*
4088
+ *Example:*
3785
4089
  ```typescript
3786
4090
  import * as atwin from 'architwin'
3787
4091
 
@@ -3812,7 +4116,7 @@ Retrieve information about the sweeps (viewpoints) within the loaded 3D space us
3812
4116
  async function getSweeps(): Promise<ISweep[] | null>
3813
4117
  ```
3814
4118
 
3815
- *Example*
4119
+ *Example:*
3816
4120
  ```typescript
3817
4121
  import * as atwin from 'architwin'
3818
4122
 
@@ -3830,15 +4134,16 @@ This asynchronous function moves the camera location to a specific sweep (viewpo
3830
4134
 
3831
4135
  *Function Signature*
3832
4136
  ```typescript
3833
- async function moveToSweep(sweepId: string): Promise<void>
4137
+ async function moveToSweep(sweepId: string, rotation?: Vector2): Promise<void>
3834
4138
  ```
3835
4139
 
3836
4140
  *Parameter Table*
3837
4141
  | parameter | type | required | default | values |
3838
4142
  | :----: | :----: | :---: | :---: | :---: |
3839
4143
  | sweepId | string | yes | | Id of the sweep |
4144
+ | sweepId | Vector2 | optional | | {x,y} |
3840
4145
 
3841
- *Example*
4146
+ *Example:*
3842
4147
  ```typescript
3843
4148
  import * as atwin from 'architwin'
3844
4149
 
@@ -3862,7 +4167,7 @@ async function getNearbySweeps(sweepId: string): Promise<string[] | undefined>
3862
4167
  | :----: | :----: | :---: | :---: | :---: |
3863
4168
  | sweepId | string | yes | | Id of the sweep |
3864
4169
 
3865
- *Example*
4170
+ *Example:*
3866
4171
  ```typescript
3867
4172
  import * as atwin from 'architwin'
3868
4173
 
@@ -3880,7 +4185,7 @@ Obtain information about the current sweep that the camera view is focused on wi
3880
4185
  function getCurrentSweep(): ISweep
3881
4186
  ```
3882
4187
 
3883
- *Example*
4188
+ *Example:*
3884
4189
  ```typescript
3885
4190
  import * as atwin from 'architwin'
3886
4191
 
@@ -3888,6 +4193,51 @@ const currentSweep = atwin.getCurrentSweep();
3888
4193
  console.log('Current Sweep:', currentSweep);
3889
4194
  ```
3890
4195
 
4196
+
4197
+ #### getCurrentSweepPosition()
4198
+
4199
+ Retrieve information about the exact location of the current sweep's position. This function will return sweep's (x,y,z) coordinates.
4200
+
4201
+ *Function Signature*
4202
+ ```typescript
4203
+ function getCurrentSweepPosition(): MpSdk.Vector3
4204
+ ```
4205
+
4206
+ *Example:*
4207
+ ```typescript
4208
+ import * as atwin from 'architwin'
4209
+
4210
+ const currentSweepPosition = atwin.getCurrentSweepPosition();
4211
+ console.log('Current Sweep Position:', currentSweepPosition);
4212
+ ```
4213
+
4214
+
4215
+ #### getAllSweeps()
4216
+
4217
+ This function retrieves all sweep data within the currently loaded space. It will return an array of objects, each containing information about a sweep. Each object includes properties such as id, position, and neighbors.
4218
+
4219
+ *Function Signature*
4220
+ ```typescript
4221
+ function getAllSweeps(): {
4222
+ id: string;
4223
+ position: Vector3;
4224
+ neighbors: string[];
4225
+ }[]
4226
+ ```
4227
+
4228
+ **Where:**
4229
+ - **id:** ID of the sweep
4230
+ - **position:** Position of the sweep (Vector3 coordinates)
4231
+ - **neighbors:** Array of IDs of the neighboring sweeps
4232
+
4233
+ *Example:*
4234
+ ```typescript
4235
+ import * as atwin from 'architwin'
4236
+
4237
+ const allSweeps = atwin.getAllSweeps();
4238
+ console.log('All Sweeps:', allSweeps);
4239
+ ```
4240
+
3891
4241
  -----
3892
4242
 
3893
4243
  ### Video
@@ -3906,7 +4256,7 @@ function playVideo(videoId: number): void
3906
4256
  | :----: | :----: | :---: | :---: | :---: |
3907
4257
  | videoId | number | yes | | Id of the video |
3908
4258
 
3909
- *Example*
4259
+ *Example:*
3910
4260
  ```typescript
3911
4261
  import * as atwin from 'architwin'
3912
4262
 
@@ -3928,7 +4278,7 @@ function pauseVideo(videoId: number): void;
3928
4278
  | :----: | :----: | :---: | :---: | :---: |
3929
4279
  | videoId | number | yes | | Id of the video |
3930
4280
 
3931
- *Example*
4281
+ *Example:*
3932
4282
  ```typescript
3933
4283
  import * as atwin from 'architwin'
3934
4284
 
@@ -3951,7 +4301,7 @@ function setVideoPlayback(action: string, element: HTMLVideoElement): void;
3951
4301
  | action | string | yes | | 'play' or 'pause' or 'mute' or 'unmute' |
3952
4302
  | element | HTMLVideoElement | yes | | HTML video element |
3953
4303
 
3954
- *Example*
4304
+ *Example:*
3955
4305
  ```typescript
3956
4306
  import * as atwin from 'architwin'
3957
4307
 
@@ -3966,7 +4316,7 @@ atwin.setVideoPlayback(action, videoElement);
3966
4316
 
3967
4317
  #### moveInDirection()
3968
4318
 
3969
- Move the camera within the space in a specified direction using this asynchronous function. Supported directions comprise 'LEFT,' 'RIGHT,' 'UP,' 'DOWN,' 'FORWARD,' and 'BACKWARD'.
4319
+ Move the camera within the space in a specified direction using this asynchronous function. Supported directions comprise 'LEFT,' 'RIGHT,' 'UP,' 'DOWN,' 'FORWARD,' and 'BACK'.
3970
4320
 
3971
4321
  *Function Signature*
3972
4322
  ```typescript
@@ -3976,7 +4326,7 @@ async function moveInDirection(direction: string): Promise<void>;
3976
4326
  *Parameter Table*
3977
4327
  | parameter | type | required | default | values |
3978
4328
  | :----: | :----: | :---: | :---: | :---: |
3979
- | direction | string | yes | | "FORWARD" or "BACKWARD" or "LEFT" or "RIGHT" |
4329
+ | direction | string | yes | | "FORWARD" or "BACK" or "LEFT" or "RIGHT" |
3980
4330
 
3981
4331
  *Example*
3982
4332
  ```typescript
@@ -4002,10 +4352,10 @@ Retrieve the current camera pose, including the details about the camera's spati
4002
4352
 
4003
4353
  *Function Signature*
4004
4354
  ```typescript
4005
- function getCurrentCameraPose(): any;
4355
+ function getCurrentCameraPose(): MpSdk.Camera.Pose
4006
4356
  ```
4007
4357
 
4008
- *Example*
4358
+ *Example:*
4009
4359
  ```typescript
4010
4360
  import * as atwin from 'architwin'
4011
4361
 
@@ -4019,10 +4369,10 @@ Retrieve the present camera position within the 3D space using this function. Th
4019
4369
 
4020
4370
  *Function Signature*
4021
4371
  ```typescript
4022
- function getCameraPosition(): Vector3;
4372
+ function getCameraPosition(): MpSdk.Vector3
4023
4373
  ```
4024
4374
 
4025
- *Example*
4375
+ *Example:*
4026
4376
  ```typescript
4027
4377
  import * as atwin from 'architwin'
4028
4378
 
@@ -4045,7 +4395,7 @@ async function cameraPan(x: number, z: number): Promise<void>;
4045
4395
  | x | number | yes | | number of degrees will pan the camera to the right |
4046
4396
  | y | number | yes | | number of degrees will tilt the camera upward |
4047
4397
 
4048
- *Example*
4398
+ *Example:*
4049
4399
  ```typescript
4050
4400
  import * as atwin from 'architwin'
4051
4401
 
@@ -4074,7 +4424,7 @@ async function cameraRotate(x: number, y: number, speed: number): Promise<void>;
4074
4424
  | y | number | yes | | number of degrees will tilt the camera upward |
4075
4425
  | speed | number | yes | | number of second will camera animate to specified angle ( x , y) |
4076
4426
 
4077
- *Example*
4427
+ *Example:*
4078
4428
  ```typescript
4079
4429
  import * as atwin from 'architwin'
4080
4430
 
@@ -4094,10 +4444,10 @@ Obtain the existing view mode of the Matterport scene using this function. The v
4094
4444
 
4095
4445
  *Function Signature*
4096
4446
  ```typescript
4097
- function getViewMode(): string | null;
4447
+ function getViewMode(): MpSdk.Mode.Mode
4098
4448
  ```
4099
4449
 
4100
- *Example*
4450
+ *Example:*
4101
4451
  ```typescript
4102
4452
  import * as atwin from 'architwin'
4103
4453
 
@@ -4119,7 +4469,7 @@ async function setViewMode(mode: string): Promise<void>;
4119
4469
  | :----: | :----: | :---: | :---: | :---: |
4120
4470
  | mode | string | yes | | "dollhouse" or "floorplan" or "inside" or "outside" or "transitioning" |
4121
4471
 
4122
- *Example*
4472
+ *Example:*
4123
4473
  ```typescript
4124
4474
  import * as atwin from 'architwin'
4125
4475
 
@@ -4135,9 +4485,15 @@ This function adjusts the camera's view to focus on a specific point in the Matt
4135
4485
 
4136
4486
  *Function Signature*
4137
4487
  ```typescript
4138
- async function setViewMode(mode: string): Promise<void>;
4488
+ async function cameraLookAt(x: number, y: number): Promise<void>
4139
4489
  ```
4140
4490
 
4491
+ *Parameter Table*
4492
+ | parameter | type | required | default | values |
4493
+ | :----: | :----: | :---: | :---: | :---: |
4494
+ | x | number | yes | | Horizontal position, in pixels. Starting from the canvas' top left corner. |
4495
+ | y | number | yes | | Vertical position, in pixels. Starting from the canvas' top left corner.|
4496
+
4141
4497
  *Example*
4142
4498
  ```typescript
4143
4499
  import * as atwin from 'architwin'
@@ -4155,7 +4511,7 @@ This function takes a screenshot (JPEG) of the user’s current space view. It c
4155
4511
 
4156
4512
  *Function Signature*
4157
4513
  ```typescript
4158
- async function captureSpaceScreenshot(resolution:Renderer.Resolution, visibility: Renderer.Visibility);
4514
+ async function captureSpaceScreenshot(callback?: Function | null, resolution?: Renderer.Resolution, visibility?: Renderer.Visibility): Promise<void>
4159
4515
  ```
4160
4516
 
4161
4517
  *Parameter Table*
@@ -4163,8 +4519,9 @@ async function captureSpaceScreenshot(resolution:Renderer.Resolution, visibility
4163
4519
  | :----: | :----: | :---: | :---: | :---: |
4164
4520
  | resolution | Renderer.Resolution | optional | { width : 1920, height : 1080 } | { width : 600, height : 800 } or any values exceed to 4096 |
4165
4521
  | visibility | Renderer.Visbility | optional | { mattertags : false, measurements : false, sweeps: false, views : false } | {mattertags : true, measurements : false, sweeps: false, views : true} |
4522
+ | callback | Function | optional | | |
4166
4523
 
4167
- *Example*
4524
+ *Example:*
4168
4525
  ```typescript
4169
4526
  import * as atwin from 'architwin'
4170
4527
 
@@ -4209,7 +4566,7 @@ function getNearbyObjects(payload: NearbyPayload): NearbyObjects
4209
4566
  | :----: | :----: | :---: | :---: | :---: |
4210
4567
  | payload | NearbyPayload | yes | none | '3DX' or 'SLIDESHOW' or 'VIDEO' |
4211
4568
 
4212
- *Example*
4569
+ *Example:*
4213
4570
  ```typescript
4214
4571
  import * as atwin from 'architwin'
4215
4572
 
@@ -4224,44 +4581,6 @@ const nearByObjects:NearbyObjects = atwin.getNearbyObjects(payload)
4224
4581
  ...
4225
4582
  ```
4226
4583
 
4227
- #### addObjectToSpace()
4228
- Use this asynchronous void function to add a showcase object into a space. It accepts a media URL, object type, and optional configuration, and returns a promise resolving to the added showcase object. This function logs details about the process and validates the provided parameters.
4229
-
4230
- *Function Signature*
4231
- ```typescript
4232
- async function addObjectToSpace(
4233
- mediaUrl: string,
4234
- objectType: string,
4235
- config: ObjectConfig = undefined
4236
- ): Promise<IShowcaseObject>
4237
- ```
4238
-
4239
- *Parameter Table*
4240
- | parameter | type | required | default | values |
4241
- | :----: | :----: | :---: | :---: | :---: |
4242
- | mediaUrl | string | yes | none | |
4243
- | objectType | string | yes | none | |
4244
- | config | ObjectConfig | no | undefine | |
4245
-
4246
- *Example*
4247
- ```typescript
4248
- import * as atwin from 'architwin'
4249
-
4250
- const mediaUrl = 'https://example.com/media/sample.mp4';
4251
- const objectType = 'VIDEO';
4252
- const config = {
4253
- /* configuration properties here */
4254
- };
4255
-
4256
- atwin.addObjectToSpace(mediaUrl, objectType, config)
4257
- .then(showcaseObject => {
4258
- console.log('Showcase object added:', showcaseObject);
4259
- })
4260
- .catch(error => {
4261
- console.error('Error adding showcase object:', error);
4262
- });
4263
- ```
4264
-
4265
4584
  #### addMediaScreen()
4266
4585
  The [addMediaScreen()](#addmediascreen) method is asynchronous function allows you to add a media screen to the space. The media screen displays a media content specified by the mediaUrl parameter. You can customize the media screen's position, scale, and rotation using the transform parameter. Additional options such as readonly mode and autoplay can also be configured. This function logs information about the provided parameters and performs media handling.
4267
4586
 
@@ -4284,7 +4603,7 @@ async function addMediaScreen(
4284
4603
  | autoplay | boolean | no | | |
4285
4604
 
4286
4605
 
4287
- *Example*
4606
+ *Example:*
4288
4607
  ```typescript
4289
4608
  import * as atwin from 'architwin'
4290
4609
 
@@ -4319,7 +4638,7 @@ async function setTransformMode(mode: TRANSFORM_TYPE | string): Promise<void>
4319
4638
  | :----: | :----: | :---: | :---: | :---: |
4320
4639
  | mode | TRANSFORM_TYPE or string | yes | none |'translate' or 'scale' or 'rotate' |
4321
4640
 
4322
- *Example*
4641
+ *Example:*
4323
4642
  ```typescript
4324
4643
  import * as atwin from 'architwin'
4325
4644
 
@@ -4347,7 +4666,7 @@ function revertTransform(action: string = 'undo'): boolean
4347
4666
  | :----: | :----: | :---: | :---: | :---: |
4348
4667
  | action | string | yes | none |'undo' or 'redo'|
4349
4668
 
4350
- *Example*
4669
+ *Example:*
4351
4670
  ```typescript
4352
4671
  import * as atwin from 'architwin'
4353
4672
 
@@ -4380,7 +4699,7 @@ function removeTransformControls(): void
4380
4699
  | :----: | :----: | :---: | :---: | :---: |
4381
4700
  | none | none | none | none |none|
4382
4701
 
4383
- *Example*
4702
+ *Example:*
4384
4703
  ```typescript
4385
4704
  import * as atwin from 'architwin'
4386
4705
 
@@ -4401,7 +4720,7 @@ function setAnimationState(action: string, modelId: number): void
4401
4720
  | action | string | yes | none |'play' or 'stop'|
4402
4721
  | modelId | number | yes | none |ID of the model|
4403
4722
 
4404
- *Example*
4723
+ *Example:*
4405
4724
  ```typescript
4406
4725
  import * as atwin from 'architwin'
4407
4726
  const action = 'play';
@@ -4424,7 +4743,7 @@ function showObjectDimensions(selected: IObjectData): void
4424
4743
  | :----: | :----: | :---: | :---: | :---: |
4425
4744
  | selected | IObjectData | yes | | |
4426
4745
 
4427
- *Example*
4746
+ *Example:*
4428
4747
  ```typescript
4429
4748
  import * as atwin from 'architwin'
4430
4749
 
@@ -4451,7 +4770,7 @@ async function copyObject(
4451
4770
  | position_offset | Vector3 | yes | undefined | |
4452
4771
  | rotation_offset | Vector3 | yes | undefined | |
4453
4772
 
4454
- *Example*
4773
+ *Example:*
4455
4774
  ```typescript
4456
4775
  import * as atwin from 'architwin'
4457
4776
 
@@ -4459,7 +4778,7 @@ const objectToCopy = /* the object to be copied */;
4459
4778
  const positionOffset = new Vector3(1, 0, 1);
4460
4779
  const rotationOffset = new Vector3(0, Math.PI / 2, 0);
4461
4780
 
4462
- awtwin.copyObject(objectToCopy, positionOffset, rotationOffset)
4781
+ atwin.copyObject(objectToCopy, positionOffset, rotationOffset)
4463
4782
  .then(copiedObject => {
4464
4783
  console.log('Object copied:', copiedObject);
4465
4784
  })
@@ -4468,93 +4787,6 @@ awtwin.copyObject(objectToCopy, positionOffset, rotationOffset)
4468
4787
  });
4469
4788
  ```
4470
4789
 
4471
- #### addObject()
4472
- This asynchronous function is used to upload and add a new 3D object to the scene. It receives a file upload payload, checks the validity of the file type, uploads the file to an external service, and returns the resulting object's data.
4473
-
4474
- *Function Signature*
4475
- ```typescript
4476
- async function addObject(payload: FileUpload): Promise<I3DObject>
4477
- ```
4478
-
4479
- *Parameter Table*
4480
- | parameter | type | required | default | values |
4481
- | :----: | :----: | :---: | :---: | :---: |
4482
- | payload | FileUpload | yes | | |
4483
-
4484
- *Example*
4485
- ```typescript
4486
- import * as atwin from 'architwin'
4487
-
4488
- const uploadPayload = /* construct the upload payload */;
4489
- addObject(uploadPayload)
4490
- .then(addedObject => {
4491
- console.log('Object added:', addedObject);
4492
- })
4493
- .catch(error => {
4494
- console.error('Error adding object:', error);
4495
- });
4496
-
4497
- ```
4498
-
4499
- #### getObject()
4500
-
4501
- Retrieve the data of a 3D object by using this asynchronous function with the provided object ID.
4502
-
4503
- *Function Signature*
4504
- ```typescript
4505
- async function getObject(id: number): Promise<I3DObject>
4506
- ```
4507
-
4508
- *Parameter Table*
4509
- | parameter | type | required | default | values |
4510
- | :----: | :----: | :---: | :---: | :---: |
4511
- | id | number | yes | | |
4512
-
4513
- *Example*
4514
- ```typescript
4515
- import * as atwin from 'architwin'
4516
-
4517
- const objectId = /* specify the object's ID */;
4518
- awtwin.getObject(objectId)
4519
- .then(retrievedObject => {
4520
- console.log('Object retrieved:', retrievedObject);
4521
- })
4522
- .catch(error => {
4523
- console.error('Error retrieving object:', error);
4524
- });
4525
- ```
4526
-
4527
- #### updateObject()
4528
-
4529
- The [updateObject()](#updateobject) function used to refresh a pre-existing 3D object by uploading a fresh file payload. Supply the object's ID along with the file upload payload. The function validates the file type, executes an update and returns the resulting object's data.
4530
-
4531
- *Function Signature*
4532
- ```typescript
4533
- async function updateObject(id: number, payload: FileUpload): Promise<I3DObject>
4534
- ```
4535
-
4536
- *Parameter Table*
4537
- | parameter | type | required | default | values |
4538
- | :----: | :----: | :---: | :---: | :---: |
4539
- | id | number | yes | none | |
4540
- | payload | FileUpload | yes | | |
4541
-
4542
- *Example*
4543
- ```typescript
4544
- import * as atwin from 'architwin'
4545
-
4546
- const objectId = /* specify the object's ID */;
4547
- const uploadPayload = /* construct the upload payload */;
4548
-
4549
- atwin.updateObject(objectId, uploadPayload)
4550
- .then(updatedObject => {
4551
- console.log('Object updated:', updatedObject);
4552
- })
4553
- .catch(error => {
4554
- console.error('Error updating object:', error);
4555
- });
4556
- ```
4557
-
4558
4790
  #### deleteObject()
4559
4791
 
4560
4792
  Use asynchronous function to delete an existing 3D object. The deletion target is determined by the `id` parameter value.
@@ -4569,7 +4801,7 @@ async function deleteObject(id: number): Promise<void>
4569
4801
  | :----: | :----: | :---: | :---: | :---: |
4570
4802
  | id | number | yes | | |
4571
4803
 
4572
- *Example*
4804
+ *Example:*
4573
4805
  ```typescript
4574
4806
  import * as atwin from 'architwin'
4575
4807
 
@@ -4583,34 +4815,6 @@ atwin.deleteObject(objectId)
4583
4815
  });
4584
4816
  ```
4585
4817
 
4586
- #### goTo3dx()
4587
-
4588
- Use the [goTo3dx()](#goto3dx) asynchronous function to navigate to a specific 3D object or point of interest within a 3D environment. Provide an object ID as input, and the function will search for the closest associated sweep. If a suitable sweep is found, the function will initiate navigation to that specific point
4589
-
4590
- *Function Signature*
4591
- ```typescript
4592
- async function goTo3dx(objectId: number): Promise<void>
4593
- ```
4594
-
4595
- *Parameter Table*
4596
- | parameter | type | required | default | values |
4597
- | :----: | :----: | :---: | :---: | :---: |
4598
- | objectId | number | yes | | |
4599
-
4600
- *Example*
4601
- ```typescript
4602
- import * as atwin from 'architwin'
4603
-
4604
- const targetObjectId = /* specify the object's ID */;
4605
- atwin.goTo3dx(targetObjectId)
4606
- .then(() => {
4607
- console.log('Navigation to the object completed.');
4608
- })
4609
- .catch(error => {
4610
- console.error('Error navigating to the object:', error);
4611
- });
4612
- ```
4613
-
4614
4818
  #### deleteObjectFromSpace()
4615
4819
 
4616
4820
  To remove a designated object from a 3D space use [deleteObjectFromSpace()](#deleteobjectfromspace). Provide an `IObjectData` object as input, and the function will eliminate the object from the scene. Additionally, it undertakes essential cleanup tasks like halting animations and removing linked markup elements.
@@ -4625,7 +4829,7 @@ async function deleteObjectFromSpace(target: IObjectData): Promise<number>
4625
4829
  | :----: | :----: | :---: | :---: | :---: |
4626
4830
  | target | IObjectData | yes | | |
4627
4831
 
4628
- *Example*
4832
+ *Example:*
4629
4833
  ```typescript
4630
4834
  import * as atwin from 'architwin'
4631
4835
 
@@ -4655,7 +4859,7 @@ async function replaceObject(payload: I3DObject, target: IObjectData, options: O
4655
4859
  | target | IObjectData | yes | | |
4656
4860
  | options | Object | yes | null | |
4657
4861
 
4658
- *Example*
4862
+ *Example:*
4659
4863
  ```typescript
4660
4864
  import * as atwin from 'architwin'
4661
4865
 
@@ -4697,7 +4901,7 @@ async function addTextMarkupScreen(
4697
4901
  | textColor | string | yes | 'black' | |
4698
4902
  | backgroundColor | string | yes | '#fff' | |
4699
4903
 
4700
- *Example*
4904
+ *Example:*
4701
4905
  ```typescript
4702
4906
  import * as atwin from 'architwin'
4703
4907
  ```
@@ -4720,14 +4924,13 @@ function setTextMarkupScreenContent(
4720
4924
  *Parameter Table*
4721
4925
  | parameter | type | required | default | values |
4722
4926
  | :----: | :----: | :---: | :---: | :---: |
4927
+ | showcase_id | number | yes | ' ' | |
4723
4928
  | title | string | yes | ' ' | |
4724
- | message | string | yes | | |
4725
- | textScreenName | string | yes | | |
4726
- | transform | { position: Vector3, scale: Vector3, rotation: Vector3 } | yes | | |
4727
- | textColor | string | yes | 'black' | |
4728
- | backgroundColor | string | yes | '#fff' | |
4929
+ | text | string | yes | ' ' | |
4930
+ | textColor | string | yes | ' ' | |
4931
+ | backgroundColor | string | yes | ' ' | |
4729
4932
 
4730
- *Example*
4933
+ *Example:*
4731
4934
  ```typescript
4732
4935
  import * as atwin from 'architwin'
4733
4936
 
@@ -4739,7 +4942,6 @@ const newBackgroundColor = 'white';
4739
4942
 
4740
4943
  atwin.setTextMarkupScreenContent(showcaseId, newTitle, newText, newTextColor, newBackgroundColor);
4741
4944
  ```
4742
- -----
4743
4945
 
4744
4946
  ### getNearestSweepFromObject()
4745
4947
 
@@ -4756,7 +4958,7 @@ function getNearestSweepFromObject(objectId: number): { sweepId: string, index:
4756
4958
  | objectId | number | yes | | |
4757
4959
 
4758
4960
 
4759
- *Example*
4961
+ *Example:*
4760
4962
  ```typescript
4761
4963
  import * as atwin from 'architwin'
4762
4964
 
@@ -4772,154 +4974,352 @@ if (nearestSweep) {
4772
4974
  }
4773
4975
  ```
4774
4976
 
4775
- ## Meeting
4776
-
4777
- ### createMeeting()
4977
+ ### setSelectedObject()
4778
4978
 
4779
- Facilitates the creation of a virtual meeting within the specified 3D space. It allows the host to provide details such as the space ID, host's name, meeting title, start time, duration, and password protection.
4979
+ Stores the selected object captured by the ClickSpy class attached to the object upon creation in show3dObjects() function. ClickSpy is not attached if viewMode is set to public. Please take note that you cannot set an object as selected if it has not been rendered into the 3D space.
4780
4980
 
4781
4981
  *Function Signature*
4782
4982
  ```typescript
4783
- async function createMeeting(
4784
- spaceId: string,
4785
- hostName: string,
4786
- title: string,
4787
- meetingStart: any,
4788
- duration: number,
4789
- password: string
4790
- ): Promise<MeetingURLs | undefined>;
4983
+ function setSelectedObject(data: IShowcaseObject, node: Scene.INode, component: Scene.IComponent, type: string): void
4791
4984
  ```
4792
4985
 
4793
4986
  *Parameter Table*
4794
- | parameter | type | required | values |
4795
- | :----: | :----: | :---: | :---: |
4796
- | spaceId | string | yes | any string |
4797
- | hostName | string | yes | any string|
4798
- | title | string | yes | any string |
4799
- | meetingStart | string | yes | any string |
4800
- | meetingStatus | string | yes | '0', '1', '2', or '3'|
4801
- | duration | number | yes | any number |
4802
- | password | string | no | any string|
4987
+ | parameter | type | required | default | values |
4988
+ | :----: | :----: | :---: | :---: | :---: |
4989
+ | data | IShowcaseObject | yes | | The data of the showcase object |
4990
+ | node | Scene.INode | yes | | The node of the object |
4991
+ | component | Scene.IComponent | yes | | The component of the object |
4992
+ | type | string | yes | | The type of the object |
4803
4993
 
4804
- *Example*
4994
+ *Example:*
4805
4995
  ```typescript
4806
4996
  import * as atwin from 'architwin'
4807
4997
 
4808
- async function scheduleMeeting(spaceId, hostName, title, meetingStart, duration, password) {
4809
- try {
4810
- const meetingUrls = await atwin.createMeeting(spaceId, hostName, title, meetingStart, duration, password);
4811
- console.log("Meeting URLs:", meetingUrls);
4812
- } catch (error) {
4813
- console.error("Error creating meeting:", error);
4814
- }
4815
- }
4816
-
4817
- const spaceId = "your-space-id";
4818
- const hostName = "John Doe";
4819
- const title = "Team Meeting";
4820
- const meetingStart = new Date(); // Current time
4821
- const duration = 60; // Duration in minutes
4822
- const password = "secret123";
4998
+ const spaceObject: IShowcaseObject = {id: 123, showcase_id: 123,...}; // Replace with the actual showcase object data
4999
+ const selectedObjectPayload = atwin.get3DXObjects().find((obj) => obj.object.id == spaceObject.id)
4823
5000
 
4824
- await scheduleMeeting(spaceId, hostName, title, meetingStart, duration, password);
5001
+ if (selectedObjectPayload && selectedObjectPayload.type) {
5002
+ atwin.setSelectedObject(selectedObjectPayload.object, selectedObjectPayload.node, selectedObjectPayload.component, selectedObjectPayload.type)
5003
+ }
4825
5004
  ```
4826
5005
 
4827
- ### startMeeting()
5006
+ ### getSelectedObject()
4828
5007
 
4829
- Initiate a virtual meeting within the 3D space using this function. The function examines the meeting URL and conditions before launching the meeting with the specified configuration.
5008
+ Returns information about the selected object.
4830
5009
 
4831
5010
  *Function Signature*
4832
5011
  ```typescript
4833
- async function startMeeting(meetingUrl: string, meetingPassword?: string, meetingConfig?: MeetingConfig): Promise<void>
5012
+ function getSelectedObject(): IObjectData
4834
5013
  ```
4835
5014
 
4836
- *Parameter Table*
4837
- | parameter | type | required | values |
4838
- | :----: | :----: | :---: | :---: |
4839
- | meetingUrl | string | yes | valid public URL |
4840
- | meetingPassword | string | no | any string|
4841
- | meetingConfig | MeetingConfig | no | MeetingConfig object |
4842
-
4843
- *Example*
5015
+ *Example:*
4844
5016
  ```typescript
4845
5017
  import * as atwin from 'architwin'
4846
5018
 
4847
- // Example usage of startMeeting function
4848
- async function joinMeeting(meetingUrl, meetingPassword, meetingConfig) {
4849
- try {
4850
- await atwin.startMeeting(meetingUrl, meetingPassword, meetingConfig);
4851
- console.log("Joining the meeting...");
4852
- } catch (error) {
4853
- console.error("Error starting/joining the meeting:", error);
4854
- }
4855
- }
4856
-
4857
- // Call the function with example values
4858
- const meetingUrl = "https://your-meeting-url.com/?meetingId=your-meeting-id&role=guest";
4859
- const meetingPassword = "secret123";
4860
- const meetingConfig = {
4861
- videoEnabled: true,
4862
- audioEnabled: true,
4863
- screenSharingEnabled: false
4864
- };
4865
-
4866
- await joinMeeting(meetingUrl, meetingPassword, meetingConfig);
5019
+ const selectedObj = atwin.getSelectedObject()
5020
+ console.log("Selected object: ", selectedObj)
4867
5021
  ```
4868
5022
 
4869
- ### stopMeeting()
5023
+ ### clearSelectedObject()
4870
5024
 
4871
- This function is used to stop ongoing virtual meeting session.
5025
+ This function clears the current selected object and sets it to null.
4872
5026
 
4873
5027
  *Function Signature*
4874
5028
  ```typescript
4875
- async function stopMeeting(): Promise<void>
5029
+ function clearSelectedObject(): void
4876
5030
  ```
4877
5031
 
4878
-
4879
- *Example*
5032
+ *Example:*
4880
5033
  ```typescript
4881
5034
  import * as atwin from 'architwin'
4882
5035
 
4883
- // Example usage of stopMeeting function
4884
- async function endMeeting() {
4885
- try {
4886
- await atwin.stopMeeting();
4887
- console.log("Meeting has been stopped and cleaned up.");
4888
- } catch (error) {
4889
- console.error("Error stopping the meeting:", error);
4890
- }
4891
- }
4892
-
4893
- // Call the function
4894
- endMeeting();
5036
+ atwin.clearSelectedObject()
4895
5037
  ```
4896
5038
 
4897
- ### getMeeting()
5039
+ ### goToModel()
4898
5040
 
4899
- Retrieve details about a particular virtual meeting by utilizing its distinct meeting ID with this function.
5041
+ This function will navigate and move to the object's position.
4900
5042
 
4901
5043
  *Function Signature*
4902
5044
  ```typescript
4903
- async function getMeeting(meetingId: string): Promise<any>
5045
+ function goToModel(objectId: number): Promise<void>
4904
5046
  ```
4905
5047
 
4906
5048
  *Parameter Table*
4907
- | parameter | type | required | values |
4908
- | :----: | :----: | :---: | :---: |
4909
- | meetingId | string | yes | valid meeting Id |
5049
+ | parameter | type | required | default | values |
5050
+ | :----: | :----: | :---: | :---: | :---: |
5051
+ | objectId | numer | yes | | ID of the object |
4910
5052
 
4911
- *Example*
5053
+ *Example:*
4912
5054
  ```typescript
4913
5055
  import * as atwin from 'architwin'
4914
5056
 
4915
- // Example usage of getMeeting function
4916
- async function fetchMeetingDetails(meetingId) {
4917
- try {
4918
- const meetingInfo = await atwin.getMeeting(meetingId);
4919
- console.log("Meeting Details:", meetingInfo.data);
4920
- } catch (error) {
4921
- console.error("Error fetching meeting details:", error);
4922
- }
5057
+ const objectId = 123 // Replace with the actual object id
5058
+ await atwin.goToModel(objectId)
5059
+ ```
5060
+ -----
5061
+
5062
+ ### get3DXObjects()
5063
+
5064
+ Returns array of objects, each conforming to the IObjectData data type.
5065
+
5066
+ *Function Signature*
5067
+ ```typescript
5068
+ function get3DXObjects(): Array<IObjectData>
5069
+ ```
5070
+
5071
+ *Example:*
5072
+ ```typescript
5073
+ import * as atwin from 'architwin'
5074
+
5075
+ const objects = atwin.get3DXObjects();
5076
+ // Now 'objects' contains an array of 3D objects
5077
+ ```
5078
+
5079
+ ### setLibrary()
5080
+
5081
+ This function will set or update a library of 3D models asynchronously.
5082
+
5083
+ *Function Signature*
5084
+ ```typescript
5085
+ function setLibrary(libraryModels: Array<I3DObject>): Promise<Array<I3DObject>>
5086
+ ```
5087
+
5088
+ *Parameter Table*
5089
+ | parameter | type | required | values |
5090
+ | :----: | :----: | :---: | :---: |
5091
+ | libraryModels | Array<I3DObject> | yes | |
5092
+
5093
+ *Example:*
5094
+ ```typescript
5095
+ import * as atwin from 'architwin'
5096
+
5097
+ const libraryModels = [{ // Replace with actual data
5098
+ id: '123',
5099
+ upload_file: 'PNG',
5100
+ upload_filename: 'test'
5101
+ }];
5102
+
5103
+ await atwin.setLibrary(libraryModels)
5104
+ .then(updatedLibrary => {
5105
+ // Handle the updated library of 3D objects
5106
+ })
5107
+ .catch(error => {
5108
+ // Handle any errors that occurred during the asynchronous operation
5109
+ });
5110
+ ```
5111
+
5112
+
5113
+ ### getLibrary()
5114
+
5115
+ This function serves the purpose of retrieving a library of 3D objects, possibly with the option to refetch the library if needed. Returns array of objects, each conforming to the IObjectData data type.
5116
+
5117
+ *Function Signature*
5118
+ ```typescript
5119
+ function getLibrary(refetch?: boolean): Promise<Array<I3DObject>>
5120
+ ```
5121
+
5122
+ *Parameter Table*
5123
+ | parameter | type | required | values |
5124
+ | :----: | :----: | :---: | :---: |
5125
+ | refetch |boolean | optional | true or false |
5126
+
5127
+ *Example:*
5128
+ ```typescript
5129
+ import * as atwin from 'architwin'
5130
+
5131
+ // Refetch is not needed
5132
+ await atwin.getLibrary()
5133
+
5134
+ // Refetch is needed
5135
+ await atwin.getLibrary(true)
5136
+ .then(library => {
5137
+ // Handle the retrieved library of 3D objects
5138
+ })
5139
+ .catch(error => {
5140
+ // Handle any errors that occurred during the asynchronous operation
5141
+ });
5142
+ ```
5143
+
5144
+
5145
+ ### disposeModel()
5146
+
5147
+ This function handles the disposal or cleanup of a specific 3D object asynchronously.It returns a promise that resolves to the object ID of the disposed target.
5148
+
5149
+ *Function Signature*
5150
+ ```typescript
5151
+ function disposeModel(target: IObjectData): Promise<number>
5152
+ ```
5153
+
5154
+ *Parameter Table*
5155
+ | parameter | type | required | values |
5156
+ | :----: | :----: | :---: | :---: |
5157
+ | target |IObjectData | yes | |
5158
+
5159
+ *Example:*
5160
+ ```typescript
5161
+ import * as atwin from 'architwin'
5162
+
5163
+ await atwin.disposeModel(target)
5164
+ .then(objectID => {
5165
+ // Handle the disposal process completion, possibly based on the returned object ID
5166
+ })
5167
+ .catch(error => {
5168
+ // Handle any errors that occurred during the disposal process
5169
+ });
5170
+ ```
5171
+
5172
+ -----
5173
+
5174
+
5175
+ <!-- ## Meeting
5176
+
5177
+ ### createMeeting()
5178
+
5179
+ Facilitates the creation of a virtual meeting within the specified 3D space. It allows the host to provide details such as the space ID, host's name, meeting title, start time, duration, and password protection.
5180
+
5181
+ *Function Signature*
5182
+ ```typescript
5183
+ async function createMeeting(
5184
+ spaceId: string,
5185
+ hostName: string,
5186
+ title: string,
5187
+ meetingStart: any,
5188
+ duration: number,
5189
+ password: string
5190
+ ): Promise<MeetingURLs | undefined>;
5191
+ ```
5192
+
5193
+ *Parameter Table*
5194
+ | parameter | type | required | values |
5195
+ | :----: | :----: | :---: | :---: |
5196
+ | spaceId | string | yes | any string |
5197
+ | hostName | string | yes | any string|
5198
+ | title | string | yes | any string |
5199
+ | meetingStart | string | yes | any string |
5200
+ | meetingStatus | string | yes | '0', '1', '2', or '3'|
5201
+ | duration | number | yes | any number |
5202
+ | password | string | no | any string|
5203
+
5204
+ *Example:*
5205
+ ```typescript
5206
+ import * as atwin from 'architwin'
5207
+
5208
+ async function scheduleMeeting(spaceId, hostName, title, meetingStart, duration, password) {
5209
+ try {
5210
+ const meetingUrls = await atwin.createMeeting(spaceId, hostName, title, meetingStart, duration, password);
5211
+ console.log("Meeting URLs:", meetingUrls);
5212
+ } catch (error) {
5213
+ console.error("Error creating meeting:", error);
5214
+ }
5215
+ }
5216
+
5217
+ const spaceId = "your-space-id";
5218
+ const hostName = "John Doe";
5219
+ const title = "Team Meeting";
5220
+ const meetingStart = new Date(); // Current time
5221
+ const duration = 60; // Duration in minutes
5222
+ const password = "secret123";
5223
+
5224
+ await scheduleMeeting(spaceId, hostName, title, meetingStart, duration, password);
5225
+ ```
5226
+
5227
+ ### startMeeting()
5228
+
5229
+ Initiate a virtual meeting within the 3D space using this function. The function examines the meeting URL and conditions before launching the meeting with the specified configuration.
5230
+
5231
+ *Function Signature*
5232
+ ```typescript
5233
+ async function startMeeting(meetingUrl: string, meetingPassword?: string, meetingConfig?: MeetingConfig): Promise<void>
5234
+ ```
5235
+
5236
+ *Parameter Table*
5237
+ | parameter | type | required | values |
5238
+ | :----: | :----: | :---: | :---: |
5239
+ | meetingUrl | string | yes | valid public URL |
5240
+ | meetingPassword | string | no | any string|
5241
+ | meetingConfig | MeetingConfig | no | MeetingConfig object |
5242
+
5243
+ *Example:*
5244
+ ```typescript
5245
+ import * as atwin from 'architwin'
5246
+
5247
+ // Example usage of startMeeting function
5248
+ async function joinMeeting(meetingUrl, meetingPassword, meetingConfig) {
5249
+ try {
5250
+ await atwin.startMeeting(meetingUrl, meetingPassword, meetingConfig);
5251
+ console.log("Joining the meeting...");
5252
+ } catch (error) {
5253
+ console.error("Error starting/joining the meeting:", error);
5254
+ }
5255
+ }
5256
+
5257
+ // Call the function with example values
5258
+ const meetingUrl = "https://your-meeting-url.com/?meetingId=your-meeting-id&role=guest";
5259
+ const meetingPassword = "secret123";
5260
+ const meetingConfig = {
5261
+ videoEnabled: true,
5262
+ audioEnabled: true,
5263
+ screenSharingEnabled: false
5264
+ };
5265
+
5266
+ await joinMeeting(meetingUrl, meetingPassword, meetingConfig);
5267
+ ```
5268
+
5269
+ ### stopMeeting()
5270
+
5271
+ This function is used to stop ongoing virtual meeting session.
5272
+
5273
+ *Function Signature*
5274
+ ```typescript
5275
+ async function stopMeeting(): Promise<void>
5276
+ ```
5277
+
5278
+
5279
+ *Example:*
5280
+ ```typescript
5281
+ import * as atwin from 'architwin'
5282
+
5283
+ // Example usage of stopMeeting function
5284
+ async function endMeeting() {
5285
+ try {
5286
+ await atwin.stopMeeting();
5287
+ console.log("Meeting has been stopped and cleaned up.");
5288
+ } catch (error) {
5289
+ console.error("Error stopping the meeting:", error);
5290
+ }
5291
+ }
5292
+
5293
+ // Call the function
5294
+ endMeeting();
5295
+ ```
5296
+
5297
+ ### getMeeting()
5298
+
5299
+ Retrieve details about a particular virtual meeting by utilizing its distinct meeting ID with this function.
5300
+
5301
+ *Function Signature*
5302
+ ```typescript
5303
+ async function getMeeting(meetingId: string): Promise<any>
5304
+ ```
5305
+
5306
+ *Parameter Table*
5307
+ | parameter | type | required | values |
5308
+ | :----: | :----: | :---: | :---: |
5309
+ | meetingId | string | yes | valid meeting Id |
5310
+
5311
+ *Example:*
5312
+ ```typescript
5313
+ import * as atwin from 'architwin'
5314
+
5315
+ // Example usage of getMeeting function
5316
+ async function fetchMeetingDetails(meetingId) {
5317
+ try {
5318
+ const meetingInfo = await atwin.getMeeting(meetingId);
5319
+ console.log("Meeting Details:", meetingInfo.data);
5320
+ } catch (error) {
5321
+ console.error("Error fetching meeting details:", error);
5322
+ }
4923
5323
  }
4924
5324
 
4925
5325
  // Call the function with a specific meeting ID
@@ -4936,7 +5336,7 @@ function getMeetingParticipants(): IMpParticipant[]
4936
5336
  ```
4937
5337
 
4938
5338
 
4939
- *Example*
5339
+ *Example:*
4940
5340
  ```typescript
4941
5341
  import * as atwin from 'architwin'
4942
5342
 
@@ -4968,7 +5368,7 @@ async function getSpaceMeetings(spaceId: number): Promise<any>
4968
5368
  | :----: | :----: | :---: | :---: |
4969
5369
  | spaceId | string | yes | valid space Id |
4970
5370
 
4971
- *Example*
5371
+ *Example:*
4972
5372
  ```typescript
4973
5373
  import * as atwin from 'architwin'
4974
5374
 
@@ -4989,7 +5389,7 @@ async function generateMeetingURL(meeting_id: string): Promise<any>
4989
5389
  | :----: | :----: | :---: | :---: |
4990
5390
  | meeting_id | string | yes | valid meeting Id |
4991
5391
 
4992
- *Example*
5392
+ *Example:*
4993
5393
  ```typescript
4994
5394
  import * as atwin from 'architwin'
4995
5395
 
@@ -5011,7 +5411,7 @@ async function isMeetingExists(meetingId: string): Promise<boolean>
5011
5411
  | :----: | :----: | :---: | :---: |
5012
5412
  | meetingId | string | yes | valid meeting Id |
5013
5413
 
5014
- *Example*
5414
+ *Example:*
5015
5415
  ```typescript
5016
5416
  import * as atwin from 'architwin'
5017
5417
 
@@ -5032,7 +5432,7 @@ async function isMeetingActive(meetingId: string): Promise<boolean>
5032
5432
  | :----: | :----: | :---: | :---: |
5033
5433
  | meetingId | string | yes | valid meeting Id |
5034
5434
 
5035
- *Example*
5435
+ *Example:*
5036
5436
  ```typescript
5037
5437
  import * as atwin from 'architwin'
5038
5438
 
@@ -5054,7 +5454,7 @@ async function updateMeetingTitle(meetingId: string, meetingTitle: string): Prom
5054
5454
  | meetingId | string | yes | valid meeting Id |
5055
5455
  | meetingTitle | string | yes | new meeting title |
5056
5456
 
5057
- *Example*
5457
+ *Example:*
5058
5458
  ```typescript
5059
5459
  import * as atwin from 'architwin'
5060
5460
 
@@ -5089,7 +5489,7 @@ async function updateMeetingStart(meetingId: string, meetingStart: string): Prom
5089
5489
  | meetingId | string | yes | valid meeting Id |
5090
5490
  | meetingStart | string | yes | new date when the will start |
5091
5491
 
5092
- *Example*
5492
+ *Example:*
5093
5493
  ```typescript
5094
5494
  import * as atwin from 'architwin'
5095
5495
 
@@ -5124,7 +5524,7 @@ async function updateMeetingStatus(meetingId: string, meetingStatus: number): Pr
5124
5524
  | meetingId | string | yes | valid meeting Id |
5125
5525
  | meetingStatus | number | yes | 0 or 1 or 2 or 3 |
5126
5526
 
5127
- *Example*
5527
+ *Example:*
5128
5528
  ```typescript
5129
5529
  import * as atwin from 'architwin'
5130
5530
 
@@ -5160,7 +5560,7 @@ async function updateMeetingSpace(meetingId: string, spaceId: string): Promise<a
5160
5560
  | meetingId | string | yes | valid meeting Id |
5161
5561
  | spaceId | string | yes | valid space Id |
5162
5562
 
5163
- *Example*
5563
+ *Example:*
5164
5564
  ```typescript
5165
5565
  import * as atwin from 'architwin'
5166
5566
 
@@ -5180,9 +5580,580 @@ async function changeMeetingSpace() {
5180
5580
  changeMeetingSpace();
5181
5581
  ```
5182
5582
 
5183
- -----
5583
+ ----- -->
5584
+
5585
+ ## Virtual Meeting
5586
+
5587
+ ### createMeeting()
5184
5588
 
5185
- **To Do:**
5589
+ Facilitates the creation of a virtual meeting within the specified 3D space. It allows the host to provide details such as the meeting topic, and participant name. Meeting password is auto-generated upon creation.
5590
+
5591
+ *Function Signature*
5592
+ ```typescript
5593
+ function createMeeting(topic: string, base_url: string): Promise<IMeeting>
5594
+ ```
5595
+
5596
+ *Parameter Table*
5597
+ | parameter | type | required | default | values |
5598
+ | :----: | :----: | :---: | :---: | :---: |
5599
+ | topic | string | yes | | The name or topic of the meeting |
5600
+ | base_url | string | yes | | The base URL of the application |
5601
+
5602
+ *Example:*
5603
+ ````typescript
5604
+ import * as atwin from 'architwin'
5605
+
5606
+ // create meeting
5607
+ const topic = "Space Introduction"
5608
+ const baseUrl = window.location.href
5609
+
5610
+ await atwin.meet.createMeeting(topic, baseUrl)
5611
+ ````
5612
+
5613
+ ### joinMeeting()
5614
+
5615
+ A method by which a participant gains access to an existing virtual conference. This involves receiving a meeting link from the host and using it to enter the virtual conference environment.
5616
+
5617
+ *Function Signature*
5618
+ ```typescript
5619
+ function joinMeeting(payload: IMeetingPayload): Promise<boolean>
5620
+ ```
5621
+
5622
+ *Parameter Table*
5623
+ | parameter | type | required | default | values |
5624
+ | :----: | :----: | :---: | :---: | :---: |
5625
+ | payload | IMeetingPayload | yes | | |
5626
+
5627
+ **IMeetingPayload** has data of:
5628
+ - **topic** : string - The topic of the meeting.
5629
+ - **password** : string - Password of the meeting.
5630
+ - **role** : string - Participant's role: HOST or GUEST.
5631
+ - **participant_fullname** : string - Participant's name.
5632
+
5633
+ *Example:*
5634
+ ````typescript
5635
+ import * as atwin from 'architwin'
5636
+
5637
+ // Replace with actual meeting payload data
5638
+ const meetingPayload: IMeetingPayload = {
5639
+ topic: 'Space Introduction',
5640
+ password: '1234',
5641
+ role: 'HOST',
5642
+ participant_fullname: 'Adam'
5643
+ }
5644
+
5645
+ // join meeting
5646
+ await atwin.meet.joinMeeting(meetingPayload);
5647
+ ````
5648
+
5649
+ ### leaveMeeting()
5650
+
5651
+ This method allows participants to exit an ongoing virtual meeting. This functionality ensures that users can gracefully disconnect from a meeting without disrupting other participants.
5652
+
5653
+ *Function Signature*
5654
+ ```typescript
5655
+ function leaveMeeting(): Promise<boolean>
5656
+ ```
5657
+
5658
+ *Example:*
5659
+ ````typescript
5660
+ import * as atwin from 'architwin'
5661
+
5662
+ await atwin.meet.leaveMeeting();
5663
+ ````
5664
+
5665
+ ### startVideo()
5666
+
5667
+ This method is used to activate a participant's video feed, allowing others in the meeting to see them.
5668
+
5669
+ *Function Signature*
5670
+ ```typescript
5671
+ function startVideo(): Promise<boolean>
5672
+ ```
5673
+
5674
+ *Example:*
5675
+ ````typescript
5676
+ import * as atwin from 'architwin'
5677
+
5678
+ await atwin.meet.startVideo();
5679
+ ````
5680
+
5681
+ ### stopVideo()
5682
+
5683
+ This method deactivates the participant's camera, halting the transmission of their video feed to other meeting participants.
5684
+
5685
+ *Function Signature*
5686
+ ```typescript
5687
+ function stopVideo(): Promise<boolean>
5688
+ ```
5689
+
5690
+ *Example:*
5691
+ ````typescript
5692
+ import * as atwin from 'architwin'
5693
+
5694
+ await atwin.meet.stopVideo();
5695
+ ````
5696
+
5697
+ ### startLocalVideo()
5698
+
5699
+ This method is used to activate a participant's local camera feed, capturing video from the participant's device's built-in camera.
5700
+
5701
+ *Function Signature*
5702
+ ```typescript
5703
+ function startLocalVideo(VideoElement?: HTMLVideoElement | null): Promise<boolean>
5704
+ ```
5705
+
5706
+ *Parameter Table*
5707
+ | parameter | type | required | default | values |
5708
+ | :----: | :----: | :---: | :---: | :---: |
5709
+ | VideoElement | HTMLVideoElement | optional | | HTMLVideoElement of local video canvas |
5710
+
5711
+ *Example:*
5712
+ ````typescript
5713
+ import * as atwin from 'architwin'
5714
+
5715
+ // With Video Element
5716
+
5717
+ // Replace with actual video element
5718
+ let premeetVideo: HTMLVideoElement;
5719
+ premeetVideo = document.getElementById("at-premeet-video") as HTMLVideoElement;
5720
+
5721
+ await atwin.meet.startLocalVideo(premeetVideo);
5722
+
5723
+ // Without Video Element
5724
+ await atwin.meet.startLocalVideo();
5725
+ ````
5726
+
5727
+ ### stopLocalVideo()
5728
+
5729
+ This method is used to deactivate or pause the transmission of a participant's video feed captured from their local camera.
5730
+
5731
+ *Function Signature*
5732
+ ```typescript
5733
+ function stopLocalVideo(): Promise<boolean>
5734
+ ```
5735
+
5736
+ *Example:*
5737
+ ````typescript
5738
+ import * as atwin from 'architwin'
5739
+
5740
+ await atwin.meet.stopLocalVideo();
5741
+ ````
5742
+
5743
+ ### startAudio()
5744
+
5745
+ This method activates the microphone of the participant.
5746
+
5747
+ *Function Signature*
5748
+ ```typescript
5749
+ function startAudio(): Promise<void>
5750
+ ```
5751
+
5752
+ *Example:*
5753
+ ````typescript
5754
+ import * as atwin from 'architwin'
5755
+
5756
+ await atwin.meet.startAudio();
5757
+ ````
5758
+
5759
+ ### stopAudio()
5760
+
5761
+ This method deactivates the microphone of the participant.
5762
+
5763
+ *Function Signature*
5764
+ ```typescript
5765
+ function stopAudio(): Promise<void>
5766
+ ```
5767
+
5768
+ *Example:*
5769
+ ````typescript
5770
+ import * as atwin from 'architwin'
5771
+
5772
+ await atwin.meet.stopAudio();
5773
+ ````
5774
+
5775
+ ### muteAudio()
5776
+
5777
+ This method allows participants to temporarily disable their microphone, preventing their audio from transmitting to other participants in the meeting.
5778
+
5779
+ *Function Signature*
5780
+ ```typescript
5781
+ function muteAudio(): Promise<boolean>
5782
+ ```
5783
+
5784
+ *Example:*
5785
+ ````typescript
5786
+ import * as atwin from 'architwin'
5787
+
5788
+ await atwin.meet.muteAudio();
5789
+ ````
5790
+
5791
+ ### unMuteAudio()
5792
+
5793
+ This method allows participants to enable their microphone after muting it, thereby restoring the transmission of their audio to other participants in the meeting.
5794
+
5795
+ *Function Signature*
5796
+ ```typescript
5797
+ function unMuteAudio(): Promise<boolean>
5798
+ ```
5799
+
5800
+ *Example:*
5801
+ ````typescript
5802
+ import * as atwin from 'architwin'
5803
+
5804
+ await atwin.meet.unMuteAudio();
5805
+ ````
5806
+
5807
+ ### muteLocalAudio()
5808
+
5809
+ This method allows a participant to disable their microphone locally on their device. Unlike muting audio universally, which affects all participants, muting local audio only affects the participant who initiates it.
5810
+
5811
+ *Function Signature*
5812
+ ```typescript
5813
+ function muteLocalAudio(): Promise<boolean>
5814
+ ```
5815
+
5816
+ *Example:*
5817
+ ````typescript
5818
+ import * as atwin from 'architwin'
5819
+
5820
+ await atwin.meet.muteLocalAudio();
5821
+ ````
5822
+
5823
+ ### unMuteLocalAudio()
5824
+
5825
+ This method reactivates the participant's microphone on their local device.
5826
+
5827
+ *Function Signature*
5828
+ ```typescript
5829
+ function unMuteLocalAudio(): Promise<boolean>
5830
+ ```
5831
+
5832
+ *Example:*
5833
+ ````typescript
5834
+ import * as atwin from 'architwin'
5835
+
5836
+ await atwin.meet.unMuteLocalAudio();
5837
+ ````
5838
+
5839
+ ### getDevices()
5840
+
5841
+ This method retrieves information about the audio and video devices available on your computer. This includes listing all connected microphones, speakers, and cameras.
5842
+
5843
+ *Function Signature*
5844
+ ```typescript
5845
+ function getDevices(): Promise<{
5846
+ mics: MediaDevice[];
5847
+ speakers: MediaDevice[];
5848
+ cameras: MediaDevice[];
5849
+ }>
5850
+ ```
5851
+
5852
+ *Example:*
5853
+ ````typescript
5854
+ import * as atwin from 'architwin'
5855
+
5856
+ let mountedDevices: {
5857
+ mics: MediaDevice[];
5858
+ speakers: MediaDevice[];
5859
+ cameras: MediaDevice[];
5860
+ }
5861
+
5862
+ let activeMic: MediaDevice
5863
+ let activeCamera: MediaDevice
5864
+ let activeSpeaker: MediaDevice
5865
+
5866
+ try {
5867
+ // get mounted devices
5868
+ mountedDevices = await atwin.meet.getDevices();
5869
+
5870
+ // get active devices
5871
+ activeMic = mountedDevices.mics[0];
5872
+ activeCamera = mountedDevices.cameras[0];
5873
+ activeSpeaker = mountedDevices.speakers[0];
5874
+ } catch (error) {
5875
+ console.error("getMountedDevices error: ", error);
5876
+ }
5877
+ ````
5878
+
5879
+ ### switchMicrophone()
5880
+
5881
+ This method allows participants to change the microphone input source on their device during a meeting.
5882
+
5883
+ *Function Signature*
5884
+ ```typescript
5885
+ function switchMicrophone(deviceId: string): Promise<void>
5886
+ ```
5887
+
5888
+ *Example:*
5889
+ ````typescript
5890
+ import * as atwin from 'architwin'
5891
+
5892
+ let mountedDevices: {
5893
+ mics: MediaDevice[];
5894
+ speakers: MediaDevice[];
5895
+ cameras: MediaDevice[];
5896
+ }
5897
+
5898
+ // get mounted devices
5899
+ mountedDevices = await atwin.meet.getDevices();
5900
+
5901
+ let activeMic: MediaDevice
5902
+
5903
+ // Assume selectedAudio value is an item from mountedDevices mics list
5904
+ for (let item in mountedDevices.mics) {
5905
+ if(mountedDevices.mics[item].deviceId == selectedAudio){
5906
+ activeMic = mountedDevices.mics[item];
5907
+ await atwin.meet.switchMicrophone(activeMic.deviceId)
5908
+ }
5909
+ }
5910
+ ````
5911
+
5912
+ ### switchSpeaker()
5913
+
5914
+ Thnis method allows participants to change the output audio device, typically speakers or headphones, during a meeting.
5915
+
5916
+ *Function Signature*
5917
+ ```typescript
5918
+ function switchSpeaker(deviceId: string): Promise<void>
5919
+ ```
5920
+
5921
+ *Example:*
5922
+ ````typescript
5923
+ import * as atwin from 'architwin'
5924
+
5925
+ let mountedDevices: {
5926
+ mics: MediaDevice[];
5927
+ speakers: MediaDevice[];
5928
+ cameras: MediaDevice[];
5929
+ }
5930
+
5931
+ // get mounted devices
5932
+ mountedDevices = await atwin.meet.getDevices();
5933
+
5934
+ let activeSpeaker: MediaDevice
5935
+
5936
+ // Assume selectedSpeaker value is an item from mountedDevices speakers list
5937
+ for (let item in mountedDevices.speakers) {
5938
+ if(mountedDevices.speakers[item].deviceId == selectedSpeaker){
5939
+ activeSpeaker = mountedDevices.speakers[item];
5940
+ await atwin.meet.switchSpeaker(activeSpeaker.deviceId)
5941
+ }
5942
+ }
5943
+ ````
5944
+
5945
+ ### switchCamera()
5946
+
5947
+ This method allows users to change their video input source during a meeting. This feature lets users switch between different cameras connected to their device, such as built-in webcams, external USB cameras, or other video input devices.
5948
+
5949
+ *Function Signature*
5950
+ ```typescript
5951
+ function switchCamera(deviceId: string): Promise<void>
5952
+ ```
5953
+
5954
+ *Example:*
5955
+ ````typescript
5956
+ import * as atwin from 'architwin'
5957
+
5958
+ let mountedDevices: {
5959
+ mics: MediaDevice[];
5960
+ speakers: MediaDevice[];
5961
+ cameras: MediaDevice[];
5962
+ }
5963
+
5964
+ // get mounted devices
5965
+ mountedDevices = await atwin.meet.getDevices();
5966
+
5967
+ let activeCamera: MediaDevice
5968
+
5969
+ // Assume selectedCamera value is an item from mountedDevices cameras list
5970
+ for (let item in mountedDevices.cameras) {
5971
+ if(mountedDevices.cameras[item].deviceId == selectedCamera){
5972
+ activeCamera = mountedDevices.cameras[item];
5973
+ await atwin.meet.switchCamera(activeCamera.deviceId)
5974
+ }
5975
+ }
5976
+ ````
5977
+
5978
+ ### getMicList()
5979
+
5980
+ This method retrieves a list of all available microphones connected to the user's device.
5981
+
5982
+ *Function Signature*
5983
+ ```typescript
5984
+ function getMicList(): Promise<MediaDevice[]>
5985
+ ```
5986
+
5987
+ *Example:*
5988
+ ````typescript
5989
+ import * as atwin from 'architwin'
5990
+
5991
+ let mountedDevices: {
5992
+ mics: MediaDevice[];
5993
+ speakers: MediaDevice[];
5994
+ cameras: MediaDevice[];
5995
+ }
5996
+
5997
+ mountedDevices.mics = await atwin.meet.getMicList();
5998
+ ````
5999
+
6000
+ ### getSpeakerList()
6001
+
6002
+ This method retrieves a list of all available audio output devices, such as speakers and headphones, connected to the user's device.
6003
+
6004
+ *Function Signature*
6005
+ ```typescript
6006
+ function getSpeakerList(): Promise<MediaDevice[]>
6007
+ ```
6008
+
6009
+ *Example:*
6010
+ ````typescript
6011
+ import * as atwin from 'architwin'
6012
+
6013
+ let mountedDevices: {
6014
+ mics: MediaDevice[];
6015
+ speakers: MediaDevice[];
6016
+ cameras: MediaDevice[];
6017
+ }
6018
+
6019
+ mountedDevices.speakers = await atwin.meet.getSpeakerList();
6020
+ ````
6021
+
6022
+ ### getCameraList()
6023
+
6024
+ This method retrieves a list of all available cameras connected to the user's device.
6025
+
6026
+ *Function Signature*
6027
+ ```typescript
6028
+ function getCameraList(): Promise<MediaDevice[]>
6029
+ ```
6030
+
6031
+ *Example:*
6032
+ ````typescript
6033
+ import * as atwin from 'architwin'
6034
+
6035
+ let mountedDevices: {
6036
+ mics: MediaDevice[];
6037
+ speakers: MediaDevice[];
6038
+ cameras: MediaDevice[];
6039
+ }
6040
+
6041
+ mountedDevices.cameras = await atwin.meet.getCameraList();
6042
+ ````
6043
+
6044
+ ### createLocalVideoTrack()
6045
+
6046
+ This method initializes and creates a video track from the user's local camera. If no deviceId is provided, it defaults to the primary camera. This function returns a promise that resolves to an object containing the created `localVideoTrack` and a boolean `isVideoOn` indicating the status of the video.
6047
+
6048
+ *Function Signature*
6049
+ ```typescript
6050
+ function createLocalVideoTrack(deviceId?: string): Promise<{
6051
+ localVideoTrack: LocalVideoTrack;
6052
+ isVideoOn: boolean;
6053
+ }>
6054
+ ```
6055
+
6056
+ *Parameter Table*
6057
+ | parameter | type | required | default | values |
6058
+ | :----: | :----: | :---: | :---: | :---: |
6059
+ | deviceId | string | optional | | ID of the device |
6060
+
6061
+ *Example:*
6062
+ ````typescript
6063
+ import * as atwin from 'architwin'
6064
+
6065
+ // Variables
6066
+ let activeCamera: MediaDevice
6067
+ let mountedDevices: {
6068
+ mics: MediaDevice[];
6069
+ speakers: MediaDevice[];
6070
+ cameras: MediaDevice[];
6071
+ }
6072
+ let localVideo: {
6073
+ localVideoTrack: LocalVideoTrack;
6074
+ isVideoOn: boolean;
6075
+ }
6076
+
6077
+ // get devices
6078
+ mountedDevices = await atwin.meet.getDevices();
6079
+ // set active camera
6080
+ activeCamera = mountedDevices.cameras[0];
6081
+ // create local video track
6082
+ localVideo = await atwin.meet.createLocalVideoTrack(activeCamera.deviceId);
6083
+ ````
6084
+
6085
+ ### createLocalAudioTrack()
6086
+
6087
+ This method initializes and creates an audio track from the user's local microphone. If no deviceId or deviceType is provided, it defaults to the primary microphone. It returns a promise that resolves to an object containing the `localAudioTrack` and a boolean `isMuted` indicating if the audio is muted.
6088
+
6089
+ *Function Signature*
6090
+ ```typescript
6091
+ function createLocalAudioTrack(deviceId?: string, deviceType?: string): Promise<{
6092
+ localAudioTrack: LocalAudioTrack;
6093
+ isMuted: boolean;
6094
+ }>
6095
+ ```
6096
+
6097
+ *Parameter Table*
6098
+ | parameter | type | required | default | values |
6099
+ | :----: | :----: | :---: | :---: | :---: |
6100
+ | deviceId | string | optional | | ID of the device |
6101
+ | deviceType | string | optional | | Type of audio device |
6102
+
6103
+ *Example:*
6104
+ ````typescript
6105
+ import * as atwin from 'architwin'
6106
+
6107
+ // Variables
6108
+ let activeMic: MediaDevice
6109
+ let mountedDevices: {
6110
+ mics: MediaDevice[];
6111
+ speakers: MediaDevice[];
6112
+ cameras: MediaDevice[];
6113
+ }
6114
+ let localAudio: {
6115
+ localAudioTrack: LocalAudioTrack;
6116
+ isMuted: boolean;
6117
+ }
6118
+
6119
+ // get devices
6120
+ mountedDevices = await atwin.meet.getDevices();
6121
+ // set active camera
6122
+ activeMic = mountedDevices.mics[0];
6123
+ // create local video track
6124
+ localAudio = await atwin.meet.createLocalAudioTrack(activeMic.deviceId);
6125
+ ````
6126
+
6127
+ ### initializeHTMLElements()
6128
+
6129
+ This method reactivates the participant's microphone on their local device.
6130
+
6131
+ *Function Signature*
6132
+ ```typescript
6133
+ function initializeHTMLElements(
6134
+ videoElement: HTMLVideoElement | null,
6135
+ canvasElement: HTMLCanvasElement | null,
6136
+ paticipantCanvas: HTMLCanvasElement | null): Promise<void>
6137
+ ```
6138
+
6139
+ *Parameter Table*
6140
+ | parameter | type | required | default | values |
6141
+ | :----: | :----: | :---: | :---: | :---: |
6142
+ | videoElement | HTMLVideoElement | yes | null | (self) Local video element |
6143
+ | canvasElement | HTMLCanvasElement | yes | null | (self) Local canvas element |
6144
+ | paticipantCanvas | HTMLCanvasElement | yes | null | (remote) Participant canvas element |
6145
+
6146
+ *Example:*
6147
+ ````typescript
6148
+ import * as atwin from 'architwin'
6149
+
6150
+ // Replace with actual HTML elements
6151
+ const videoElement = document.getElementById("at-self-video") as HTMLVideoElement;
6152
+ const canvasElement = document.getElementById("at-self-canvas") as HTMLCanvasElement;
6153
+ const participantCanvas = document.getElementById("at-participant-canvas") as HTMLCanvasElement;
6154
+
6155
+ await atwin.meet.initializeHTMLElements(videoElement, canvasElement, participantCanvas);
6156
+ ````
6157
+
6158
+ -----
5186
6159
 
5187
- * deleteMediaScreen()
5188
- * hideMediaScreen()