Skip to content

Commit

Permalink
video windows undocked
Browse files Browse the repository at this point in the history
  • Loading branch information
Heiner Wolf committed Jun 6, 2023
1 parent 8c1a571 commit 7261520
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ChromeExt/src/contentscript/ItemFrameWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type ItemFrameWindowOptions = WindowOptions & {
url: string,
resizable?: boolean,
undockable?: boolean,
undocked?: boolean,
transparent?: boolean, // Not implemented on ItemFrameWindow.
titleText: string,
}
Expand Down Expand Up @@ -44,6 +45,7 @@ export class ItemFrameWindow extends Window<ItemFrameWindowOptions>
this.minWidth = 180;
this.minHeight = 100;
this.isUndockable = as.Bool(this.givenOptions.undockable);
this.isUndocked= as.Bool(this.givenOptions.undocked);

const url: string = as.String(this.givenOptions.url);
if (!url.length) {
Expand Down
1 change: 1 addition & 0 deletions ChromeExt/src/contentscript/Participant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,7 @@ export class Participant extends Entity
this.privateVidconfWindow.show({
above: aboveElem,
url: url,
undocked: true,
onClose: () =>
{
this.privateVidconfWindow = null;
Expand Down
1 change: 1 addition & 0 deletions ChromeExt/src/contentscript/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ export class Room
this.vidconfWindow.show({
'above': aboveElem,
'url': url,
'undocked': true,
onClose: () =>
{
this.vidconfWindow = null;
Expand Down
1 change: 1 addition & 0 deletions ChromeExt/src/contentscript/RoomItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ export class RoomItem extends Entity
bottom: as.Int(windowOptions.bottom, 50),
resizable: as.Bool(windowOptions.rezizable, true),
undockable: as.Bool(windowOptions.undockable),
undocked: as.Bool(windowOptions.undocked),
transparent: as.Bool(windowOptions.transparent),
hidden: as.Bool(windowOptions.hidden),
titleText: as.String(this.properties[Pid.Description], as.String(this.properties[Pid.Label], 'Item')),
Expand Down
2 changes: 1 addition & 1 deletion ChromeExt/src/contentscript/VidconfWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class VidconfWindow extends Window<VidconfWindowOptions>
contentElem.append(iframeElem);
}

protected undock(): void
undock(): void
{
const left = Config.get('room.vidconfUndockedLeft', 100);
const top = Config.get('room.vidconfUndockedTop', 100);
Expand Down
6 changes: 6 additions & 0 deletions ChromeExt/src/contentscript/Window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type WindowOptions = {
bottom?: string|number,
left?: string|number,
center?: string|number, // Used when left unset.
undocked?: boolean,
};

type WindowGeometryInitStrategy = 'beforeContent'|'afterContent'|'none';
Expand All @@ -42,6 +43,7 @@ export abstract class Window<OptionsType extends WindowOptions>
protected geometryInitstrategy: WindowGeometryInitStrategy = 'beforeContent';
protected persistGeometry: boolean = false;
protected isUndockable: boolean = false;
protected isUndocked: boolean = false;

protected containerMarginTop: number = 0;
protected containerMarginRight: number = 0;
Expand Down Expand Up @@ -108,6 +110,9 @@ export abstract class Window<OptionsType extends WindowOptions>
if (!this.isClosing && !(this.givenOptions.hidden ?? this.showHidden)) {
this.setVisibility(true);
}
if (this.isUndocked) {
this.undock();
}
})().catch(error => {
this.app.onError(error);
this.isClosing = true;
Expand All @@ -128,6 +133,7 @@ export abstract class Window<OptionsType extends WindowOptions>
protected prepareMakeDom(): void
{
this.closeIsHide = as.Bool(this.givenOptions.closeIsHide, this.closeIsHide);
this.isUndocked = as.Bool(this.givenOptions.undocked, this.isUndocked);
this.containerMarginTop = as.Int(Config.get('system.windowContainerMarginTop'), 0);
this.containerMarginRight = as.Int(Config.get('system.windowContainerMarginRight'), 0);
this.containerMarginBottom = as.Int(Config.get('system.windowContainerMarginBottom'), 0);
Expand Down
3 changes: 2 additions & 1 deletion ChromeExt/src/lib/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ export class Config
defaultAnimationSize: 100,
vCardAvatarFallback: false,
vCardAvatarFallbackOnHover: true,
vidconfUrl: 'https://video.weblin.io/Vidconf?room=weblin{room}&name={name}',
// vidconfUrl: 'https://video.weblin.io/Vidconf?room=weblin{room}&name={name}',
vidconfUrl: 'https://meet.jit.si/weblin{room}#userInfo.displayName=%22{name}%22&config.prejoinPageEnabled=false&config.disableInviteFunctions=true&config.doNotStoreRoom=true&config.resolution=true&config.enableInsecureRoomNameWarning=false&interfaceConfig.SHOW_CHROME_EXTENSION_BANNER=false',
vidconfBottom: 200,
vidconfWidth: 630,
vidconfHeight: 530,
Expand Down
4 changes: 2 additions & 2 deletions ChromeExt/src/lib/_Changes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ interface IHistory extends Array<IRelease> { }
export class _Changes
{
static data: IHistory = [
['1.2.7', '?', [
['x', 'y'],
['1.2.7', 'VidconfUndocked', [
['Change', 'Video windows initially undocked because Jitsi does not support embedding in iframes anymore'],
]],
['1.2.6', 'Tutorial', [
['Add', 'Tutorial videos'],
Expand Down

0 comments on commit 7261520

Please sign in to comment.