Skip to content

Repository files navigation

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

About

Basic native video support for Android HaxeFlixel.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages