Skip to content

Commit c2fb0d5

Browse files
authored
Fix MediaElement in Sample App (#2788)
Set `MetadataArtworkUrl` to a Url Set MediaElement Popup Width and Height so that you can tap outside in windows to close it.
1 parent 0f0e8d3 commit c2fb0d5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

samples/CommunityToolkit.Maui.Sample/Pages/Views/MediaElement/MediaElementPage.xaml.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,18 @@ async void DisplayPopup(object sender, EventArgs e)
274274

275275
var popupMediaElement = new MediaElement
276276
{
277+
WidthRequest = 600,
278+
HeightRequest = 400,
277279
AndroidViewType = AndroidViewType.SurfaceView,
278280
Source = source,
279-
MetadataArtworkUrl = "dotnet_bot.png",
281+
MetadataArtworkUrl = botImageUrl,
280282
ShouldAutoPlay = true,
281283
ShouldShowPlaybackControls = true,
282284
};
283285

284286
await this.ShowPopupAsync(popupMediaElement);
285287

286-
popupMediaElement.Stop();
287-
popupMediaElement.Source = null;
288+
popupMediaElement.Stop();
289+
popupMediaElement.Source = null;
288290
}
289291
}

0 commit comments

Comments
 (0)