extension-videoview

Basic native video support for Android in HaxeFlixel using Java VideoView.
https://github.com/Joalor64/extension-videoview

To install, run:

haxelib install extension-videoview 1.0.1 

See using Haxelib in Haxelib documentation for more information.

README.md

extension-videoview

Basic native video support for Android in HaxeFlixel using Java VideoView.

Installation

To install extension-videoview, follow these steps:

  1. Install the latest stable version with this command:

    haxelib install extension-videoview

    You can also install through Git for the latest updates.

    haxelib git extension-videoview https://github.com/Joalor64/extension-videoview
  2. Add this code to your Project.xml:

    <haxelib name="extension-videoview" if="android" />

Usage Example

#if android
import extension.videoview.VideoView;
#end
import flixel.FlxBasic;

class VideoPlayer extends FlxBasic
{
	public var finishCallback:Void->Void = null;

	public function new(name:String)
	{
		super();

		#if android
		VideoView.playVideo('assets/videos/$name.mp4'); // the video can be in any format (e.g., .webm, .mkv, .etc)
		VideoView.onCompletion = function()
		{
			if (finishCallback != null)
			{
				finishCallback();
			}
		}
		#end
	}
}

By the way, this extension can also run videos from the web browser.

Licensing

extension-videoview is made available under the MIT License. Check LICENSE for more information.

Credits

Contributors
MAJigsaw77
Joalor64
Version
1.0.1
Published
7 months ago
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub

⌂