Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video thumbnails on Android #6

Open
EdwardMcFlurry opened this issue Sep 13, 2022 · 4 comments
Open

Video thumbnails on Android #6

EdwardMcFlurry opened this issue Sep 13, 2022 · 4 comments

Comments

@EdwardMcFlurry
Copy link

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.
Screenshot 2022-09-13 at 12 08 51
Mine

@davidbritch
Copy link
Owner

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.

@EdwardMcFlurry
Copy link
Author

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.

😀

@99067718
Copy link

You tricked me with the bottom image, I tried to click the play button.

@EdwardMcFlurry
Copy link
Author

@99067718 I'm sorry 😂 for the trick...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants