40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
|
import { Injectable, Inject } from '@angular/core';
|
||
|
import { HttpClient } from '@angular/common/http';
|
||
|
|
||
|
import { _MODULE_CONFIG } from '../config/token';
|
||
|
import { ModuleConfig } from '../config/module-config';
|
||
|
import { Urls } from '../config/urls';
|
||
|
import { UrlConfig, WindowUtil } from '@ucap-webmessenger/core';
|
||
|
import { NGXLogger } from 'ngx-logger';
|
||
|
import {
|
||
|
ConferenceJoinRequest,
|
||
|
encodeConferenceJoin
|
||
|
} from '../apis/conference-join';
|
||
|
import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native';
|
||
|
|
||
|
@Injectable({
|
||
|
providedIn: 'root'
|
||
|
})
|
||
|
export class ConferenceService {
|
||
|
readonly urls: Urls;
|
||
|
|
||
|
constructor(
|
||
|
@Inject(_MODULE_CONFIG) private moduleConfig: ModuleConfig,
|
||
|
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
|
||
|
private httpClient: HttpClient,
|
||
|
private logger: NGXLogger
|
||
|
) {
|
||
|
this.urls = UrlConfig.getUrls(
|
||
|
this.moduleConfig.hostConfig,
|
||
|
this.moduleConfig.urls
|
||
|
);
|
||
|
}
|
||
|
|
||
|
public conferencejoin(req: ConferenceJoinRequest): void {
|
||
|
let url = this.urls.conferenceJoin;
|
||
|
url = url + `?${encodeConferenceJoin(req).toString()}`;
|
||
|
// WindowUtil.popupOpen(url, 'DaesangConfJoin', 685, 640);
|
||
|
this.nativeService.openDefaultBrowser(url);
|
||
|
}
|
||
|
}
|