VideoManager native extension for android !! browseForVideo and native playback enabled!!

Presenting VideoManager native extension to help you get over your video handling woes on android. After a dull week of trying to churn something new, finally got this extension built for my project which requires quiet a bit of video related stuff.  It gives you some of most important features required to work with video in adobe air on android.   This extension will help you get over your native video playback hurdles on android (And help you forget StageWebView issues for good).

Top features

  • Native video playback from your air applications
  • Native rtsp playback on android (for rtsp supported devices)
  • browseForVideo just like CameraRoll browseForImage
  • Retrieve url, raw path, media id and other useful info..

 

Adapting your manifest to accommodate native video gallerybrowsing

<manifestAdditions><![CDATA[<manifest android:installLocation="auto">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET" />
<application>
<activity android:name="com.flashvisions.mobile.android.extensions.videomanager.VideoBrowserActivity"></activity>
</application>
</manifest>]]></manifestAdditions>

Usage:

Browse MediaRoll

var videomanager:VideoManager = VideoManager.getInstance();
videomanager.addEventListener(MediaRollEvent.SELECT, onSelect);
videomanager.addEventListener(MediaRollEvent.CANCEL, onCancel);

private function onSelect(e:MediaRollEvent):void
{

trace("selected");

trace(e.data.id); // media id
trace(e.data.url); // file url for air
trace(e.data.rawPath); // raw path
trace(e.data.resultCode); // android result code
trace(e.data.title); // media title

}

private function onCancel(e:MediaRollEvent):void
{
trace("cancelled");
}

 

Play In Native Video Player

var videomanager:VideoManager = VideoManager.getInstance();
videomanager.addEventListener(MediaRollEvent.SELECT, onSelect);

private function onSelect(e:MediaRollEvent):void
{

videomanager.openVideoNative(e.data.url, "video/*");

}

Play http video in Native Video Player

var videomanager:VideoManager = VideoManager.getInstance();
videomanager.openVideoNative("http://somewebsite.com/myvideo.mp4", "video/*");

Play rtsp video in Native Video Player

var videomanager:VideoManager = VideoManager.getInstance();

videomanager.openStreamNative("rtsp://127.0.0.1:554/channel.sdp");

[/cc]

Coming soon in future…

  • Thumbnail support
  • popup video player
  • you tell me 🙂

 

This is a free extension (although donations are welcomed). you can Download the extension here:

 

7 Comments - Leave a comment
  1. Vinicius says:

    Should allow include in IOS compiler
    and use the “.isSupported”. to see that is IOS and return false.

  2. Mauro Villa says:

    Thank you SO, SO MUCH for this extension. I used it for a multimedia application and it worked right off the bat.

    Great documentation too.

    Well done!!

  3. Mauro Villa says:

    Any chance you can update the extension for rtmp streams? I’m using Wondershare PLayer to play RTSP streams and it also supports RTMP.

    It would be nice to use a ntive player instead of relying on a web view.

  4. Tyler says:

    Are you able to release the source code for this extension? I need to add features to it.

  5. pcoyne says:

    Hi, great native extension. Have you included an isSupported flag like Vinicius was talking about? If there is a default actionscript implementation and an isSupported flag then we can use this ANE in applications that target multiple platforms. Without a default implementation the ANE won’t package for apps that target multiple platforms.

    If there is an isSupported flag how do I use this. Sorry I don’t know much about ANEs. Thanks for your help.

  6. Mauro Villa says:

    Hi there,

    Thank you for your extension. It’s great!

    Could you please add support to open YouTube videos using the vnd.youtube protocol?

    Example:
    var videomanager:VideoManager = VideoManager.getInstance();
    videomanager.openStreamNative(vnd.youtube:VIDEO_ID;

    would prompt the user to select the YouTube app and play the video with that id (I understand autoplay is not possible but that’s ok).

  7. Francesco says:

    Hi there,

    can i play local video stored in File.applicationStorageDirectory?

    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

*