gdx-video icon indicating copy to clipboard operation
gdx-video copied to clipboard

surface texture resolution does not change

Open rushikeshGH opened this issue 7 months ago • 1 comments

since the texture id never changes the surfarce texture always has the same resolution even when the video resolusion changes.

this is what i did to fix it:

private void initializeMediaPlayer()
{
	if (handler == null)
		handler = new Handler(Looper.getMainLooper());

	Gdx.app.postRunnable(() -> {
		textureBuffer = BufferUtils.newIntBuffer(1);
		Gdx.gl.glGenTextures(1, textureBuffer);
		textureID = textureBuffer.get(0);

		Gdx.gl.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, textureID);

		handler.post(() -> {
			player = new MediaPlayer();
			videoTexture = new SurfaceTexture(textureID);
			initialized = true;
		});
	});
}

rushikeshGH avatar May 07 '25 12:05 rushikeshGH

Do you mind making a PR with a fix?

SimonIT avatar May 11 '25 18:05 SimonIT