tas-uell-sdk 0.0.5 → 0.1.0
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.
- package/README.md +161 -51
- package/esm2020/lib/components/tas-avatar/tas-avatar.component.mjs +75 -0
- package/esm2020/lib/components/tas-btn/tas-btn.component.mjs +146 -61
- package/esm2020/lib/components/tas-floating-call/tas-floating-call.component.mjs +48 -23
- package/esm2020/lib/components/tas-incoming-appointment/tas-incoming-appointment.component.mjs +109 -0
- package/esm2020/lib/components/tas-videocall/tas-videocall.component.mjs +217 -20
- package/esm2020/lib/components/tas-waiting-room/tas-waiting-room.component.mjs +226 -160
- package/esm2020/lib/config/tas.config.mjs +1 -1
- package/esm2020/lib/interfaces/tas.interfaces.mjs +45 -2
- package/esm2020/lib/services/geolocation.service.mjs +56 -0
- package/esm2020/lib/services/tas.service.mjs +400 -34
- package/esm2020/lib/tas-uell-sdk.module.mjs +25 -21
- package/esm2020/public-api.mjs +4 -1
- package/fesm2015/tas-uell-sdk.mjs +1323 -302
- package/fesm2015/tas-uell-sdk.mjs.map +1 -1
- package/fesm2020/tas-uell-sdk.mjs +1307 -300
- package/fesm2020/tas-uell-sdk.mjs.map +1 -1
- package/lib/components/tas-avatar/tas-avatar.component.d.ts +9 -0
- package/lib/components/tas-btn/tas-btn.component.d.ts +35 -15
- package/lib/components/tas-floating-call/tas-floating-call.component.d.ts +5 -1
- package/lib/components/tas-incoming-appointment/tas-incoming-appointment.component.d.ts +33 -0
- package/lib/components/tas-videocall/tas-videocall.component.d.ts +49 -3
- package/lib/components/tas-waiting-room/tas-waiting-room.component.d.ts +50 -35
- package/lib/config/tas.config.d.ts +7 -0
- package/lib/interfaces/tas.interfaces.d.ts +127 -35
- package/lib/services/geolocation.service.d.ts +24 -0
- package/lib/services/tas.service.d.ts +98 -9
- package/lib/tas-uell-sdk.module.d.ts +6 -3
- package/package.json +1 -1
- package/public-api.d.ts +3 -0
- package/src/lib/styles/tas-global.scss +27 -28
- package/INSTALL_AND_TEST.md +0 -427
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Observable } from
|
|
2
|
-
import * as OT from
|
|
3
|
-
import {
|
|
4
|
-
import { TasConfig, TasHttpClient } from
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import * as OT from '@opentok/client';
|
|
3
|
+
import { GenerateTokenResponse, StartSessionRequest, FinishSessionResponse, ProxyVideoStatusRequest, ProxyVideoStatusResponse, ProxyVideoFinishRequest, ProxyVideoUserModifyRequest, UserCallAction, RoomUserStatus, TasBusinessRole, CallState, ViewMode, WaitingRoomUser, TasAppointment, GetAppointmentsRequest } from '../interfaces/tas.interfaces';
|
|
4
|
+
import { TasConfig, TasHttpClient } from '../config/tas.config';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
export { CallState, ViewMode };
|
|
6
|
+
export { CallState, ViewMode, TasBusinessRole, UserCallAction, RoomUserStatus };
|
|
7
7
|
export declare class TasService {
|
|
8
8
|
private httpClient;
|
|
9
9
|
private config;
|
|
@@ -18,12 +18,55 @@ export declare class TasService {
|
|
|
18
18
|
isMuted$: Observable<boolean>;
|
|
19
19
|
private currentSessionId;
|
|
20
20
|
private currentToken;
|
|
21
|
+
private readonly STORAGE_KEY;
|
|
22
|
+
private readonly DISCONNECTED_FLAG_KEY;
|
|
23
|
+
private isFinishingSession;
|
|
24
|
+
private proxyVideoSessionId;
|
|
25
|
+
private proxyVideoToken;
|
|
26
|
+
private currentBusinessRole;
|
|
27
|
+
private waitingRoomUsersSubject;
|
|
28
|
+
waitingRoomUsers$: Observable<WaitingRoomUser[]>;
|
|
29
|
+
private ownerHasJoinedSubject;
|
|
30
|
+
ownerHasJoined$: Observable<boolean>;
|
|
31
|
+
private ownerHasLeftSubject;
|
|
32
|
+
ownerHasLeft$: Observable<boolean>;
|
|
33
|
+
private joinableSubject;
|
|
34
|
+
joinable$: Observable<boolean>;
|
|
35
|
+
private activateGeoSubject;
|
|
36
|
+
activateGeo$: Observable<boolean>;
|
|
37
|
+
private geoRequestActiveSubject;
|
|
38
|
+
geoRequestActive$: Observable<boolean>;
|
|
39
|
+
private allGeoGrantedSubject;
|
|
40
|
+
allGeoGranted$: Observable<boolean>;
|
|
41
|
+
private statusPollingInterval;
|
|
42
|
+
private readonly DEFAULT_POLL_INTERVAL_MS;
|
|
43
|
+
private wasOwnerPresent;
|
|
44
|
+
private currentAppointmentId;
|
|
45
|
+
private currentVideoCallId;
|
|
46
|
+
private currentTenant;
|
|
21
47
|
constructor(httpClient: TasHttpClient, config: TasConfig);
|
|
48
|
+
/**
|
|
49
|
+
* Start automatic status polling for the current session.
|
|
50
|
+
* Status is polled every intervalMs (default 30s).
|
|
51
|
+
*/
|
|
52
|
+
startStatusPolling(params: ProxyVideoStatusRequest, intervalMs?: number): void;
|
|
53
|
+
/**
|
|
54
|
+
* Stop automatic status polling.
|
|
55
|
+
*/
|
|
56
|
+
stopStatusPolling(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Reset polling state (waiting room, owner status, etc)
|
|
59
|
+
* Call this when completely exiting the flow
|
|
60
|
+
*/
|
|
61
|
+
resetPollingState(): void;
|
|
22
62
|
get currentSession(): OT.Session | null;
|
|
23
63
|
get currentPublisher(): OT.Publisher | null;
|
|
24
64
|
get currentSubscribers(): OT.Subscriber[];
|
|
25
65
|
get sessionId(): string | null;
|
|
26
66
|
get token(): string | null;
|
|
67
|
+
get proxySessionId(): string | null;
|
|
68
|
+
get proxyToken(): string | null;
|
|
69
|
+
get businessRole(): TasBusinessRole;
|
|
27
70
|
get isMuted(): boolean;
|
|
28
71
|
setViewMode(mode: ViewMode): void;
|
|
29
72
|
enterPipMode(): void;
|
|
@@ -31,14 +74,60 @@ export declare class TasService {
|
|
|
31
74
|
isPipMode(): boolean;
|
|
32
75
|
toggleMute(): void;
|
|
33
76
|
setMute(muted: boolean): void;
|
|
34
|
-
disconnectSession(): void;
|
|
77
|
+
disconnectSession(clearStorage?: boolean): void;
|
|
35
78
|
isCallActive(): boolean;
|
|
36
|
-
|
|
37
|
-
|
|
79
|
+
private saveSessionState;
|
|
80
|
+
private clearSessionState;
|
|
81
|
+
canRestoreSession(): boolean;
|
|
82
|
+
restoreSession(containerId: string): void;
|
|
83
|
+
/**
|
|
84
|
+
* PROXY circuit token: /v2/proxy/video/start
|
|
85
|
+
*/
|
|
86
|
+
startProxyVideoSession(payload: StartSessionRequest): Observable<GenerateTokenResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* PROXY circuit status: /v2/proxy/video/status
|
|
89
|
+
*/
|
|
90
|
+
getProxyVideoStatus(payload: ProxyVideoStatusRequest): Observable<ProxyVideoStatusResponse>;
|
|
91
|
+
/**
|
|
92
|
+
* PROXY circuit user modification: /v2/proxy/video/user/modify
|
|
93
|
+
*/
|
|
94
|
+
modifyProxyVideoUser(payload: ProxyVideoUserModifyRequest): Observable<any>;
|
|
95
|
+
finishProxyVideoSession(payload: ProxyVideoFinishRequest): Observable<FinishSessionResponse>;
|
|
96
|
+
/**
|
|
97
|
+
* Get user appointments within a date range.
|
|
98
|
+
* @param params Date range for querying appointments
|
|
99
|
+
* @returns Observable of appointment array
|
|
100
|
+
*/
|
|
101
|
+
getAppointments(params: GetAppointmentsRequest): Observable<TasAppointment[]>;
|
|
102
|
+
/**
|
|
103
|
+
* Start automatic status polling for the current session.
|
|
104
|
+
* Status is polled every STATUS_POLL_INTERVAL_MS milliseconds.
|
|
105
|
+
*/
|
|
106
|
+
/**
|
|
107
|
+
* Stop automatic status polling.
|
|
108
|
+
*/
|
|
109
|
+
/**
|
|
110
|
+
* Fetch status and process the response.
|
|
111
|
+
*/
|
|
112
|
+
private fetchAndProcessStatus;
|
|
113
|
+
/**
|
|
114
|
+
* Process status response to update waiting room users and owner join status.
|
|
115
|
+
*/
|
|
116
|
+
private processStatusResponse;
|
|
117
|
+
/**
|
|
118
|
+
* Check if at least one OWNER has joined the call.
|
|
119
|
+
*/
|
|
120
|
+
private checkIfOwnerJoined;
|
|
121
|
+
/**
|
|
122
|
+
* Admit a user from the waiting room by changing their status.
|
|
123
|
+
*/
|
|
124
|
+
admitUserFromWaitingRoom(userId: number, videoCallId: number): Observable<any>;
|
|
125
|
+
get appointmentId(): number | null;
|
|
126
|
+
get videoCallId(): number | null;
|
|
38
127
|
/**
|
|
39
128
|
* Connects to a TokBox video session
|
|
40
129
|
*/
|
|
41
|
-
connectSession(sessionId: string, token: string, publisherElement: string, subscriberElement: string): Promise<void>;
|
|
130
|
+
connectSession(sessionId: string, token: string, publisherElement: string, subscriberElement: string, businessRole?: TasBusinessRole): Promise<void>;
|
|
42
131
|
movePublisherTo(newContainerId: string): void;
|
|
43
132
|
moveSubscribersTo(newContainerId: string): void;
|
|
44
133
|
/**
|
|
@@ -5,8 +5,11 @@ import * as i1 from "./components/tas-btn/tas-btn.component";
|
|
|
5
5
|
import * as i2 from "./components/tas-videocall/tas-videocall.component";
|
|
6
6
|
import * as i3 from "./components/tas-floating-call/tas-floating-call.component";
|
|
7
7
|
import * as i4 from "./components/tas-waiting-room/tas-waiting-room.component";
|
|
8
|
-
import * as i5 from "
|
|
9
|
-
import * as i6 from "
|
|
8
|
+
import * as i5 from "./components/tas-avatar/tas-avatar.component";
|
|
9
|
+
import * as i6 from "./components/tas-incoming-appointment/tas-incoming-appointment.component";
|
|
10
|
+
import * as i7 from "@angular/common";
|
|
11
|
+
import * as i8 from "@angular/forms";
|
|
12
|
+
import * as i9 from "@ng-bootstrap/ng-bootstrap";
|
|
10
13
|
export declare class TasUellSdkModule {
|
|
11
14
|
/**
|
|
12
15
|
* Use forRoot() to configure the TAS SDK module with required dependencies.
|
|
@@ -42,6 +45,6 @@ export declare class TasUellSdkModule {
|
|
|
42
45
|
httpClient: new (...args: any[]) => TasHttpClient;
|
|
43
46
|
}): ModuleWithProviders<TasUellSdkModule>;
|
|
44
47
|
static ɵfac: i0.ɵɵFactoryDeclaration<TasUellSdkModule, never>;
|
|
45
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<TasUellSdkModule, [typeof i1.TasButtonComponent, typeof i2.TasVideocallComponent, typeof i3.TasFloatingCallComponent, typeof i4.TasWaitingRoomComponent], [typeof
|
|
48
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TasUellSdkModule, [typeof i1.TasButtonComponent, typeof i2.TasVideocallComponent, typeof i3.TasFloatingCallComponent, typeof i4.TasWaitingRoomComponent, typeof i5.TasAvatarComponent, typeof i6.TasIncomingAppointmentComponent], [typeof i7.CommonModule, typeof i8.FormsModule, typeof i9.NgbTooltipModule], [typeof i1.TasButtonComponent, typeof i2.TasVideocallComponent, typeof i3.TasFloatingCallComponent, typeof i4.TasWaitingRoomComponent, typeof i5.TasAvatarComponent, typeof i6.TasIncomingAppointmentComponent]>;
|
|
46
49
|
static ɵinj: i0.ɵɵInjectorDeclaration<TasUellSdkModule>;
|
|
47
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tas-uell-sdk",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "TAS (Telemedicine Assistance Service) SDK for Angular applications - Video call functionality using TokBox/Vonage",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0",
|
package/public-api.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export * from './lib/config/tas.config';
|
|
2
2
|
export * from './lib/interfaces/tas.interfaces';
|
|
3
3
|
export * from './lib/services/tas.service';
|
|
4
|
+
export * from './lib/services/geolocation.service';
|
|
4
5
|
export * from './lib/components/tas-btn/tas-btn.component';
|
|
5
6
|
export * from './lib/components/tas-waiting-room/tas-waiting-room.component';
|
|
6
7
|
export * from './lib/components/tas-videocall/tas-videocall.component';
|
|
7
8
|
export * from './lib/components/tas-floating-call/tas-floating-call.component';
|
|
9
|
+
export * from './lib/components/tas-avatar/tas-avatar.component';
|
|
10
|
+
export * from './lib/components/tas-incoming-appointment/tas-incoming-appointment.component';
|
|
8
11
|
export * from './lib/tas-uell-sdk.module';
|
|
@@ -2,36 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
/* TAS Video Modal - global styles for NgbModal wrapper */
|
|
4
4
|
.tas-video-modal {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
.modal-dialog {
|
|
6
|
+
max-width: 100vw;
|
|
7
|
+
margin: 0;
|
|
8
|
+
height: 100vh;
|
|
9
|
+
}
|
|
10
|
+
.modal-content {
|
|
11
|
+
height: 100vh;
|
|
12
|
+
border: none;
|
|
13
|
+
border-radius: 0;
|
|
14
|
+
background: #000;
|
|
15
|
+
}
|
|
16
|
+
.modal-body {
|
|
17
|
+
padding: 0;
|
|
18
|
+
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/* TAS Waiting Room Modal - global styles for NgbModal wrapper */
|
|
22
22
|
.tas-waiting-room-modal {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
.modal-dialog {
|
|
24
|
+
max-width: 480px;
|
|
25
|
+
}
|
|
26
|
+
.modal-content {
|
|
27
|
+
border: none;
|
|
28
|
+
border-radius: 5px;
|
|
29
|
+
background: #ffffff;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
|
|
32
|
+
}
|
|
33
|
+
.modal-body {
|
|
34
|
+
padding: 0;
|
|
35
|
+
}
|
|
36
36
|
}
|
|
37
|
-
|
package/INSTALL_AND_TEST.md
DELETED
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
# TAS-UELL-SDK Library Installation & Testing Guide
|
|
2
|
-
|
|
3
|
-
This guide provides step-by-step instructions for installing and testing the `tas-uell-sdk` Angular library.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Prerequisites
|
|
8
|
-
|
|
9
|
-
- Angular 13+ project
|
|
10
|
-
- Node.js and npm installed
|
|
11
|
-
- A TokBox/Vonage API Key (for video call functionality)
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Installation Steps
|
|
16
|
-
|
|
17
|
-
### Step 1: Install the Library
|
|
18
|
-
|
|
19
|
-
Install from npm:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
npm install tas-uell-sdk --legacy-peer-deps
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### Step 2: Install Peer Dependencies
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
npm install @ng-bootstrap/ng-bootstrap @opentok/client interactjs --legacy-peer-deps
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Step 3: Install Style Dependencies (IMPORTANT!)
|
|
32
|
-
|
|
33
|
-
The library uses **Font Awesome icons** and **Bootstrap** for styling:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
npm install font-awesome bootstrap --legacy-peer-deps
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### Step 4: Add Styles to angular.json
|
|
40
|
-
|
|
41
|
-
Update your `angular.json` file to include the required CSS files in the `styles` array:
|
|
42
|
-
|
|
43
|
-
```json
|
|
44
|
-
{
|
|
45
|
-
"projects": {
|
|
46
|
-
"your-project-name": {
|
|
47
|
-
"architect": {
|
|
48
|
-
"build": {
|
|
49
|
-
"options": {
|
|
50
|
-
"styles": [
|
|
51
|
-
"node_modules/bootstrap/dist/css/bootstrap.min.css",
|
|
52
|
-
"node_modules/font-awesome/css/font-awesome.min.css",
|
|
53
|
-
"src/styles.scss"
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
**Important:** Make sure Bootstrap and Font Awesome are added BEFORE your custom styles.
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## Configuration Steps
|
|
68
|
-
|
|
69
|
-
### Step 5: Create HTTP Adapter Service
|
|
70
|
-
|
|
71
|
-
Create a new file at `src/app/adapters/tas-http-adapter.service.ts`:
|
|
72
|
-
|
|
73
|
-
```typescript
|
|
74
|
-
import { Injectable } from '@angular/core';
|
|
75
|
-
import { HttpClient } from '@angular/common/http';
|
|
76
|
-
import { Observable } from 'rxjs';
|
|
77
|
-
import { TasHttpClient } from 'tas-uell-sdk';
|
|
78
|
-
|
|
79
|
-
@Injectable({ providedIn: 'root' })
|
|
80
|
-
export class TasHttpAdapterService implements TasHttpClient {
|
|
81
|
-
// IMPORTANT: Change this to your actual API URL
|
|
82
|
-
private apiUrl = 'https://your-api-url.com';
|
|
83
|
-
|
|
84
|
-
constructor(private http: HttpClient) {}
|
|
85
|
-
|
|
86
|
-
post<T>(url: string, options: { body: any; headers?: Record<string, string> }): Observable<T> {
|
|
87
|
-
return this.http.post<T>(`${this.apiUrl}/${url}`, options.body, {
|
|
88
|
-
headers: options.headers
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### Step 6: Update AppModule
|
|
95
|
-
|
|
96
|
-
Update `src/app/app.module.ts` to import and configure the TAS SDK:
|
|
97
|
-
|
|
98
|
-
```typescript
|
|
99
|
-
import { NgModule } from '@angular/core';
|
|
100
|
-
import { BrowserModule } from '@angular/platform-browser';
|
|
101
|
-
import { HttpClientModule } from '@angular/common/http';
|
|
102
|
-
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
|
103
|
-
|
|
104
|
-
// Import TAS SDK
|
|
105
|
-
import { TasUellSdkModule } from 'tas-uell-sdk';
|
|
106
|
-
import { TasHttpAdapterService } from './adapters/tas-http-adapter.service';
|
|
107
|
-
|
|
108
|
-
// IMPORTANT: Replace with your actual TokBox API Key
|
|
109
|
-
const TOKBOX_API_KEY = 'YOUR_TOKBOX_API_KEY';
|
|
110
|
-
|
|
111
|
-
@NgModule({
|
|
112
|
-
declarations: [
|
|
113
|
-
AppComponent,
|
|
114
|
-
// ... your other components
|
|
115
|
-
],
|
|
116
|
-
imports: [
|
|
117
|
-
BrowserModule,
|
|
118
|
-
HttpClientModule,
|
|
119
|
-
NgbModule,
|
|
120
|
-
|
|
121
|
-
// TAS SDK configuration
|
|
122
|
-
TasUellSdkModule.forRoot({
|
|
123
|
-
config: { tokBoxApiKey: TOKBOX_API_KEY },
|
|
124
|
-
httpClient: TasHttpAdapterService
|
|
125
|
-
})
|
|
126
|
-
],
|
|
127
|
-
providers: [],
|
|
128
|
-
bootstrap: [AppComponent]
|
|
129
|
-
})
|
|
130
|
-
export class AppModule { }
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Step 7: Add Global Modal Styles
|
|
134
|
-
|
|
135
|
-
Add these styles to your `src/styles.scss` (or `src/styles.css`):
|
|
136
|
-
|
|
137
|
-
```scss
|
|
138
|
-
/* TAS Video Modal - Full screen video call */
|
|
139
|
-
.tas-video-modal {
|
|
140
|
-
.modal-dialog {
|
|
141
|
-
max-width: 100vw;
|
|
142
|
-
margin: 0;
|
|
143
|
-
height: 100vh;
|
|
144
|
-
}
|
|
145
|
-
.modal-content {
|
|
146
|
-
height: 100vh;
|
|
147
|
-
border: none;
|
|
148
|
-
border-radius: 0;
|
|
149
|
-
background: #000;
|
|
150
|
-
}
|
|
151
|
-
.modal-body {
|
|
152
|
-
padding: 0;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/* TAS Waiting Room Modal */
|
|
157
|
-
.tas-waiting-room-modal {
|
|
158
|
-
.modal-dialog {
|
|
159
|
-
max-width: 480px;
|
|
160
|
-
}
|
|
161
|
-
.modal-content {
|
|
162
|
-
border: none;
|
|
163
|
-
border-radius: 5px;
|
|
164
|
-
background: #ffffff;
|
|
165
|
-
overflow: hidden;
|
|
166
|
-
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
|
|
167
|
-
}
|
|
168
|
-
.modal-body {
|
|
169
|
-
padding: 0;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### Step 8: Add Floating Call Component
|
|
175
|
-
|
|
176
|
-
Update `src/app/app.component.html` to include the floating call component at the end:
|
|
177
|
-
|
|
178
|
-
```html
|
|
179
|
-
<!-- Your existing content -->
|
|
180
|
-
<router-outlet></router-outlet>
|
|
181
|
-
|
|
182
|
-
<!-- Add this line at the end for Picture-in-Picture support -->
|
|
183
|
-
<tas-floating-call></tas-floating-call>
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## Usage - Create a Test Component
|
|
189
|
-
|
|
190
|
-
### Step 9: Create a Test Component
|
|
191
|
-
|
|
192
|
-
Create `src/app/tas-test/tas-test.component.ts`:
|
|
193
|
-
|
|
194
|
-
```typescript
|
|
195
|
-
import { Component } from '@angular/core';
|
|
196
|
-
import { TasCurrentUser, TasUserRole } from 'tas-uell-sdk';
|
|
197
|
-
|
|
198
|
-
@Component({
|
|
199
|
-
selector: 'app-tas-test',
|
|
200
|
-
template: `
|
|
201
|
-
<div style="padding: 40px; text-align: center;">
|
|
202
|
-
<h1>TAS SDK Test</h1>
|
|
203
|
-
<p>Click the button below to test the video call functionality:</p>
|
|
204
|
-
|
|
205
|
-
<tas-btn
|
|
206
|
-
[appointmentId]="appointmentId"
|
|
207
|
-
[product]="product"
|
|
208
|
-
[tenantId]="tenantId"
|
|
209
|
-
[currentUser]="currentUser"
|
|
210
|
-
[ownerUserIds]="[userId]"
|
|
211
|
-
[regularUserIds]="[]"
|
|
212
|
-
[moderatorUserIds]="[]"
|
|
213
|
-
></tas-btn>
|
|
214
|
-
|
|
215
|
-
<hr style="margin: 40px 0;">
|
|
216
|
-
|
|
217
|
-
<h3>Test Configuration:</h3>
|
|
218
|
-
<pre style="text-align: left; background: #f5f5f5; padding: 20px; border-radius: 8px;">
|
|
219
|
-
User ID: {{ userId }}
|
|
220
|
-
Appointment ID: {{ appointmentId }}
|
|
221
|
-
Product: {{ product }}
|
|
222
|
-
Tenant ID: {{ tenantId }}
|
|
223
|
-
Current User: {{ currentUser | json }}
|
|
224
|
-
</pre>
|
|
225
|
-
</div>
|
|
226
|
-
`
|
|
227
|
-
})
|
|
228
|
-
export class TasTestComponent {
|
|
229
|
-
// Test configuration - modify these values as needed
|
|
230
|
-
userId = 12345;
|
|
231
|
-
appointmentId = 1;
|
|
232
|
-
product = 'test-product';
|
|
233
|
-
tenantId = 'test-tenant';
|
|
234
|
-
|
|
235
|
-
currentUser: TasCurrentUser = {
|
|
236
|
-
name: 'Test',
|
|
237
|
-
lastname: 'User',
|
|
238
|
-
role: TasUserRole.OWNER
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
### Step 10: Register the Test Component
|
|
244
|
-
|
|
245
|
-
Add the test component to your module declarations in `app.module.ts`:
|
|
246
|
-
|
|
247
|
-
```typescript
|
|
248
|
-
import { TasTestComponent } from './tas-test/tas-test.component';
|
|
249
|
-
|
|
250
|
-
@NgModule({
|
|
251
|
-
declarations: [
|
|
252
|
-
AppComponent,
|
|
253
|
-
TasTestComponent, // Add this
|
|
254
|
-
// ... other components
|
|
255
|
-
],
|
|
256
|
-
// ...
|
|
257
|
-
})
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
### Step 11: Add Route or Use Directly
|
|
261
|
-
|
|
262
|
-
**Option A - Add a route** in `app-routing.module.ts`:
|
|
263
|
-
|
|
264
|
-
```typescript
|
|
265
|
-
const routes: Routes = [
|
|
266
|
-
{ path: 'tas-test', component: TasTestComponent },
|
|
267
|
-
// ... other routes
|
|
268
|
-
];
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
**Option B - Use directly** in `app.component.html`:
|
|
272
|
-
|
|
273
|
-
```html
|
|
274
|
-
<app-tas-test></app-tas-test>
|
|
275
|
-
<tas-floating-call></tas-floating-call>
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
---
|
|
279
|
-
|
|
280
|
-
## Run and Test
|
|
281
|
-
|
|
282
|
-
### Step 12: Start the Application
|
|
283
|
-
|
|
284
|
-
```bash
|
|
285
|
-
ng serve
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
### Step 13: Navigate to Test Page
|
|
289
|
-
|
|
290
|
-
Open your browser and go to:
|
|
291
|
-
- `http://localhost:4200/tas-test` (if using route)
|
|
292
|
-
- Or `http://localhost:4200` (if using directly in app.component)
|
|
293
|
-
|
|
294
|
-
### Step 14: Test the Video Call
|
|
295
|
-
|
|
296
|
-
1. Click the **"Iniciar TAS"** button
|
|
297
|
-
2. The waiting room modal should appear
|
|
298
|
-
3. Click **"Create Room"** to create a video room
|
|
299
|
-
4. Click **"Join Session"** to enter the video call
|
|
300
|
-
5. Test the controls: mute, swap views, minimize to PiP
|
|
301
|
-
6. Test the floating window (PiP mode)
|
|
302
|
-
7. Click hang up to end the call
|
|
303
|
-
|
|
304
|
-
---
|
|
305
|
-
|
|
306
|
-
## Style Dependencies Summary
|
|
307
|
-
|
|
308
|
-
| Dependency | Purpose | Required |
|
|
309
|
-
|------------|---------|----------|
|
|
310
|
-
| `bootstrap` | Button styles, modal layout | ✅ Yes |
|
|
311
|
-
| `font-awesome` | Icons (video, phone, mute, etc.) | ✅ Yes |
|
|
312
|
-
| Global modal styles | Modal positioning | ✅ Yes (add to styles.scss) |
|
|
313
|
-
|
|
314
|
-
---
|
|
315
|
-
|
|
316
|
-
## API Endpoints Required
|
|
317
|
-
|
|
318
|
-
Your backend API must provide these endpoints:
|
|
319
|
-
|
|
320
|
-
| Method | Endpoint | Description |
|
|
321
|
-
|--------|----------|-------------|
|
|
322
|
-
| POST | `v2/room` | Creates a new video room |
|
|
323
|
-
| POST | `v2/room/token` | Generates a session token |
|
|
324
|
-
|
|
325
|
-
### Request/Response Examples
|
|
326
|
-
|
|
327
|
-
**POST v2/room**
|
|
328
|
-
```json
|
|
329
|
-
// Request
|
|
330
|
-
{
|
|
331
|
-
"roomType": "TAS",
|
|
332
|
-
"type": "SPONTANEOUS",
|
|
333
|
-
"tenant": "tenant-id",
|
|
334
|
-
"appointmentId": 123,
|
|
335
|
-
"users": [{ "userExternalId": 12345, "rol": "OWNER" }],
|
|
336
|
-
"product": "product-name"
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// Response
|
|
340
|
-
{
|
|
341
|
-
"content": {
|
|
342
|
-
"sessionId": "session-id-from-tokbox",
|
|
343
|
-
"roomId": 456
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
**POST v2/room/token**
|
|
349
|
-
```json
|
|
350
|
-
// Request
|
|
351
|
-
{
|
|
352
|
-
"sessionId": "session-id-from-tokbox",
|
|
353
|
-
"name": "John",
|
|
354
|
-
"lastname": "Doe",
|
|
355
|
-
"roleVC": "OWNER"
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
// Response
|
|
359
|
-
{
|
|
360
|
-
"content": {
|
|
361
|
-
"token": "tokbox-token-string"
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
---
|
|
367
|
-
|
|
368
|
-
## Troubleshooting
|
|
369
|
-
|
|
370
|
-
### Styles not applying
|
|
371
|
-
- ✅ Check that `bootstrap` and `font-awesome` are installed
|
|
372
|
-
- ✅ Check that styles are added to `angular.json` in the correct order
|
|
373
|
-
- ✅ Check that global modal styles are in `styles.scss`
|
|
374
|
-
- ✅ Restart `ng serve` after modifying `angular.json`
|
|
375
|
-
|
|
376
|
-
### Icons not showing
|
|
377
|
-
- ✅ Verify `font-awesome` is installed: `npm list font-awesome`
|
|
378
|
-
- ✅ Verify the CSS is in `angular.json`: `"node_modules/font-awesome/css/font-awesome.min.css"`
|
|
379
|
-
|
|
380
|
-
### "Cannot find module 'tas-uell-sdk'"
|
|
381
|
-
- ✅ Verify installation: `npm list tas-uell-sdk`
|
|
382
|
-
|
|
383
|
-
### "No provider for TAS_CONFIG"
|
|
384
|
-
- ✅ Ensure `TasUellSdkModule.forRoot()` is called in AppModule
|
|
385
|
-
|
|
386
|
-
### "No provider for TAS_HTTP_CLIENT"
|
|
387
|
-
- ✅ Ensure `httpClient` is passed to `forRoot()`
|
|
388
|
-
|
|
389
|
-
### NgbModal errors
|
|
390
|
-
- ✅ Ensure `NgbModule` is imported in AppModule
|
|
391
|
-
|
|
392
|
-
### Video not working
|
|
393
|
-
- ✅ Check browser console for TokBox errors
|
|
394
|
-
- ✅ Verify TokBox API key is correct
|
|
395
|
-
- ✅ Check camera/microphone permissions
|
|
396
|
-
|
|
397
|
-
---
|
|
398
|
-
|
|
399
|
-
## Checklist
|
|
400
|
-
|
|
401
|
-
- [ ] Library installed (`npm install tas-uell-sdk`)
|
|
402
|
-
- [ ] Peer dependencies installed (`@ng-bootstrap/ng-bootstrap`, `@opentok/client`, `interactjs`)
|
|
403
|
-
- [ ] Style dependencies installed (`bootstrap`, `font-awesome`)
|
|
404
|
-
- [ ] Styles added to `angular.json`
|
|
405
|
-
- [ ] HTTP Adapter service created
|
|
406
|
-
- [ ] AppModule updated with `TasUellSdkModule.forRoot()`
|
|
407
|
-
- [ ] Global modal styles added to `styles.scss`
|
|
408
|
-
- [ ] `<tas-floating-call>` added to app.component.html
|
|
409
|
-
- [ ] Test component created
|
|
410
|
-
- [ ] TokBox API key configured
|
|
411
|
-
- [ ] Backend API endpoints available
|
|
412
|
-
|
|
413
|
-
---
|
|
414
|
-
|
|
415
|
-
## Success Criteria
|
|
416
|
-
|
|
417
|
-
The library is working correctly if:
|
|
418
|
-
1. ✅ The TAS button renders with proper styling (pink/magenta button with video icon)
|
|
419
|
-
2. ✅ Clicking the button opens the waiting room modal
|
|
420
|
-
3. ✅ "Create Room" successfully calls the API
|
|
421
|
-
4. ✅ "Join Session" opens the full-screen video call
|
|
422
|
-
5. ✅ Video from camera is displayed
|
|
423
|
-
6. ✅ Mute/unmute works (icon changes)
|
|
424
|
-
7. ✅ Minimize to PiP works
|
|
425
|
-
8. ✅ Expand from PiP works
|
|
426
|
-
9. ✅ Hang up ends the call properly
|
|
427
|
-
|