Git Product home page Git Product logo

hxcodec's Introduction

hxCodec

A library which adds native video support on HaxeFlixel.


Using libVLC, hxCodec allows to play hundreds of video codecs.

Click here to check the roadmap


Instructions

1. Install the library

Install the latest stable version of hxCodec by running the following Haxelib command:

haxelib install hxCodec

You can also install it through Git to get the latest changes:

haxelib git hxCodec https://github.com/polybiusproxy/hxCodec

2. Modify Project.xml

Add this code in the Project.xml file:

<haxelib name="hxCodec" if="desktop || android" />

OPTIONAL: If you want debug traces in your console when compiling in debug mode, add this:

<!-- Show debug traces for hxCodec -->
<haxedef name="HXC_DEBUG_TRACE" if="debug" />

Playing videos

You can play videos in just 2 lines of code:

var video:hxcodec.flixel.VideoHandler = new hxcodec.flixel.VideoHandler();
video.playVideo('assets/video.mp4');

Building

Windows and MacOS

You don't need any special instructions in order to build for Windows or MacOS. Just run the lime build windows / lime build mac command and the library will be building with your game.

Linux

In order to build a application with the library, you have to install libvlc-dev and libvlccore-dev from your distro's package manager.

Example with APT:

sudo apt-get install libvlc-dev libvlccore-dev 

Android

Currently, hxCodec can load videos only from internal / external storage (not from the application storage). In order for hxCodec to work on Android, you will need a library called extension-androidtools.

To install it, enter the following in a terminal:

haxelib git extension-androidtools https://github.com/MAJigsaw77/extension-androidtools.git

Next, add this into Project.xml

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

You can choose whether you want to use after you import this in your code.

import android.content.Context;
  • From internal storage: Context.getFilesDir() or Context.getCacheDir()
  • From external storage: Context.getExternalFilesDir() or Context.getExternalCacheDir().

You will also have to put the location manually in the paths and to copy that video to the respective path.

Licensing

hxCodec is made available under the Mozilla Public License 2.0. Check LICENSE for more information.

libVLC is the engine of VLC released under the LGPLv2 License (or later). Check VideoLAN.org for more information.

Credits

hxcodec's People

Contributors

acrazytown avatar actualmandm avatar aliwahabdev avatar bolovevo avatar brightfyregit avatar bushtrain460615 avatar crowplexus avatar deandimarzo avatar dotwith avatar erizur avatar gaboose avatar jonnycatmeow avatar jotaro-gaming avatar jrgamer4u avatar kade-github avatar majigsaw77 avatar nebulazorua avatar polybiusproxy avatar raltyro avatar reddoesstuff avatar sirox228 avatar stilic avatar swordcube avatar therealjake12 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.