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"> <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> <mat-checkbox id="ingress-transcoding" [(ngModel)]="ingressEnableTranscoding" [disabled]="inputTypeSelected !== 1">Transcoding</mat-checkbox>
</span> </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'" <span style="display: inline-block" [matTooltip]="!ingressWithVideo ? 'Only with video' : 'Preset overrides this value'"
[matTooltipDisabled]="!!ingressWithVideo && ingressVideoEncodingPresetSelected == undefined"> [matTooltipDisabled]="!!ingressWithVideo && ingressVideoEncodingPresetSelected == undefined">
<mat-form-field id="ingress-video-codec-select"> <mat-form-field id="ingress-video-codec-select">

View File

@ -68,6 +68,9 @@ export class RoomApiDialogComponent {
ingressEnableTranscoding: boolean = false; ingressEnableTranscoding: boolean = false;
ingressVideoEncodingPresetSelected?: IngressVideoEncodingPreset = undefined; ingressVideoEncodingPresetSelected?: IngressVideoEncodingPreset = undefined;
INGRESS_URL_TYPES: string[] = ['HTTP', 'SRT', 'RTSP'];
ingressUrlType: string = 'HTTP';
response: string; response: string;
INGRESS_INPUT_TYPES: { value: IngressInput; viewValue: string }[] = [ INGRESS_INPUT_TYPES: { value: IngressInput; viewValue: string }[] = [
@ -303,6 +306,7 @@ export class RoomApiDialogComponent {
const ingress = await this.roomApiService.createIngress( const ingress = await this.roomApiService.createIngress(
this.ingressRoomName, this.ingressRoomName,
this.inputTypeSelected, this.inputTypeSelected,
this.ingressUrlType,
this.ingressWithAudio, this.ingressWithAudio,
this.ingressWithVideo, this.ingressWithVideo,
this.ingressVideoCodecSelected, this.ingressVideoCodecSelected,

View File

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