-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Cross-platform media controller for video playback #1845
Conversation
… media player on initialization
@rh101 |
ADd copyright notices
Yes, it's only for linux, and axmol prebuilt libvlc not work for current axmol version |
Currently in the process of testing the Linux version, and fixing a few issues related to content scaling. I'm trying to convert this PR to a draft with the button on github, but it's not letting me, so for the time being, please don't merge anything in. |
Ensure media controller correctly resizes on full-screen media playback
Linux version runs, but I'm having issues with missing media player control font characters. The Android version is also missing the play button font character, yet all the other buttons appear correctly, so another issue with the fonts on that system. I'm not sure how to resolve this without using image files, but with image files, to not look pixelated, they end up as 3-4K file each, so the resulting base64 encoded PNGs are pretty large. Any suggestions? |
Use drawNode to draw control buttons shape? |
disable by default maybe better |
Or embed textures due to the buttons shape is simply. for example progress bar can use one 2x2 white texture, and embed arrow, stop textures |
Add fullscreen enter and exit controls setUserInputEnabled and isUserInputEnabled replaced by setMediaControllerEnabled and isMediaControllerEnabled
Describe your changes
This PR is to add a media controller to video playback, which works across all supported platforms and media engine backends.
@halx99 Is the VLC engine only for Linux? Attempting to compile it on Windows ended up with this error:
3>Error copying directory from "G:/game_engines/axmol/3rdparty/vlc/win/lib/vlc/plugins" to "G:/dev/public/tests/videotest/build_x64/bin/videotest/Debug/plugins".
I don't see the
vlc
folder in theaxmol/3rdparty
either, and I'm not sure what else I need to do besides enable it viaset(AX_ENABLE_VLC_MEDIA ON CACHE BOOL "" FORCE)
.By default the player controls are off. Would it be preferrable to have them disabled by default?
At the moment, to enable or disable them, just use
VideoPlayer::setUserInputEnabled()
. For example:The default media controller can also be overriden with a custom version, and applied to the video player via
MediaPlayer::setMediaController(MediaController* controller)
.The Android implementation required a work-around, since there was no way to retrieve the content duration and current time directly. It has to happen in callbacks, but I'm not sure if the solution implemented in this PR is the most appropriate, so please review that, specifically the code in
AxmolMediaEngine.java
, methodprocessVideoFrame
, where it calls back with the current video playback time.Issue ticket number and link
#1811
Checklist before requesting a review
For each PR
Add Copyright if it missed:
-
"Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md)."
I have performed a self-review of my code.
Optional:
For core/new feature PR