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">
|
<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">
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,13 +217,23 @@ export class RoomApiService {
|
||||||
preset?: IngressVideoEncodingPreset
|
preset?: IngressVideoEncodingPreset
|
||||||
): Promise<IngressInfo> {
|
): Promise<IngressInfo> {
|
||||||
let url;
|
let url;
|
||||||
if (!withVideo) {
|
switch (urlInputType) {
|
||||||
url =
|
case 'HTTP':
|
||||||
'https://s3.eu-west-1.amazonaws.com/public.openvidu.io/bbb_sunflower_1080p_60fps_normal_onlyaudio.mp3';
|
if (!withVideo) {
|
||||||
} else {
|
url =
|
||||||
url = withAudio
|
'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.mp4'
|
} else {
|
||||||
: 'https://s3.eu-west-1.amazonaws.com/public.openvidu.io/bbb_sunflower_1080p_60fps_normal_noaudio.mp4';
|
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 = {
|
let options: CreateIngressOptions = {
|
||||||
name: inputType + '-' + room_name,
|
name: inputType + '-' + room_name,
|
||||||
|
|
Loading…
Reference in New Issue