libgdx / gdx-video

A libGDX cross platform video rendering extension
Apache License 2.0
145 stars 48 forks source link

Video does not play when asset filter is used #72

Closed Frosty-J closed 2 years ago

Frosty-J commented 2 years ago

Hi, Simon. You might remember me from streaming Music with an asset filter. I've been able to do the same with VideoPlayer, but it requires a modification first.

Line 41 shown here will throw an exception if an asset filter is used. I commented this line out in my local build to allow the video to play.

https://github.com/libgdx/gdx-video/blob/e71b35b7019937f11592b7521c29743ac3f56e7f/gdx-video-gwt/src/com/badlogic/gdx/video/VideoPlayerGwt.java#L39-L48

If you'd rather not remove this, perhaps we could test for an HTTP status code first, though I don't think that's necessary as attempting to play a video that 404s (or any other error) doesn't crash the game, and leaves a more helpful error in the console than before (which was no error, usually).

Additionally, "Oh no!" should probably use Gdx.app.log() so it actually prints on GWT.

https://github.com/libgdx/gdx-video/blob/5f63da1777d83b2f105095dc255f73d8ff0f9584/test/core/src/main/java/com/badlogic/gdx/video/test/GdxVideoTest.java#L61-L65