This repository contains a Godot example project showing OpenXR composition layers based on Android surfaces for Godot 4.4+.
It plays a short, looping video clip, using Android's MediaPlayer
which should take advantage of hardware video decoding if it's available on the device.
Watch a video of the project running.
Unlike a similar example using a Godot Android plugin, which is written in Kotlin and must be built with Gradle, this example uses Godot's JavaClassWrapper
to do everything in GDScript.
For simply playing a video from a file using Android's MediaPlayer
, this works fine! You may even be able to do some more advanced things with some effort.
However, if your use case is more complex, it may be easier and more efficient to use a Godot Android plugin like the other example.
Unless otherwise specified (for example, in the "CREDITS" section below), this project is distributed under the terms of the MIT License.
The video clip used is from "Big Buck Bunny", (c) copyright 2008 Blender Foundation / www.bigbuckbunny.org, and licensed under the CC-BY 3.0 license.