Mediaplyer controls overlap sidebar - hide mediaplayer buttons via code?

13 views
Skip to first unread message

Gareth Murfin

unread,
Jan 23, 2019, 5:24:32 AM1/23/19
to CodenameOne Discussions
On Android if the media player buttons are showing (like I tapped the mediaplayer) then I open my side menu, then the controls from the mediaplayer overlap the side menu, is there a way to avoid this ? Or perhaps a line of code that can hide the controls on the mediaplayer when I open my side menu ? I know its kind of an edge case but it looks really odd when it happens, sort of thing clients dont like :)

Shai Almog

unread,
Jan 23, 2019, 10:20:13 PM1/23/19
to CodenameOne Discussions
There is this:
Media someMedia = ...
...
someMedia.setVariable(Media.VARIABLE_NATIVE_CONTRLOLS_EMBEDDED, false); // hides native controls

or

someMedia.setVariable(Media.VARIABLE_NATIVE_CONTRLOLS_EMBEDDED, true); // shows native controls


Gareth Murfin

unread,
Jan 24, 2019, 12:52:34 AM1/24/19
to CodenameOne Discussions
perfect, you guys have thought of everything, thanks!

Gareth Murfin

unread,
Jan 25, 2019, 12:46:52 AM1/25/19
to CodenameOne Discussions
thanks it works but then theyre turned off for good, ie user can close side menu but then cant play video. Is there any event I can use to detect when the side menu is closed? (since user can tap outside of it to shut it, I cant detect re-tapping the hamburger menu)

Shai Almog

unread,
Jan 26, 2019, 12:35:57 AM1/26/19
to CodenameOne Discussions
There is no event for side menu folding. We could possibly add that but it won't be soon as we're gearing towards the 6.0 release.

Gareth Murfin

unread,
Jan 26, 2019, 8:19:10 PM1/26/19
to CodenameOne Discussions
nice one, looking forward to 6.0 :) yeh i think it would be a good feature for people with similar issues.
Reply all
Reply to author
Forward
0 new messages