October, 2013


22
Oct 13

HypVideo

HypVideo is a new native extensions for OpenFL which allow to do video playback on Android & iOS.
For now it allow only to play remote video.

Setup:

HypMedias is on HaxeLib, you can install it by using:

1
haxelib install HypMedias

The project is on github too : https://github.com/hyperfiction/HypMedias

HypMedias use a dependency called “inthebox-macros”, you must install it too:

1
haxelib install inthebox-macros

Android:

On iOS there is nothing to do, but on android you need to add the following activity to your AndroidManifest:

1
2
3
4
5
6
7
<!-- HypMedias -->
<activity
   android:name="fr.hyperfiction.hypmedias.HypVideoActivity"
   android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
   android:label="HypMedias"
   android:screenOrientation="landscape"
/>

Usage:

This is really easy to use :

1
2
3
4
5
6
7
8
9
10
11
12
import fr.hyperfiction.hypmedias.HypVideo;
import fr.hyperfiction.hypmedias.HypVideo.HypVideoEvent;

var v = HypVideo.getInstance( );
v.addEventListener( HypVideoEvent.PLAYBACK_COMPLETE , _onHypVideo_event );
v.addEventListener( HypVideoEvent.PLAYBACK_ERROR , _onHypVideo_event );
v.addEventListener( HypVideoEvent.PLAYBACK_INFO , _onHypVideo_event );
v.addEventListener( HypVideoEvent.PLAYBACK_PAUSE , _onHypVideo_event );
v.addEventListener( HypVideoEvent.PLAYBACK_PLAY , _onHypVideo_event );
v.addEventListener( HypVideoEvent.PLAYBACK_SEEK , _onHypVideo_event );
v.addEventListener( HypVideoEvent.PLAYBACK_STOP , _onHypVideo_event );
v.playRemote("VIDEOURL");