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 23, 2024
1 parent a99925c commit bf503f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 27 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 @@ -117,9 +117,6 @@ public async Task When_MediaPlayerElement_Added_In_Opening()
// [Ignore("Test ignored on windows. Could not find the element by name. And Not supported under MAC [https://github.com/unoplatform/uno/issues/12663]")]
// [Ignore("https://github.com/unoplatform/uno/issues/13384")]
[Ignore("https://github.com/unoplatform/uno/issues/13384")]
#endif
#if __SKIA__
[Ignore("https://github.com/unoplatform/uno/issues/14735")]
#endif
[TestMethod]
public async Task When_MediaPlayerElement_SetIsFullWindow_Check_Fullscreen()
Expand All @@ -128,15 +125,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 +164,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 +266,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 bf503f4

Please sign in to comment.