mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Hololens - Show/hide media controls according to playback state
This commit is contained in:
parent
c810962d78
commit
d633c8b9da
7 changed files with 69 additions and 4 deletions
|
@ -70,6 +70,20 @@ void BrowserPage::BindServoEvents() {
|
|||
servoControl().OnCaptureGesturesEnded(
|
||||
[=] { navigationBar().IsHitTestVisible(true); });
|
||||
urlTextbox().GotFocus(std::bind(&BrowserPage::OnURLFocused, this, _1));
|
||||
servoControl().OnMediaSessionMetadata(
|
||||
[=](hstring title, hstring artist, hstring album) {});
|
||||
servoControl().OnMediaSessionPlaybackStateChange([=](const auto &,
|
||||
int state) {
|
||||
if (state == 1 /* none */) {
|
||||
mediaControls().Visibility(Visibility::Collapsed);
|
||||
return;
|
||||
}
|
||||
mediaControls().Visibility(Visibility::Visible);
|
||||
playButton().Visibility(state == 3 /* paused */ ? Visibility::Visible
|
||||
: Visibility::Collapsed);
|
||||
pauseButton().Visibility(state == 3 /* paused */ ? Visibility::Collapsed
|
||||
: Visibility::Visible);
|
||||
});
|
||||
}
|
||||
|
||||
void BrowserPage::OnURLFocused(Windows::Foundation::IInspectable const &) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue