mirror of https://github.com/OpenVidu/openvidu.git
openvidu-testapp: add ingress URL type selector
parent
6e1d9c7ee7
commit
6ea42e82c0
|
@ -197,6 +197,16 @@
|
|||
<span style="display: inline-block" matTooltip="Only for WHIP" [matTooltipDisabled]="inputTypeSelected === 1">
|
||||
<mat-checkbox id="ingress-transcoding" [(ngModel)]="ingressEnableTranscoding" [disabled]="inputTypeSelected !== 1">Transcoding</mat-checkbox>
|
||||
</span>
|
||||
<span style="display: inline-block" matTooltip="Only for URL input type" [matTooltipDisabled]="inputTypeSelected === 2">
|
||||
<mat-form-field id="ingress-url-type-select">
|
||||
<mat-label>URL type</mat-label>
|
||||
<mat-select [(value)]="ingressUrlType" [disabled]="inputTypeSelected !== 2">
|
||||
<mat-option *ngFor="let urlType of INGRESS_URL_TYPES" [value]="urlType" [id]="'mat-option-' + urlType">
|
||||
{{urlType}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</span>
|
||||
<span style="display: inline-block" [matTooltip]="!ingressWithVideo ? 'Only with video' : 'Preset overrides this value'"
|
||||
[matTooltipDisabled]="!!ingressWithVideo && ingressVideoEncodingPresetSelected == undefined">
|
||||
<mat-form-field id="ingress-video-codec-select">
|
||||
|
|
|
@ -68,6 +68,9 @@ export class RoomApiDialogComponent {
|
|||
ingressEnableTranscoding: boolean = false;
|
||||
ingressVideoEncodingPresetSelected?: IngressVideoEncodingPreset = undefined;
|
||||
|
||||
INGRESS_URL_TYPES: string[] = ['HTTP', 'SRT', 'RTSP'];
|
||||
ingressUrlType: string = 'HTTP';
|
||||
|
||||
response: string;
|
||||
|
||||
INGRESS_INPUT_TYPES: { value: IngressInput; viewValue: string }[] = [
|
||||
|
@ -303,6 +306,7 @@ export class RoomApiDialogComponent {
|
|||
const ingress = await this.roomApiService.createIngress(
|
||||
this.ingressRoomName,
|
||||
this.inputTypeSelected,
|
||||
this.ingressUrlType,
|
||||
this.ingressWithAudio,
|
||||
this.ingressWithVideo,
|
||||
this.ingressVideoCodecSelected,
|
||||
|
|
|
@ -208,6 +208,7 @@ export class RoomApiService {
|
|||
async createIngress(
|
||||
room_name: string,
|
||||
inputType: IngressInput,
|
||||
urlInputType: string,
|
||||
withAudio: boolean,
|
||||
withVideo: boolean,
|
||||
codec: VideoCodec,
|
||||
|
@ -216,6 +217,8 @@ export class RoomApiService {
|
|||
preset?: IngressVideoEncodingPreset
|
||||
): Promise<IngressInfo> {
|
||||
let url;
|
||||
switch (urlInputType) {
|
||||
case 'HTTP':
|
||||
if (!withVideo) {
|
||||
url =
|
||||
'https://s3.eu-west-1.amazonaws.com/public.openvidu.io/bbb_sunflower_1080p_60fps_normal_onlyaudio.mp3';
|
||||
|
@ -224,6 +227,14 @@ export class RoomApiService {
|
|||
? 'https://s3.eu-west-1.amazonaws.com/public.openvidu.io/bbb_sunflower_1080p_60fps_normal.mp4'
|
||||
: 'https://s3.eu-west-1.amazonaws.com/public.openvidu.io/bbb_sunflower_1080p_60fps_normal_noaudio.mp4';
|
||||
}
|
||||
break;
|
||||
case 'SRT':
|
||||
url = 'srt://127.0.0.1:8554/';
|
||||
break;
|
||||
case 'RTSP':
|
||||
url = 'rtsp://127.0.0.1:8554/';
|
||||
break;
|
||||
}
|
||||
let options: CreateIngressOptions = {
|
||||
name: inputType + '-' + room_name,
|
||||
roomName: room_name,
|
||||
|
|
Loading…
Reference in New Issue