Closed AndroidDeveloperLB closed 2 years ago
Hi, I'm not sure what you mean? Easiest way to try it would probably be to copy GdxVideoTest into your own project, along with the sample WebM. If it closes upon click, it sounds like you might be running that class but it's failing to play, so... what does the console output say?
Most videos won't work on desktop as there's no H.264+AAC decoding support, but VP9 (or VP8 but I don't know why you'd use that) in an MKV container works fine. Vorbis audio is supported, but best have it as a separate file using Music
so you can keep the audiosync in check.
I mean that launching the app on PC, using every possible class that has "main" in it, resulted in a black screen, making the sample not quite showing what it's supposed to do on PC. I think only on Android it works well.
Here, a video to show you what I see (when launching the DesktopLauncher, as GdxVideoTest doesn't have "main" function) : studio64_M7weJh48yZ.zip
As for support of video codecs, it seems it uses "WEBM" ("libGDX - It's Good For You!.webm"). I suggest to switch to MP4 for a sample, as it's more widely supported. For this file, however, I could open it fine using MPC app.
When pressing the black content, I get this in the logs:
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Unable to read file for extraction: gdx-video-desktop64.dll
Running DesktopLauncher
(or Lwjgl3Launcher
- I'm going to refer to the latter as DesktopLauncher
for simplicity) is the correct way to start a libGDX application on desktop.
Have you added the desktop Gradle dependency? implementation "com.badlogicgames.gdx-video:gdx-video-lwjgl3:1.3.2-SNAPSHOT"
, or lwjgl
instead of lwjgl3
if your DesktopLauncher
uses LwjglApplication
.
MP4 was actually replaced in 4b4339a3d08c38f6bdae4f3c7adaa77220db8b8e for compatibility. Personally, I use H.264 MP4 for non-desktop targets.
@Frosty-J Isn't it enough to clone the project and run it? Why isn't the dependency in the project, and I need to add it? As for DesktopLauncher , that's what I launched, as you can see on the video.
It seems the gradle file of the desktop app uses this:
api project(":gdx-video-core")
Isn't it enough?
Anyway, I tried, and still didn't work. Watch:
I don't know, but you're really best off creating a new project with gdx-setup (or use an existing one) then modifying your generated project's build.gradle
with the instructions. You can replace 0.0.1
with $gdxVideoVersion
then define the version as 1.3.2-SNAPSHOT
at the top where gdxVersion
and whatnot is defined. I've never been able to run the test from the repository, and its versions are all out-of-date anyway.
OK thanks. Please consider adding a note in the desktop class "DesktopLauncher" that says that it's currently not working, if you failed to open it normally.
I tried to find all files with "main" in them, but all of them just showed a black window, that closes when I press in it....