dotnet-maui-videoplayer
dotnet-maui-videoplayer copied to clipboard
Video thumbnails on Android
I have noticed that the Controls on Android fades away after few seconds unless you tap on the Video whereas on iOS/Mac there's a fixed Play button at the centre of the Video with a thumbnail behind it.
Could there be a way to have either thumbnails for each Video or perhaps have Controls fixed without fading away as the end-user might think that there's no Video to play.
Hi @EdwardMcFlurry
By default, an Android MediaController
hides itself after 3 seconds. In order to make it visible throughout video playback you'll have to override the MediaController.Hide
method:
public class MyMediaController : MediaController
{
public MyMediaController(Context context) : base(context)
{
}
public override void Hide()
{
}
public void HideController()
{
base.Hide();
}
}
Having an empty Hide
method ensures that the transport controls never fade out. Then, instead of creating a new MediaController
, create a new MyMediaController
:
_mediaController = new MyMediaController(_context);
The problem this creates is that in some scenarios the transport controls will still be showing even when you navigate away from the page. That's the purpose of the HideController
method - it forces the transport controls to disappear. You just need to call this method at an appropriate point in the page lifecycle.
Hi @davidbritch
Thank you so much for the response and I'll give it a try and see if it won't be ideal for my scenario or perhaps at least look for ways of having the thumbnails for Android.
😀
You tricked me with the bottom image, I tried to click the play button.
@99067718 I'm sorry 😂 for the trick...