openvidu-testapp: add ingress URL type selector

master
pabloFuente 2025-02-03 15:35:41 +01:00
parent 6e1d9c7ee7
commit 6ea42e82c0
3 changed files with 32 additions and 7 deletions

View File

@ -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">

View File

@ -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,

View File

@ -208,6 +208,7 @@ export class RoomApiService {
async createIngress(
room_name: string,
inputType: IngressInput,
urlInputType: string,
withAudio: boolean,
withVideo: boolean,
codec: VideoCodec,
@ -216,13 +217,23 @@ export class RoomApiService {
preset?: IngressVideoEncodingPreset
): Promise<IngressInfo> {
let url;
if (!withVideo) {
url =
'https://s3.eu-west-1.amazonaws.com/public.openvidu.io/bbb_sunflower_1080p_60fps_normal_onlyaudio.mp3';
} else {
url = withAudio
? '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';
switch (urlInputType) {
case 'HTTP':
if (!withVideo) {
url =
'https://s3.eu-west-1.amazonaws.com/public.openvidu.io/bbb_sunflower_1080p_60fps_normal_onlyaudio.mp3';
} else {
url = withAudio
? '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,