Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit b767630

Browse files
authored
1809 medialement class not found (#1812)
1 parent a070c2a commit b767630

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/CommunityToolkit/Xamarin.CommunityToolkit/Views/MediaElement/Android/MediaElementRenderer.android.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.ComponentModel;
3+
using System.Diagnostics;
34
using Android.Content;
45
using Android.Media;
56
using Android.Views;
@@ -375,11 +376,18 @@ protected void UpdateVolume()
375376

376377
mediaPlayer?.SetVolume((float)MediaElement.Volume, (float)MediaElement.Volume);
377378
}
379+
378380
protected void UpdateSpeed()
379381
{
380382
if (MediaElement == null || mediaPlayer == null)
381383
return;
382384

385+
if (Helpers.XCT.SdkInt < 23)
386+
{
387+
Trace.WriteLine("MediaElement Speed control functionality is not available. Minimum supported API is 23");
388+
return;
389+
}
390+
383391
var playbackParams = new PlaybackParams();
384392
playbackParams.SetSpeed((float)MediaElement.Speed);
385393
mediaPlayer.PlaybackParams = playbackParams;

0 commit comments

Comments
 (0)