Skip to content

Commit

Permalink
fix(mpe): show player when transport controls are disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ramezgerges committed Jan 25, 2024
1 parent a99925c commit a3b7aa1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
12 changes: 0 additions & 12 deletions src/AddIns/Uno.UI.MediaPlayer.Skia.Gtk/GtkMediaPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,18 +358,6 @@ private void UpdateVideoStretch(bool forceVideoViewVisibility = false)
var currentSize = new Size(ActualWidth, ActualHeight);
// If the control is not visible, or not sized properly
// we cannot display the video window.
if (currentSize.Height <= 0 || currentSize.Width <= 0)
{
if (this.Log().IsEnabled(Microsoft.Extensions.Logging.LogLevel.Debug))
{
this.Log().Debug($"Skipping layout update for empty layout slot");
}
return;
}
var playerHeight = (double)currentSize.Height - _transportControlsBounds.Height;
var playerWidth = (double)currentSize.Width;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,12 @@ public async Task When_MediaPlayerElement_SetIsFullWindow_Check_Fullscreen()
var sut = new MediaPlayerElement()
{
AutoPlay = true,

// Workaround to get the control loaded https://github.com/unoplatform/uno/issues/14735
AreTransportControlsEnabled = true,
Source = MediaSource.CreateFromUri(TestVideoUrl),
};

//Load Player
WindowHelper.WindowContent = sut;
await WindowHelper.WaitForLoaded(sut, timeoutMS: 6000);
await WindowHelper.WaitForLoaded(sut, timeoutMS: 20000);

sut.MediaPlayer.Play();

Expand Down Expand Up @@ -170,15 +167,12 @@ public async Task When_MediaPlayerElement_SetSource_Check_Play()
var sut = new MediaPlayerElement()
{
AutoPlay = true,

// Workaround to get the control loaded https://github.com/unoplatform/uno/issues/14735
AreTransportControlsEnabled = true,
Source = MediaSource.CreateFromUri(TestVideoUrl),
};

//Load Player
WindowHelper.WindowContent = sut;
await WindowHelper.WaitForLoaded(sut, timeoutMS: 6000);
await WindowHelper.WaitForLoaded(sut, timeoutMS: 20000);

sut.MediaPlayer.Play();
await WindowHelper.WaitFor(
Expand Down Expand Up @@ -275,15 +269,12 @@ public async Task When_MediaPlayerElement_Check_TransportControlVisibility()
var sut = new MediaPlayerElement()
{
AutoPlay = true,

// Workaround to get the control loaded https://github.com/unoplatform/uno/issues/14735
AreTransportControlsEnabled = true,
Source = MediaSource.CreateFromUri(TestVideoUrl),
};

//Load Player
WindowHelper.WindowContent = sut;
await WindowHelper.WaitForLoaded(sut, timeoutMS: 6000);
await WindowHelper.WaitForLoaded(sut, timeoutMS: 20000);

sut.AreTransportControlsEnabled = false;

Expand Down

0 comments on commit a3b7aa1

Please sign in to comment.