ui: the stream viewer's controls hide while you watch
The controls fade 2.5 s after the pointer last moved over the picture and come back when it moves; in full screen the cursor hides with them, and on a touch screen a tap on the picture shows or hides them. A status or the stream's end keeps them, and so does a pointer that was never over the picture, so screenshots still show them. In the shell the streamer, title, viewers, LIVE and the quality move from the picture into the header, so nothing covers the picture at rest; in full screen (and on the phone) they stay over it under a taller, darker shade and hide with the controls. The streamer's avatar now comes from the engine's cache for any streamer, also one outside our channel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AVRENKftQqGoEeswiR9TDQ
This commit is contained in:
1 parent
e1b4a207c5
commit
0aee710c19
7 files changed
+321
-182
No files matched your search
@@ -138,6 +138,10 @@ User-visible changes of the apps and the `tsgw` gateway. The format follows
|
||||
colour, with what they share, instead of a bare screen icon (TeamSpeak
|
||||
streams have no preview pictures). Your own stream from the Stream Studio
|
||||
shows its picture.
|
||||
- The stream viewer's controls hide while you watch, 2.5 s after the
|
||||
pointer last moved over the picture (in full screen the cursor too; on a
|
||||
touch screen a tap shows or hides them), and the streamer, the title and
|
||||
LIVE are in the header above the picture instead of over it.
|
||||
- Banners: up to 128 MiB, more time on slow hosts, BMP and ICO too, and
|
||||
SVG after a comment or DOCTYPE; pictures larger than 4096 pixels on a
|
||||
side are scaled down. A banner that fails is tried again for as long as
|
||||
|
||||
@@ -42,6 +42,12 @@ pub(super) fn wire(ui: &MainWindow) {
|
||||
bridge.on_toggle_fullscreen(|| {
|
||||
with_app(|app| app.toggle_fullscreen());
|
||||
});
|
||||
let window = ui.as_weak();
|
||||
bridge.on_show_cursor(move |shown| {
|
||||
if let Some(ui) = window.upgrade() {
|
||||
crate::streams::show_cursor(ui.window(), shown);
|
||||
}
|
||||
});
|
||||
bridge.on_set_stream_quality(|index| {
|
||||
with_app(|app| app.set_stream_quality(index));
|
||||
});
|
||||
|
||||
@@ -167,6 +167,19 @@ fn bitrate_text(kbps: u32) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
/// Show or hide the pointer over `window`. In full screen the player hides
|
||||
/// it with its controls: Slint applies a TouchArea's cursor only when the
|
||||
/// pointer moves, so the window is told directly. (No pointer on Android.)
|
||||
pub(crate) fn show_cursor(window: &slint::Window, shown: bool) {
|
||||
#[cfg(not(target_os = "android"))]
|
||||
{
|
||||
use slint::winit_030::WinitWindowAccessor;
|
||||
window.with_winit_window(|w| w.set_cursor_visible(shown));
|
||||
}
|
||||
#[cfg(target_os = "android")]
|
||||
let _ = (window, shown);
|
||||
}
|
||||
|
||||
impl App {
|
||||
pub(crate) fn stream_event(&mut self, event: Event) {
|
||||
match event {
|
||||
@@ -406,9 +419,12 @@ impl App {
|
||||
bridge.set_viewer_frame(slint::Image::default());
|
||||
return;
|
||||
};
|
||||
bridge.set_viewer_open(
|
||||
watch.shown && (watch.session.is_none() || watch.session == self.current),
|
||||
);
|
||||
let open = watch.shown && (watch.session.is_none() || watch.session == self.current);
|
||||
if !open && bridge.get_viewer_open() && bridge.get_viewer_fullscreen() {
|
||||
// The player goes, still in full screen: it may have hidden the cursor.
|
||||
show_cursor(ui.window(), true);
|
||||
}
|
||||
bridge.set_viewer_open(open);
|
||||
bridge.set_viewer_title(watch.title.clone().into());
|
||||
bridge.set_viewer_status(watch.status.clone().into());
|
||||
bridge.set_viewer_ended(watch.ended);
|
||||
@@ -426,7 +442,13 @@ impl App {
|
||||
.view()
|
||||
.and_then(|v| v.streams.iter().find(|s| s.id == watch.stream_id))
|
||||
.map_or(-1, |s| i32::from(s.streamer.0));
|
||||
bridge.set_viewer_streamer_id(streamer);
|
||||
let face = crate::vm::streams::streamer(
|
||||
&watch.streamer,
|
||||
self.view().zip(u16::try_from(streamer).ok()).and_then(|(v, id)| v.avatar(id)),
|
||||
);
|
||||
bridge.set_viewer_streamer_avatar(face.avatar);
|
||||
bridge.set_viewer_streamer_initials(face.initials);
|
||||
bridge.set_viewer_streamer_tint(face.tint);
|
||||
let members = &self.models.members;
|
||||
bridge.set_viewer_streamer_admin(
|
||||
(0..members.row_count())
|
||||
@@ -944,6 +966,10 @@ impl App {
|
||||
}
|
||||
bridge.set_viewer_fullscreen(full);
|
||||
ui.window().set_fullscreen(full);
|
||||
if !full {
|
||||
// The player that hid the cursor may be gone already.
|
||||
show_cursor(ui.window(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1004,11 +1004,14 @@ export global Bridge {
|
||||
in property <image> viewer-frame;
|
||||
in property <bool> viewer-has-frame;
|
||||
in property <string> viewer-title;
|
||||
// Who streams it (their client id: -1 unknown).
|
||||
// Who streams it, and their avatar as the members show it: their
|
||||
// picture, else their initials on their colour.
|
||||
in property <string> viewer-streamer;
|
||||
in property <image> viewer-streamer-avatar;
|
||||
in property <string> viewer-streamer-initials;
|
||||
in property <color> viewer-streamer-tint;
|
||||
// The voice channel the watched stream is in.
|
||||
in property <string> viewer-channel;
|
||||
in property <int> viewer-streamer-id: -1;
|
||||
// Shown instead of (or over) the picture: waiting, ended, errors.
|
||||
in property <string> viewer-status;
|
||||
in property <string> viewer-info;
|
||||
@@ -1135,6 +1138,9 @@ export global Bridge {
|
||||
callback leave-stream();
|
||||
callback set-stream-volume(float);
|
||||
callback toggle-fullscreen();
|
||||
// Show or hide the pointer over the window: the player hides it with
|
||||
// its controls in full screen.
|
||||
callback show-cursor(bool);
|
||||
// A simulcast layer of the watched stream (0: Auto).
|
||||
callback set-stream-quality(int);
|
||||
|
||||
|
||||
@@ -11,6 +11,12 @@ import { Icon, IconButton, Avatar, Chip, TabItem, TextField, MessageText, Banner
|
||||
// A compact title and actions over the optional channel background.
|
||||
export component PageHeader inherits Rectangle {
|
||||
in property <image> icon: Icons.channel;
|
||||
// A person in place of the icon (the streamer, in the stream viewer):
|
||||
// their picture, else their initials on their colour.
|
||||
in property <string> person;
|
||||
in property <image> avatar;
|
||||
in property <string> initials;
|
||||
in property <color> tint;
|
||||
in property <image> banner;
|
||||
in property <string> title;
|
||||
in property <string> description;
|
||||
@@ -22,12 +28,20 @@ export component PageHeader inherits Rectangle {
|
||||
padding-left: Theme.space-6;
|
||||
padding-right: Theme.space-4;
|
||||
spacing: Theme.space-4;
|
||||
Icon {
|
||||
if root.person == "": Icon {
|
||||
source: root.icon;
|
||||
size: 26px;
|
||||
tint: Theme.text-secondary;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
if root.person != "": Avatar {
|
||||
size: 36px;
|
||||
image: root.avatar;
|
||||
initials: root.initials;
|
||||
tint: root.tint;
|
||||
label: root.person;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
Text {
|
||||
text: root.title;
|
||||
font-size: Theme.font-xl;
|
||||
|
||||
@@ -207,11 +207,53 @@ export component StreamsPanel inherits VerticalLayout {
|
||||
}
|
||||
}
|
||||
|
||||
// The player: the picture with the streamer, the title and LIVE over its
|
||||
// top, and the controls over its bottom. `compact` (full screen, the
|
||||
// phone) adds Leave, which the header has otherwise.
|
||||
// The simulcast layers the streamer offers ("Auto" follows the bandwidth
|
||||
// estimate), else the height of the picture that arrives.
|
||||
component StreamQuality inherits HorizontalLayout {
|
||||
// Over the picture: white on a dark fill.
|
||||
in property <bool> on-picture;
|
||||
if Bridge.viewer-qualities.length > 1: Select {
|
||||
width: 150px;
|
||||
horizontal-stretch: 0;
|
||||
icon: Icons.sliders-horizontal;
|
||||
label: @tr("Quality");
|
||||
model: Bridge.viewer-qualities;
|
||||
current-index <=> Bridge.viewer-quality;
|
||||
y: (parent.height - self.height) / 2;
|
||||
selected(_) => { Bridge.set-stream-quality(Bridge.viewer-quality); }
|
||||
}
|
||||
if Bridge.viewer-qualities.length <= 1 && Bridge.viewer-has-frame: Chip {
|
||||
text: @tr("{}p", Bridge.viewer-frame.height);
|
||||
tint: root.on-picture ? #ffffff : Theme.text-secondary;
|
||||
fill: root.on-picture ? #060a18b0 : Theme.surface-3;
|
||||
outlined: true;
|
||||
height: 26px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
}
|
||||
|
||||
// The player: the picture with the controls over its bottom. `compact`
|
||||
// (full screen, the phone) also has the streamer, the title and LIVE over
|
||||
// its top, and Leave; otherwise the header shows them.
|
||||
//
|
||||
// The controls hide 2.5 s after the pointer last moved over the picture,
|
||||
// once it has been there (in full screen it is), and come back when it
|
||||
// moves; with the pointer elsewhere, as in a screenshot, they stay. A
|
||||
// status and the end of the stream keep them. A touch screen has no
|
||||
// pointer to move: a tap on the picture shows or hides them.
|
||||
component StreamPlayer inherits Rectangle {
|
||||
in property <bool> compact;
|
||||
property <bool> touch: !Bridge.desktop;
|
||||
property <bool> pinned: Bridge.viewer-status != "" || Bridge.viewer-ended;
|
||||
// The pointer has been over the picture (in full screen it is).
|
||||
property <bool> woken: Bridge.viewer-fullscreen;
|
||||
property <bool> shown: true;
|
||||
property <bool> up: root.shown || root.pinned;
|
||||
// In full screen the cursor hides with the controls. The window is
|
||||
// told: Slint sets a TouchArea's cursor only when the pointer moves,
|
||||
// and a move brings the controls back.
|
||||
property <bool> no-cursor: Bridge.viewer-fullscreen && !root.up;
|
||||
changed no-cursor => { Bridge.show-cursor(!root.no-cursor); }
|
||||
border-radius: compact ? 0px : Theme.radius-lg;
|
||||
clip: true;
|
||||
background: #000000;
|
||||
@@ -219,6 +261,24 @@ component StreamPlayer inherits Rectangle {
|
||||
border-color: Theme.border-strong;
|
||||
accessible-role: AccessibleRole.groupbox;
|
||||
accessible-label: Bridge.viewer-title;
|
||||
|
||||
function wake() {
|
||||
root.woken = true;
|
||||
root.shown = true;
|
||||
if !root.pinned {
|
||||
idle.restart();
|
||||
}
|
||||
}
|
||||
// A touch moves the pointer too: on a control it keeps the controls a
|
||||
// while longer, but only a tap on the picture shows or hides them.
|
||||
function moved() {
|
||||
if !root.touch {
|
||||
root.wake();
|
||||
} else if root.shown && !root.pinned {
|
||||
idle.restart();
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
width: parent.width;
|
||||
height: parent.height;
|
||||
@@ -244,183 +304,191 @@ component StreamPlayer inherits Rectangle {
|
||||
accessible-live-region: polite;
|
||||
}
|
||||
}
|
||||
// Shades for the text over the picture.
|
||||
Rectangle {
|
||||
y: 0;
|
||||
height: 110px;
|
||||
background: @linear-gradient(180deg, #000000c0 0%, #00000000 100%);
|
||||
}
|
||||
Rectangle {
|
||||
y: parent.height - self.height;
|
||||
height: 90px;
|
||||
background: @linear-gradient(180deg, #00000000 0%, #000000c8 100%);
|
||||
}
|
||||
// Who streams what, LIVE and the quality.
|
||||
HorizontalLayout {
|
||||
y: 0;
|
||||
height: 84px;
|
||||
padding: Theme.space-4;
|
||||
spacing: Theme.space-3;
|
||||
if Bridge.viewer-streamer-id >= 0: VerticalLayout {
|
||||
alignment: start;
|
||||
Rectangle {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
for member in Bridge.members: Avatar {
|
||||
visible: member.id == Bridge.viewer-streamer-id;
|
||||
// Sees the pointer also over the controls: they are its children.
|
||||
activity := TouchArea {
|
||||
opacity: root.up ? 1 : 0;
|
||||
animate opacity { duration: Theme.fast; }
|
||||
changed mouse-x => { root.moved(); }
|
||||
changed mouse-y => { root.moved(); }
|
||||
clicked => {
|
||||
if root.touch && root.shown {
|
||||
root.shown = false;
|
||||
} else {
|
||||
root.wake();
|
||||
}
|
||||
}
|
||||
// Shades for what is drawn over the picture.
|
||||
if root.compact: Rectangle {
|
||||
y: 0;
|
||||
height: 140px;
|
||||
background: @linear-gradient(180deg, #000000d8 0%, #00000000 100%);
|
||||
}
|
||||
Rectangle {
|
||||
y: parent.height - self.height;
|
||||
height: 90px;
|
||||
background: @linear-gradient(180deg, #00000000 0%, #000000c8 100%);
|
||||
}
|
||||
// Who streams what, LIVE and the quality.
|
||||
if root.compact: HorizontalLayout {
|
||||
y: 0;
|
||||
height: 84px;
|
||||
padding: Theme.space-4;
|
||||
spacing: Theme.space-3;
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
Avatar {
|
||||
size: 44px;
|
||||
initials: member.initials;
|
||||
tint: member.tint;
|
||||
image: member.avatar;
|
||||
label: member.name;
|
||||
image: Bridge.viewer-streamer-avatar;
|
||||
initials: Bridge.viewer-streamer-initials;
|
||||
tint: Bridge.viewer-streamer-tint;
|
||||
label: Bridge.viewer-streamer;
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
horizontal-stretch: 1;
|
||||
spacing: 1px;
|
||||
Text {
|
||||
text: Bridge.viewer-streamer;
|
||||
color: Theme.name-text;
|
||||
font-size: Theme.font-md;
|
||||
font-weight: Theme.weight-semibold;
|
||||
overflow: elide;
|
||||
}
|
||||
Text {
|
||||
text: Bridge.viewer-title;
|
||||
color: #ffffff;
|
||||
font-size: Theme.font-md;
|
||||
overflow: elide;
|
||||
}
|
||||
Text {
|
||||
text: Bridge.viewer-count > 0 ? @tr("{} watching", Bridge.viewer-count) : "";
|
||||
color: #ffffffb8;
|
||||
font-size: Theme.font-sm;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
if !Bridge.viewer-ended: VerticalLayout {
|
||||
alignment: start;
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
LiveBadge {
|
||||
large: true;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
if Bridge.viewer-qualities.length > 1 || Bridge.viewer-has-frame: StreamQuality {
|
||||
on-picture: true;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
horizontal-stretch: 1;
|
||||
spacing: 1px;
|
||||
Text {
|
||||
text: Bridge.viewer-streamer;
|
||||
color: Theme.name-text;
|
||||
font-size: Theme.font-md;
|
||||
font-weight: Theme.weight-semibold;
|
||||
overflow: elide;
|
||||
// Controls. Their tooltips go with them: a bubble is a popup, which
|
||||
// the fade does not reach, and it would stay over the picture.
|
||||
HorizontalLayout {
|
||||
y: parent.height - self.height;
|
||||
height: 56px;
|
||||
padding-left: Theme.space-3;
|
||||
padding-right: Theme.space-3;
|
||||
spacing: Theme.space-2;
|
||||
IconButton {
|
||||
icon: Bridge.viewer-volume > 0 ? Icons.volume-2 : Icons.volume-x;
|
||||
label: Bridge.viewer-volume > 0 ? @tr("Mute") : @tr("Unmute");
|
||||
tooltip: root.up ? self.label : "";
|
||||
tint: #ffffff;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.set-stream-volume(Bridge.viewer-volume > 0 ? 0 : 100); }
|
||||
}
|
||||
Text {
|
||||
text: Bridge.viewer-title;
|
||||
color: #ffffff;
|
||||
font-size: Theme.font-md;
|
||||
overflow: elide;
|
||||
Slider {
|
||||
width: 110px;
|
||||
horizontal-stretch: 0;
|
||||
y: (parent.height - self.height) / 2;
|
||||
minimum: 0;
|
||||
maximum: 200;
|
||||
step: 5;
|
||||
value <=> Bridge.viewer-volume;
|
||||
enabled: !Bridge.viewer-ended;
|
||||
label: @tr("Stream volume");
|
||||
changed(v) => { Bridge.set-stream-volume(v); }
|
||||
}
|
||||
Text {
|
||||
text: Bridge.viewer-count > 0 ? @tr("{} watching", Bridge.viewer-count) : "";
|
||||
color: #ffffffb8;
|
||||
font-size: Theme.font-sm;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
if !Bridge.viewer-ended: VerticalLayout {
|
||||
alignment: start;
|
||||
HorizontalLayout {
|
||||
if !Bridge.viewer-ended: HorizontalLayout {
|
||||
padding-left: Theme.space-3;
|
||||
spacing: Theme.space-2;
|
||||
LiveBadge {
|
||||
large: true;
|
||||
horizontal-stretch: 0;
|
||||
Rectangle {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
border-radius: 4px;
|
||||
background: Theme.live;
|
||||
}
|
||||
// Simulcast layers the streamer offers; "Auto" follows the
|
||||
// bandwidth estimate.
|
||||
if Bridge.viewer-qualities.length > 1: Select {
|
||||
width: 150px;
|
||||
horizontal-stretch: 0;
|
||||
icon: Icons.sliders-horizontal;
|
||||
label: @tr("Quality");
|
||||
model: Bridge.viewer-qualities;
|
||||
current-index <=> Bridge.viewer-quality;
|
||||
selected(_) => { Bridge.set-stream-quality(Bridge.viewer-quality); }
|
||||
Text {
|
||||
text: @tr("LIVE");
|
||||
color: #ffffff;
|
||||
font-size: Theme.font-sm;
|
||||
font-weight: Theme.weight-semibold;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
// What arrives: the decoded picture's height.
|
||||
if Bridge.viewer-qualities.length <= 1 && Bridge.viewer-has-frame: Chip {
|
||||
text: @tr("{}p", Bridge.viewer-frame.height);
|
||||
tint: #ffffff;
|
||||
fill: #060a18b0;
|
||||
outlined: true;
|
||||
height: 26px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
Text {
|
||||
text: Bridge.viewer-elapsed;
|
||||
color: #ffffffa0;
|
||||
font-size: Theme.font-sm;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
// What arrives: codec, size, frame rate, bitrate.
|
||||
Text {
|
||||
horizontal-stretch: 1;
|
||||
text: Bridge.viewer-quality-detail;
|
||||
color: #ffffff80;
|
||||
font-size: Theme.font-xs;
|
||||
horizontal-alignment: right;
|
||||
vertical-alignment: center;
|
||||
overflow: elide;
|
||||
}
|
||||
if !Bridge.viewer-fullscreen && !Nav.narrow: IconButton {
|
||||
icon: Icons.minimize-2;
|
||||
label: @tr("Back to the chat (keeps watching)");
|
||||
tooltip: root.up ? self.label : "";
|
||||
tint: #ffffff;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.hide-viewer(); }
|
||||
}
|
||||
if !Nav.narrow: IconButton {
|
||||
icon: Icons.external-link;
|
||||
label: Bridge.viewer-popped ? @tr("Back to the window") : @tr("Pop out");
|
||||
tooltip: root.up ? self.label : "";
|
||||
checked: Bridge.viewer-popped;
|
||||
tint: #ffffff;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.viewer-popped = !Bridge.viewer-popped; }
|
||||
}
|
||||
IconButton {
|
||||
icon: Bridge.viewer-fullscreen ? Icons.minimize-2 : Icons.maximize;
|
||||
label: Bridge.viewer-fullscreen ? @tr("Exit full screen") : @tr("Full screen");
|
||||
tooltip: root.up ? self.label : "";
|
||||
tint: #ffffff;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.toggle-fullscreen(); }
|
||||
}
|
||||
if root.compact: IconButton {
|
||||
icon: Icons.log-out;
|
||||
label: Bridge.viewer-ended ? @tr("Close") : @tr("Leave");
|
||||
tooltip: root.up ? self.label : "";
|
||||
tint: Theme.danger;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.leave-stream(); }
|
||||
}
|
||||
}
|
||||
// While they are hidden a click only brings the controls back.
|
||||
if !root.up: TouchArea {
|
||||
clicked => { root.wake(); }
|
||||
}
|
||||
}
|
||||
// Controls.
|
||||
HorizontalLayout {
|
||||
y: parent.height - self.height;
|
||||
height: 56px;
|
||||
padding-left: Theme.space-3;
|
||||
padding-right: Theme.space-3;
|
||||
spacing: Theme.space-2;
|
||||
IconButton {
|
||||
icon: Bridge.viewer-volume > 0 ? Icons.volume-2 : Icons.volume-x;
|
||||
label: Bridge.viewer-volume > 0 ? @tr("Mute") : @tr("Unmute");
|
||||
tint: #ffffff;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.set-stream-volume(Bridge.viewer-volume > 0 ? 0 : 100); }
|
||||
}
|
||||
Slider {
|
||||
width: 110px;
|
||||
horizontal-stretch: 0;
|
||||
y: (parent.height - self.height) / 2;
|
||||
minimum: 0;
|
||||
maximum: 200;
|
||||
step: 5;
|
||||
value <=> Bridge.viewer-volume;
|
||||
enabled: !Bridge.viewer-ended;
|
||||
label: @tr("Stream volume");
|
||||
changed(v) => { Bridge.set-stream-volume(v); }
|
||||
}
|
||||
if !Bridge.viewer-ended: HorizontalLayout {
|
||||
padding-left: Theme.space-3;
|
||||
spacing: Theme.space-2;
|
||||
horizontal-stretch: 0;
|
||||
Rectangle {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
border-radius: 4px;
|
||||
background: Theme.live;
|
||||
}
|
||||
Text {
|
||||
text: @tr("LIVE");
|
||||
color: #ffffff;
|
||||
font-size: Theme.font-sm;
|
||||
font-weight: Theme.weight-semibold;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
Text {
|
||||
text: Bridge.viewer-elapsed;
|
||||
color: #ffffffa0;
|
||||
font-size: Theme.font-sm;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
// What arrives: codec, size, frame rate, bitrate.
|
||||
Text {
|
||||
horizontal-stretch: 1;
|
||||
text: Bridge.viewer-quality-detail;
|
||||
color: #ffffff80;
|
||||
font-size: Theme.font-xs;
|
||||
horizontal-alignment: right;
|
||||
vertical-alignment: center;
|
||||
overflow: elide;
|
||||
}
|
||||
if !Bridge.viewer-fullscreen && !Nav.narrow: IconButton {
|
||||
icon: Icons.minimize-2;
|
||||
label: @tr("Back to the chat (keeps watching)");
|
||||
tint: #ffffff;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.hide-viewer(); }
|
||||
}
|
||||
if !Nav.narrow: IconButton {
|
||||
icon: Icons.external-link;
|
||||
label: Bridge.viewer-popped ? @tr("Back to the window") : @tr("Pop out");
|
||||
checked: Bridge.viewer-popped;
|
||||
tint: #ffffff;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.viewer-popped = !Bridge.viewer-popped; }
|
||||
}
|
||||
IconButton {
|
||||
icon: Bridge.viewer-fullscreen ? Icons.minimize-2 : Icons.maximize;
|
||||
label: Bridge.viewer-fullscreen ? @tr("Exit full screen") : @tr("Full screen");
|
||||
tint: #ffffff;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.toggle-fullscreen(); }
|
||||
}
|
||||
if root.compact: IconButton {
|
||||
icon: Icons.log-out;
|
||||
label: Bridge.viewer-ended ? @tr("Close") : @tr("Leave");
|
||||
tint: Theme.danger;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.leave-stream(); }
|
||||
}
|
||||
idle := Timer {
|
||||
interval: 2500ms;
|
||||
running: root.woken && root.shown && !root.pinned;
|
||||
triggered => { root.shown = false; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,9 +519,10 @@ component StreamInfo inherits VerticalLayout {
|
||||
}
|
||||
}
|
||||
|
||||
// The stream we watch. With the shell: the channel's header, the player,
|
||||
// a note on the channel the stream belongs to, and its chat below. In
|
||||
// full screen and on a phone: the player alone.
|
||||
// The stream we watch. With the shell: a header with the streamer, the
|
||||
// title and LIVE over our channel's background, the player, a note on the
|
||||
// channel the stream belongs to, and our channel's chat below. In full
|
||||
// screen and on a phone: the player alone.
|
||||
export component StreamViewer inherits Rectangle {
|
||||
// Reading our own width here would loop through the layout, so the
|
||||
// phone breakpoint (a setting) decides.
|
||||
@@ -467,14 +536,28 @@ export component StreamViewer inherits Rectangle {
|
||||
compact: true;
|
||||
}
|
||||
if !root.alone: VerticalLayout {
|
||||
// The stream's facts are here, not over the picture, so nothing
|
||||
// covers it while the controls are hidden.
|
||||
PageHeader {
|
||||
banner: Bridge.own-channel-banner;
|
||||
icon: Icons.channel;
|
||||
title: Bridge.own-channel != "" ? Bridge.own-channel : Bridge.viewer-title;
|
||||
description: Bridge.own-channel-topic;
|
||||
if Bridge.members.length > 0: Button {
|
||||
person: Bridge.viewer-streamer;
|
||||
avatar: Bridge.viewer-streamer-avatar;
|
||||
initials: Bridge.viewer-streamer-initials;
|
||||
tint: Bridge.viewer-streamer-tint;
|
||||
title: Bridge.viewer-title != "" ? Bridge.viewer-title : Bridge.viewer-streamer;
|
||||
description: Bridge.viewer-count > 0 ? @tr("{} · {} watching", Bridge.viewer-streamer, Bridge.viewer-count) : Bridge.viewer-streamer;
|
||||
if !Bridge.viewer-ended: LiveBadge {
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
if Bridge.viewer-qualities.length > 1 || Bridge.viewer-has-frame: StreamQuality {
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
// Popped out, the window has no members panel to open.
|
||||
if Bridge.members.length > 0 && !Bridge.viewer-popped: IconButton {
|
||||
icon: Icons.users;
|
||||
text: @tr("{} in voice", Bridge.members.length);
|
||||
label: @tr("Members");
|
||||
checked: Nav.right-panel-open && !Nav.pins-open && !Nav.topics-open;
|
||||
count: Bridge.members.length;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Nav.toggle-members(); }
|
||||
}
|
||||
|
||||
+1
-1
@@ -174,7 +174,7 @@ comes from the engine's events; what a gateway adds is hidden without it.
|
||||
| Pinned messages | `pins` | In the members panel's place: cards with author, time, text, files and reactions; the pin unpins, a click jumps to the message | `Gateway` `Pins`, `Pinned`, `Unpinned`; `GatewayRequest::Pins`, `Unpin` |
|
||||
| Topics | `topics`, `topic:<id>` | In the members panel's place: search, cards with the message count, creator and last activity, Create Topic; an open topic replaces the chat's messages and takes replies | `Gateway` `Topics`, `Topic`, `TopicHistory`; `GatewayRequest::Topics`, `TopicHistory`, `CreateTopic`, `Post` |
|
||||
| Voice channel | `voice`, `voice:compact` | Title, topic, "5 in voice / 50 total", Copy invite link (a `ts3server://` link to the channel; the phone's Invite button does the same), the members button, Smaller stage / Larger stage, Chat only; the people as large avatars (talking ring and bars, muted, crown, streaming); the streams as cards (the streamer's avatar on a painted scene in their colour, or the picture while watched, and our own from the Stream Studio its preview: `studio:live,server,voice`; LIVE, viewers, kind, bitrate, sound, Watch Stream); the call bar: mute and deafen (red while on), share (its menu opens above it), the voice settings and Leave; the channel's chat. The smaller stage (`ui.voice_compact`, and always in windows under 800 px tall, where its button is disabled) is one row of small avatars, scrolling sideways, and the streams as rows (Watch, Show), so the chat gets about 200 to 240 px more | `Presence`, `Talking`, `StreamsChanged`, viewer counts from `StreamsChanged`, else the `Gateway` stream directory |
|
||||
| Watching a stream | `watch`, `popout` | The channel's header with "5 in voice" and Leave; the player with the streamer, title, viewers, LIVE, the picture's height (the simulcast picker when a Voelin streamer offers layers), volume, elapsed time, what arrives (codec, size, frame rate, bitrate), back to the chat, pop out, full screen; a note that the stream belongs to the channel; the channel's chat and a Stream Info tab. Popped out (and in full screen) it fills the window | `WatchState`, `WatchLayers`, decoded frames and their stats (`src/video.rs`), `StreamsChanged` (viewer counts; the `Gateway` stream directory where the server gives none) |
|
||||
| Watching a stream | `watch`, `popout` | A header (on our channel's background) with the streamer's avatar, the title, the streamer and viewers, LIVE, the picture's height (the simulcast picker when a Voelin streamer offers layers), the members button and Leave; the player, with nothing over the picture but its controls: volume, elapsed time, what arrives (codec, size, frame rate, bitrate), back to the chat, pop out, full screen. The controls hide 2.5 s after the pointer last moved over the picture and come back when it moves (in full screen the cursor hides with them; on a touch screen a tap on the picture shows or hides them); while waiting for the picture and after the stream ended they stay, and so do they before the pointer was ever over the picture, as in screenshots. Then a note that the stream belongs to the channel; the channel's chat and a Stream Info tab. Popped out it fills the window, without the members button. In full screen (and on the phone outside the voice screen) the player is alone, with the streamer, title, viewers, LIVE and the quality over the picture's top, hiding with the controls | `WatchState`, `WatchLayers`, decoded frames and their stats (`src/video.rs`), `StreamsChanged` (viewer counts; the `Gateway` stream directory where the server gives none) |
|
||||
|
||||
The pins and topics share the place of the members panel: opening one
|
||||
closes the other, and the members button brings the panel back. On the
|
||||
|
||||
Reference in new issue
Block a user