mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-09-03 15:41:56 +00:00
Merge pull request #329 from TheTimeWalker/jitsi-audio-only
feat: Set audio-only conference and toggle video before joining
This commit is contained in:
commit
42a44a1a37
@ -7,5 +7,12 @@
|
|||||||
[(ngModel)]="widget.dimension.newData.conferenceUrl" name="widget-url-{{widget.id}}"
|
[(ngModel)]="widget.dimension.newData.conferenceUrl" name="widget-url-{{widget.id}}"
|
||||||
[disabled]="isUpdating"/>
|
[disabled]="isUpdating"/>
|
||||||
</label>
|
</label>
|
||||||
|
<label class="label-block">
|
||||||
|
Audio only
|
||||||
|
<span class="text-muted">Starts the conference without camera by default. Users can still manually turn on the camera when joining or joined.</span>
|
||||||
|
<ui-switch size="medium"
|
||||||
|
[(ngModel)]="widget.dimension.newData.isAudioOnly" name="widget-audio-{{widget.id}}"
|
||||||
|
[disabled]="isUpdating"></ui-switch>
|
||||||
|
</label>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</my-widget-config>
|
</my-widget-config>
|
@ -80,7 +80,6 @@ export class JitsiWidgetConfigComponent extends WidgetComponent {
|
|||||||
const jitsiUrl = url.parse(widget.dimension.newData.conferenceUrl);
|
const jitsiUrl = url.parse(widget.dimension.newData.conferenceUrl);
|
||||||
widget.dimension.newData.domain = jitsiUrl.host;
|
widget.dimension.newData.domain = jitsiUrl.host;
|
||||||
widget.dimension.newData.conferenceId = jitsiUrl.path.substring(1);
|
widget.dimension.newData.conferenceId = jitsiUrl.path.substring(1);
|
||||||
widget.dimension.newData.isAudioOnly = false;
|
|
||||||
|
|
||||||
let widgetQueryString = url.format({
|
let widgetQueryString = url.format({
|
||||||
query: {
|
query: {
|
||||||
|
@ -7,7 +7,11 @@
|
|||||||
<h3>Jitsi Video Conference</h3>
|
<h3>Jitsi Video Conference</h3>
|
||||||
<button type="button" (click)="joinConference()" class="btn btn-primary btn-large">
|
<button type="button" (click)="joinConference()" class="btn btn-primary btn-large">
|
||||||
Join Conference
|
Join Conference
|
||||||
</button>
|
</button><br>
|
||||||
|
<label>
|
||||||
|
Start camera:
|
||||||
|
<input type="checkbox" name="toggleVideo" [(ngModel)]="toggleVideo" />
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -17,12 +17,14 @@ declare var JitsiMeetExternalAPI: any;
|
|||||||
export class JitsiWidgetWrapperComponent extends CapableWidget implements OnInit, OnDestroy {
|
export class JitsiWidgetWrapperComponent extends CapableWidget implements OnInit, OnDestroy {
|
||||||
|
|
||||||
public isJoined = false;
|
public isJoined = false;
|
||||||
|
public toggleVideo = false;
|
||||||
|
|
||||||
private domain: string;
|
private domain: string;
|
||||||
private conferenceId: string;
|
private conferenceId: string;
|
||||||
private displayName: string;
|
private displayName: string;
|
||||||
private avatarUrl: string;
|
private avatarUrl: string;
|
||||||
private userId: string;
|
private userId: string;
|
||||||
|
private isAudioOnly: boolean;
|
||||||
private jitsiApiObj: any;
|
private jitsiApiObj: any;
|
||||||
private jitsiApiSubscription: Subscription;
|
private jitsiApiSubscription: Subscription;
|
||||||
|
|
||||||
@ -37,6 +39,8 @@ export class JitsiWidgetWrapperComponent extends CapableWidget implements OnInit
|
|||||||
this.displayName = params.displayName;
|
this.displayName = params.displayName;
|
||||||
this.avatarUrl = params.avatarUrl;
|
this.avatarUrl = params.avatarUrl;
|
||||||
this.userId = params.userId || params.email; // Element uses `email` when placing a conference call
|
this.userId = params.userId || params.email; // Element uses `email` when placing a conference call
|
||||||
|
this.isAudioOnly = params.isAudioOnly === 'true';
|
||||||
|
this.toggleVideo = !this.isAudioOnly;
|
||||||
|
|
||||||
// Set the widget ID if we have it
|
// Set the widget ID if we have it
|
||||||
ScalarWidgetApi.widgetId = params.widgetId;
|
ScalarWidgetApi.widgetId = params.widgetId;
|
||||||
@ -108,6 +112,7 @@ export class JitsiWidgetWrapperComponent extends CapableWidget implements OnInit
|
|||||||
if (this.displayName) this.jitsiApiObj.executeCommand("displayName", this.displayName);
|
if (this.displayName) this.jitsiApiObj.executeCommand("displayName", this.displayName);
|
||||||
if (this.avatarUrl) this.jitsiApiObj.executeCommand("avatarUrl", this.avatarUrl.toString());
|
if (this.avatarUrl) this.jitsiApiObj.executeCommand("avatarUrl", this.avatarUrl.toString());
|
||||||
if (this.userId) this.jitsiApiObj.executeCommand("email", this.userId);
|
if (this.userId) this.jitsiApiObj.executeCommand("email", this.userId);
|
||||||
|
if (this.isAudioOnly === this.toggleVideo) this.jitsiApiObj.executeCommand("toggleVideo");
|
||||||
|
|
||||||
this.jitsiApiObj.on("readyToClose", () => {
|
this.jitsiApiObj.on("readyToClose", () => {
|
||||||
this.isJoined = false;
|
this.isJoined = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user