libgdx/gdx-video

Could not open WebM file after latest commits

Closed this issue · 3 comments

Hi dear developers,

Today i refreshed my gradle project and after getting the new dependencies, i experienced an error that i did not have up until now, without changing anything to my project. The last time i updated my project was about 4-6 months ago and back then everything was working. I am working on a desktop application and i used webm videos for my cutscenes and everything was working perfect until today.

I attached the error stack down below:

java.lang.Exception: Could not open file!
	at com.badlogic.gdx.video.VideoDecoder.loadFile(Native Method)
	at com.badlogic.gdx.video.CommonVideoPlayerDesktop.play(CommonVideoPlayerDesktop.java:91)
	at framework.video.CutsceneVideoNonPausable.<init>(CutsceneVideoNonPausable.java:49)
	at framework.video.CutsceneManager.startCutscene(CutsceneManager.java:86)
	at code.main.GameBehaviorImplement.initializeGameStartingVideo(GameBehaviorImplement.java:61)
	at framework.main.GameBehavior.initialization(GameBehavior.java:203)
	at code.main.GameBehaviorImplement.initialization(GameBehaviorImplement.java:68)
	at framework.main.GameBehavior.create(GameBehavior.java:84)
	at code.main.GameBehaviorImplement.create(GameBehaviorImplement.java:46)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.initializeListener(Lwjgl3Window.java:416)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:366)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:192)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:166)
	at com.mygdx.game.DesktopLauncher.main(DesktopLauncher.java:26)
Exception in thread "main" java.lang.NullPointerException
	at com.badlogic.gdx.video.CommonVideoPlayerDesktop.setVolume(CommonVideoPlayerDesktop.java:272)
	at framework.video.CutsceneVideoNonPausable.<init>(CutsceneVideoNonPausable.java:50)
	at framework.video.CutsceneManager.startCutscene(CutsceneManager.java:86)
	at code.main.GameBehaviorImplement.initializeGameStartingVideo(GameBehaviorImplement.java:61)
	at framework.main.GameBehavior.initialization(GameBehavior.java:203)
	at code.main.GameBehaviorImplement.initialization(GameBehaviorImplement.java:68)
	at framework.main.GameBehavior.create(GameBehavior.java:84)
	at code.main.GameBehaviorImplement.create(GameBehaviorImplement.java:46)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.initializeListener(Lwjgl3Window.java:416)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:366)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:192)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:166)
	at com.mygdx.game.DesktopLauncher.main(DesktopLauncher.java:26)
[VideoPlayer::loadFile] Error opening file (cutscenes/intro.webm): No such file or directory

Rest assured the videos are in the specified locations and i tried everything on my part, refreshing the project and changing it's location and nothing worked. Thank you in advanced for your efforts and i hope i can get back on making my video work again

Did you check if the path is correct? Maybe IntelliJ/Android Studio changed the working directory.

yes, i assume the "assets" folder is still the root folder, and i did a lot of combinations of paths and nothing worked. Also, the IDE that i use is eclipse and i m only working on a Desktop project, i don t use android in my project

What OS are you working on? Windows / Linux / Mac?

Edit:

I thought maybe it was an issue with pathnames on Windows (slash vs. backslash). But on my system, it works just fine.
Do you have any other info that helps replicate the issue?

If we can't find the issue, maybe we need to reintroduce the previous, streaming I/O.
All I know is that the LibGDX FileHandle reports that the file exists, otherwise the error would be thrown earlier.