openvidu-components: Renamed subtitles components to captions

pull/743/head
csantosm 2022-07-06 13:46:42 +02:00
parent 085d659363
commit b4080fedea
12 changed files with 34 additions and 34 deletions

View File

@ -20,7 +20,7 @@ var PARTICIPANTS_PANEL_BUTTON;
var ACTIVITIES_RECORDING_ACTIVITY;
var RECORDING_ERROR;
var TOOLBAR_SETTINGS_BUTTON;
var SUBTITLES_BUTTON;
var CAPTIONS_BUTTON;
var SESSION_NAME;
@ -38,7 +38,7 @@ $(document).ready(() => {
RECORDING_BUTTON = url.searchParams.get("recordingBtn") === null ? true : url.searchParams.get("recordingBtn") === 'true';
FULLSCREEN_BUTTON = url.searchParams.get("fullscreenBtn") === null ? true : url.searchParams.get("fullscreenBtn") === 'true';
TOOLBAR_SETTINGS_BUTTON = url.searchParams.get("toolbarSettingsBtn") === null ? true : url.searchParams.get("toolbarSettingsBtn") === 'true';
SUBTITLES_BUTTON = url.searchParams.get("toolbarSubtitlesBtn") === null ? true : url.searchParams.get("toolbarSubtitlesBtn") === 'true';
CAPTIONS_BUTTON = url.searchParams.get("toolbarCaptionsBtn") === null ? true : url.searchParams.get("toolbarCaptionsBtn") === 'true';
LEAVE_BUTTON = url.searchParams.get("leaveBtn") === null ? true : url.searchParams.get("leaveBtn") === 'true';
ACTIVITIES_PANEL_BUTTON = url.searchParams.get("activitiesPanelBtn") === null ? true : url.searchParams.get("activitiesPanelBtn") === 'true';
@ -149,7 +149,7 @@ async function joinSession(sessionName, participantName) {
webComponent.toolbarFullscreenButton = FULLSCREEN_BUTTON;
webComponent.toolbarSettingsButton = TOOLBAR_SETTINGS_BUTTON;
webComponent.toolbarSubtitlesButton = SUBTITLES_BUTTON;
webComponent.toolbarCaptionsButton = CAPTIONS_BUTTON;
webComponent.toolbarLeaveButton = LEAVE_BUTTON;
webComponent.toolbarRecordingButton = RECORDING_BUTTON;
webComponent.toolbarActivitiesPanelButton = ACTIVITIES_PANEL_BUTTON;

View File

@ -254,7 +254,7 @@ describe('Testing API Directives', () => {
it('should HIDE the SUBTITLES button', async () => {
let element;
await browser.get(`${url}?prejoin=false&toolbarSubtitlesBtn=false`);
await browser.get(`${url}?prejoin=false&toolbarCaptionsBtn=false`);
element = await browser.wait(until.elementLocated(By.id('session-container')), TIMEOUT);
expect(await element.isDisplayed()).to.be.true;

View File

@ -12,12 +12,12 @@ import { LoremIpsum } from 'lorem-ipsum';
* @internal
*/
@Component({
selector: 'ov-subtitles',
templateUrl: './subtitles.component.html',
styleUrls: ['./subtitles.component.css'],
selector: 'ov-captions',
templateUrl: './captions.component.html',
styleUrls: ['./captions.component.css'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class SubtitlesComponent implements OnInit {
export class CaptionsComponent implements OnInit {
/**
* @ignore
*/

View File

@ -14,5 +14,5 @@
</div>
</div>
<ov-subtitles *ngIf="subtitlesEnabled" class="OV_ignored"></ov-subtitles>
<ov-captions *ngIf="subtitlesEnabled" class="OV_ignored"></ov-captions>
</div>

View File

@ -21,7 +21,7 @@ import {
ToolbarBackgroundEffectsButtonDirective,
ToolbarRecordingButtonDirective,
ToolbarSettingsButtonDirective,
ToolbarSubtitleButtonDirective
ToolbarCaptionsButtonDirective
} from './toolbar.directive';
import {
AudioMutedDirective,
@ -42,7 +42,7 @@ import {
ToolbarScreenshareButtonDirective,
ToolbarFullscreenButtonDirective,
ToolbarBackgroundEffectsButtonDirective,
ToolbarSubtitleButtonDirective,
ToolbarCaptionsButtonDirective,
ToolbarLeaveButtonDirective,
ToolbarRecordingButtonDirective,
ToolbarParticipantsPanelButtonDirective,
@ -72,7 +72,7 @@ import {
ToolbarScreenshareButtonDirective,
ToolbarFullscreenButtonDirective,
ToolbarBackgroundEffectsButtonDirective,
ToolbarSubtitleButtonDirective,
ToolbarCaptionsButtonDirective,
ToolbarLeaveButtonDirective,
ToolbarRecordingButtonDirective,
ToolbarParticipantsPanelButtonDirective,

View File

@ -243,40 +243,40 @@ export class ToolbarBackgroundEffectsButtonDirective implements AfterViewInit, O
}
/**
* The **subtitleButton** directive allows show/hide the subtitle toolbar button.
* The **captionsButton** directive allows show/hide the captions toolbar button.
*
* Default: `true`
*
* It can be used in the parent element {@link VideoconferenceComponent} specifying the name of the `toolbar` component:
*
* @example
* <ov-videoconference [toolbarSubtitleButton]="false"></ov-videoconference>
* <ov-videoconference [toolbarCaptionsButton]="false"></ov-videoconference>
*
* \
* And it also can be used in the {@link ToolbarComponent}.
* @example
* <ov-toolbar [subtitleButton]="false"></ov-toolbar>
* <ov-toolbar [captionsButton]="false"></ov-toolbar>
*/
@Directive({
selector: 'ov-videoconference[toolbarSubtitlesButton], ov-toolbar[subtitlesButton]'
selector: 'ov-videoconference[toolbarCaptionsButton], ov-toolbar[captionsButton]'
})
export class ToolbarSubtitleButtonDirective implements AfterViewInit, OnDestroy {
export class ToolbarCaptionsButtonDirective implements AfterViewInit, OnDestroy {
/**
* @ignore
*/
@Input() set toolbarSubtitlesButton(value: boolean) {
this.subtitlesButtonValue = value;
this.update(this.subtitlesButtonValue);
@Input() set toolbarCaptionsButton(value: boolean) {
this.captionsButtonValue = value;
this.update(this.captionsButtonValue);
}
/**
* @ignore
*/
@Input() set subtitlesButton(value: boolean) {
this.subtitlesButtonValue = value;
this.update(this.subtitlesButtonValue);
@Input() set captionsButton(value: boolean) {
this.captionsButtonValue = value;
this.update(this.captionsButtonValue);
}
private subtitlesButtonValue: boolean = true;
private captionsButtonValue: boolean = true;
/**
* @ignore
@ -284,13 +284,13 @@ export class ToolbarSubtitleButtonDirective implements AfterViewInit, OnDestroy
constructor(public elementRef: ElementRef, private libService: OpenViduAngularConfigService) {}
ngAfterViewInit() {
this.update(this.subtitlesButtonValue);
this.update(this.captionsButtonValue);
}
ngOnDestroy(): void {
this.clear();
}
private clear() {
this.subtitlesButtonValue = true;
this.captionsButtonValue = true;
this.update(true);
}

View File

@ -59,7 +59,7 @@ import { AudioDevicesComponent } from './components/settings/audio-devices/audio
import { NicknameInputComponent } from './components/settings/nickname-input/nickname-input.component';
import { LangSelectorComponent } from './components/settings/lang-selector/lang-selector.component';
import { SubtitlesSettingComponent } from './components/settings/subtitles/subtitles.component';
import { SubtitlesComponent } from './components/subtitles/subtitles.component';
import { CaptionsComponent } from './components/captions/captions.component';
@NgModule({
declarations: [
@ -68,7 +68,7 @@ import { SubtitlesComponent } from './components/subtitles/subtitles.component';
ChatPanelComponent,
SessionComponent,
LayoutComponent,
SubtitlesComponent,
CaptionsComponent,
StreamComponent,
DialogTemplateComponent,
RecordingDialogComponent,

View File

@ -17,7 +17,7 @@
[toolbarParticipantsPanelButton]="_toolbarParticipantsPanelButton"
[toolbarDisplayLogo]="_toolbarDisplayLogo"
[toolbarDisplaySessionName]="_toolbarDisplaySessionName"
[toolbarSubtitlesButton]="_toolbarSubtitlesButton"
[toolbarCaptionsButton]="_toolbarCaptionsButton"
[streamDisplayParticipantName]="_streamDisplayParticipantName"
[streamDisplayAudioDetection]="_streamDisplayAudioDetection"
[streamSettingsButton]="_streamSettingsButton"

View File

@ -82,7 +82,7 @@ export class OpenviduWebComponentComponent implements OnInit {
/**
* @internal
*/
_toolbarSubtitlesButton: boolean = true;
_toolbarCaptionsButton: boolean = true;
/**
* @internal
*/
@ -335,7 +335,7 @@ export class OpenviduWebComponentComponent implements OnInit {
this._toolbarDisplaySessionName = this.castToBoolean(value);
}
/**
* The **toolbarDisplaySessionName** attribute allows show/hide the session name.
* The **toolbarCaptionsButton** attribute allows show/hide the captions toolbar button.
*
* Default: `true`
*
@ -343,10 +343,10 @@ export class OpenviduWebComponentComponent implements OnInit {
* <span>WARNING</span>: If you want to use this parameter to OpenVidu Web Component statically, you have to replace the <strong>camelCase</strong> with a <strong>hyphen between words</strong>.</div>
*
* @example
* <openvidu-webcomponent toolbar-display-session-name="false"></openvidu-webcomponent>
* <openvidu-webcomponent toolbar-captions-button="false"></openvidu-webcomponent>
*/
@Input() set toolbarSubtitlesButton(value: string | boolean) {
this._toolbarSubtitlesButton = this.castToBoolean(value);
@Input() set toolbarCaptionsButton(value: string | boolean) {
this._toolbarCaptionsButton = this.castToBoolean(value);
}
/**
* The **streamDisplayParticipantName** attribute allows show/hide the participants name in stream component.