-
Notifications
You must be signed in to change notification settings - Fork 0
/
pip_layout_control.js
93 lines (87 loc) · 2.55 KB
/
pip_layout_control.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import xapi from 'xapi';
//pips can happen in active speaker in "Floating" (soon fixed), minimized presentation and selfview.
//xCommand Video ActiveSpeakerPIP Set Position:
//xCommand Video PresentationPIP Set Position:
//xCommand Video Selfview Set PIPPosition:
//all share valuespace: <CenterLeft, CenterRight, LowerLeft, LowerRight, UpperCenter, UpperLeft, UpperRight, DockLowerLeft, DockCenterLeft>
//quick-fix, just do all every time...
async function setPosition(position) {
try {
await xapi.Command.Video.ActiveSpeakerPIP.Set({ Position: position});
await xapi.Command.Video.PresentationPIP.Set({ Position: position});
await xapi.Command.Video.Selfview.Set({ PIPPosition: position});
} catch (error) {
console.error(error);
}
}
xapi.Event.UserInterface.Extensions.Widget.Action.on((event) => {
if (event.Type !== 'pressed') {
return;
}
let newPosition = event.Value;
setPosition(newPosition);
});
/* required panel:
<Extensions>
<Version>1.10</Version>
<Panel>
<Order>1</Order>
<PanelId>panel_1</PanelId>
<Origin>local</Origin>
<Location>CallControls</Location>
<Icon>Sliders</Icon>
<Name>Layout Control</Name>
<ActivityType>Custom</ActivityType>
<Page>
<Name>Layout control</Name>
<Row>
<Name/>
<Widget>
<WidgetId>ActiveSpeakerPIP_Position</WidgetId>
<Type>GroupButton</Type>
<Options>size=4;columns=3</Options>
<ValueSpace>
<Value>
<Key>UpperLeft</Key>
<Name>Top Left</Name>
</Value>
<Value>
<Key>UpperCenter</Key>
<Name>Top Center</Name>
</Value>
<Value>
<Key>UpperRight</Key>
<Name>Top Right</Name>
</Value>
<Value>
<Key>CenterLeft</Key>
<Name>Mid Left</Name>
</Value>
<Value>
<Key>UpperCenter</Key>
<Name/>
</Value>
<Value>
<Key>CenterRight</Key>
<Name>Mid Right</Name>
</Value>
<Value>
<Key>LowerLeft</Key>
<Name>Bottom Left</Name>
</Value>
<Value>
<Key>UpperCenter</Key>
<Name/>
</Value>
<Value>
<Key>LowerRight</Key>
<Name>Bottom Right</Name>
</Value>
</ValueSpace>
</Widget>
</Row>
<Options>hideRowNames=1</Options>
</Page>
</Panel>
</Extensions>
*/