libgdx / gdx-video

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

VideoPlayerAndroid does not adhere to Viewport type #19

Closed jameelur closed 8 years ago

jameelur commented 8 years ago

When using gdx-video on android I found that the VideoPlayerAndroid implementation doesn't adhere to the viewport (fill,fit etc) that it is instantiated with. It's a small viewport/camera problem.

iMackshun commented 8 years ago

In the VideoPlayerAndroid.java, I replaced these lines in order to make it fill the screen of whatever device it runs on.

//float x = -mp.getVideoWidth() / 2;
//float y = -mp.getVideoHeight() / 2;
//float width = mp.getVideoWidth();
//float height = mp.getVideoHeight();
float x = -(Gdx.graphics.getWidth()/2);
float y = -(Gdx.graphics.getHeight()/2);
float width = Gdx.graphics.getWidth();
float height = Gdx.graphics.getHeight();
RBogie commented 8 years ago

This issue can be further discussed in the PR that has been opened to fix this issue ( #20 ).