Skip to content

Commit

Permalink
Improve video player to imitate YouTube player style.
Browse files Browse the repository at this point in the history
Add updated video (just a not complete demo, but with better sound and image quality as the last one)
  • Loading branch information
HenrikJannsen committed Dec 7, 2023
1 parent b01e1c0 commit dabbae2
Show file tree
Hide file tree
Showing 33 changed files with 671 additions and 81 deletions.
23 changes: 23 additions & 0 deletions desktop/src/main/java/bisq/desktop/common/view/FillStageView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.desktop.common.view;

// Marker interface for child views used in popups when the window size change should be applied to the view,
// so that the popup will fill the available space.
public interface FillStageView {
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,16 @@ public static Button createIconButton(String iconId, @Nullable String tooltip) {
}

public static Button createIconButton(ImageView imageView) {
return createIconButton(imageView, null);
}

public static Button createIconButton(ImageView imageView, @Nullable String tooltip) {
Button button = new Button();
button.setGraphic(imageView);
button.getStyleClass().add("icon-button");
if (tooltip != null) {
button.setTooltip(new BisqTooltip(tooltip));
}
return button;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
package bisq.desktop.main.content.bisq_easy.onboarding;

import bisq.bisq_easy.NavigationTarget;
import bisq.common.observable.Pin;
import bisq.desktop.ServiceProvider;
import bisq.desktop.common.threading.UIThread;
import bisq.desktop.common.view.Controller;
import bisq.desktop.common.view.Navigation;
import bisq.desktop.main.content.bisq_easy.trade_wizard.TradeWizardController;
Expand All @@ -33,6 +35,7 @@ public class BisqEasyOnboardingController implements Controller {
private final BisqEasyOnboardingView view;
private final BisqEasyOnboardingModel model;
private final SettingsService settingsService;
private Pin cookieChangedPin;

public BisqEasyOnboardingController(ServiceProvider serviceProvider) {
settingsService = serviceProvider.getSettingsService();
Expand All @@ -42,11 +45,13 @@ public BisqEasyOnboardingController(ServiceProvider serviceProvider) {

@Override
public void onActivate() {
model.getVideoSeen().set(settingsService.getCookie().asBoolean(CookieKey.BISQ_EASY_VIDEO_OPENED).orElse(false));
cookieChangedPin = settingsService.getCookieChanged().addObserver(c -> UIThread.run(() ->
model.getVideoSeen().set(settingsService.getCookie().asBoolean(CookieKey.BISQ_EASY_VIDEO_OPENED).orElse(false))));
}

@Override
public void onDeactivate() {
cookieChangedPin.unbind();
}

void onOpenOfferbook() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public class BisqEasyVideoController implements Controller {
@Getter
private final BisqEasyVideoView view;
private final SettingsService settingsService;
private Runnable completeHandler;

public BisqEasyVideoController(ServiceProvider serviceProvider) {
settingsService = serviceProvider.getSettingsService();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@

import bisq.desktop.common.view.Model;
import lombok.Getter;
import lombok.Setter;

@Getter
public class BisqEasyVideoModel implements Model {
@Setter
private boolean mediaPlayerPausedBySeek;
@Setter
private double lastPositionBeforeClose;
}
Loading

0 comments on commit dabbae2

Please sign in to comment.