From 9a94405b3a195d18ddcfaf2e1a01a683bff7bd52 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sat, 14 Sep 2019 06:05:09 +0300 Subject: [PATCH 1/4] Fix video playback is stretched on client resize --- osu.Game/Screens/Play/DimmableVideo.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/DimmableVideo.cs b/osu.Game/Screens/Play/DimmableVideo.cs index 3e6b95d2cc..4981c3457f 100644 --- a/osu.Game/Screens/Play/DimmableVideo.cs +++ b/osu.Game/Screens/Play/DimmableVideo.cs @@ -59,8 +59,12 @@ namespace osu.Game.Screens.Play RelativeSizeAxes = Axes.Both; Masking = true; - AddInternal(video); video.RelativeSizeAxes = Axes.Both; + video.FillMode = FillMode.Fill; + video.Anchor = Anchor.Centre; + video.Origin = Anchor.Centre; + + AddInternal(video); } [BackgroundDependencyLoader] From a36c80868247ff5a7fe1c180378e34e95732a905 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sat, 14 Sep 2019 06:28:59 +0300 Subject: [PATCH 2/4] Use Fit FillFode --- osu.Game/Screens/Play/DimmableVideo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/DimmableVideo.cs b/osu.Game/Screens/Play/DimmableVideo.cs index 4981c3457f..628871b164 100644 --- a/osu.Game/Screens/Play/DimmableVideo.cs +++ b/osu.Game/Screens/Play/DimmableVideo.cs @@ -60,7 +60,7 @@ namespace osu.Game.Screens.Play Masking = true; video.RelativeSizeAxes = Axes.Both; - video.FillMode = FillMode.Fill; + video.FillMode = FillMode.Fit; video.Anchor = Anchor.Centre; video.Origin = Anchor.Centre; From 9febeb1f3def1c30e07c825785f5c2557bbdcb26 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sat, 14 Sep 2019 06:32:00 +0300 Subject: [PATCH 3/4] Add black background --- osu.Game/Screens/Play/DimmableVideo.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/DimmableVideo.cs b/osu.Game/Screens/Play/DimmableVideo.cs index 628871b164..4d6c10d69d 100644 --- a/osu.Game/Screens/Play/DimmableVideo.cs +++ b/osu.Game/Screens/Play/DimmableVideo.cs @@ -4,8 +4,10 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Video; using osu.Game.Graphics.Containers; +using osuTK.Graphics; namespace osu.Game.Screens.Play { @@ -64,7 +66,15 @@ namespace osu.Game.Screens.Play video.Anchor = Anchor.Centre; video.Origin = Anchor.Centre; - AddInternal(video); + AddRangeInternal(new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + }, + video, + }); } [BackgroundDependencyLoader] From 2381b4c00365e8d59003b9fc235f25e953618cb7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 16 Sep 2019 00:20:56 +0900 Subject: [PATCH 4/4] Move video behind storyboard --- osu.Game/Screens/Play/Player.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 5c7ac9e762..309f4837e5 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -143,8 +143,8 @@ namespace osu.Game.Screens.Play private void addUnderlayComponents(Container target) { - target.Add(DimmableStoryboard = new DimmableStoryboard(Beatmap.Value.Storyboard) { RelativeSizeAxes = Axes.Both }); target.Add(DimmableVideo = new DimmableVideo(Beatmap.Value.Video) { RelativeSizeAxes = Axes.Both }); + target.Add(DimmableStoryboard = new DimmableStoryboard(Beatmap.Value.Storyboard) { RelativeSizeAxes = Axes.Both }); } private void addGameplayComponents(Container target, WorkingBeatmap working)