守望者--AIR技术交流

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
热搜: ANE FlasCC 炼金术
查看: 2847|回复: 0
打印 上一主题 下一主题

Surface Video Player ANE V2.0 (Android+iOS)

[复制链接]
  • TA的每日心情
    擦汗
    2018-4-10 15:18
  • 签到天数: 447 天

    [LV.9]以坛为家II

    1742

    主题

    2094

    帖子

    13万

    积分

    超级版主

    Rank: 18Rank: 18Rank: 18Rank: 18Rank: 18

    威望
    562
    贡献
    29
    金币
    52694
    钢镚
    1422

    开源英雄守望者

    跳转到指定楼层
    楼主
    发表于 2015-7-28 18:11:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    应用下载
    应用名称: surfaceVideoPlayer-ANE
    支持64位: 支持
    当前版本: 2.0
    运行平台: Android IOS 
    开发语言: ActionScript 3 JAVA Object-C 
    应用类别: ANE-多平台
    应用简介: SurfacePlayer extension helps you play video files inside your air mobile projects and you can control the position of the player by setting x, y, width and height parameters.
    Surface Video Player ANE V2.0 (Android+iOS)

    SurfacePlayer extension lets you play video files inside your air mobile projects and you can control the position of the player by setting x, y, width and height parameters.

    if you need to play your videos in native players out of your app, please check out: http://myappsnippet.com/video-player-native-extension/.

    you may also use our YouTube link parser found here: https://github.com/myflashlab/AS3-youtube-parser-video-link/ and with that you can easily play YouTube videos too.


    checkout here for the commercial version: http://myappsnippet.com/surface-video-player-ane


    you may like to see the ANE in action? check this out: https://github.com/myflashlab/surfaceVideoPlayer-ANE/tree/master/FD/dist


    YouTube demo Video: https://www.youtube.com/watch?v=HefrQwCSkKE



    NOTICE:


    the demo ANE works only after you hit the "OK" button in the dialog which opens.

    in your tests make sure that you are NOT calling other ANE methods prior to hitting the "OK" button.





    AS3 API:
    1. import com.doitflash.air.extensions.player.surface.SurfacePlayer;
    2. import com.doitflash.air.extensions.player.surface.SurfacePlayerEvent;

    3. var _ex:SurfacePlayer = new SurfacePlayer(stage);

    4. // // on Android, when the surface player is availble, it will hijack the device back button clicks! with the folloiwng listener you can listen to device's back button clicks
    5. _ex.addEventListener(SurfacePlayerEvent.ON_BACK_CLICKED, onBackClickedWhenSurfacePlayerIsAvailable);

    6. // dispatches when the video has reached end
    7. _ex.addEventListener(SurfacePlayerEvent.ON_COMPLETION_LISTENER, onVideoPlaybackCompleted);

    8. // when you attach a video file _ex.attachVideo(file); this listener will tell you if this file is availble or not. play your video only if it is availble
    9. _ex.addEventListener(SurfacePlayerEvent.ON_FILE_AVAILABILITY, onTargetVideoAvailability);

    10. // this listener will tell you different states that your Media is in. "STARTED", "PAUSED", "STOPPED"
    11. _ex.addEventListener(SurfacePlayerEvent.ON_MEDIA_STATUS_CHANGED, onMediaStatusChanged);

    12. // the first thing you should do is to initialize the extension with its initial parameters
    13. _ex.init(x, y, width, height, true); // the last parameter is the ratio for your video clip if false, the video will be stretched to fit your specified width and height

    14. // after initializing the extension, you need to attach a new video file to it
    15. _ex.attachVideo(File.documentsDirectory.resolvePath("testVideoPlayerSurface.mp4"));

    16. // and finally play it! (it's a good idea to always check for SurfacePlayerEvent.ON_FILE_AVAILABILITY before playing the file)
    17. _ex.play();

    18. // there are many other methods for you to control the video playback like pause, seek, fullscreen, set volume, etc. please study the sample demo project
    19. // coming with this extension to know how you can work with the other methods and when/how to dispose the extension properly.
    复制代码

    This extension works on Android SDK 11 or higher and iOS 7.1 or higher



    This extension does not require any special setup in the air manifest .xml file





    相关链接:


    https://github.com/myflashlab/surfaceVideoPlayer-ANE



    下载



    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
    收藏收藏 分享分享 支持支持 反对反对 微信
    守望者AIR技术交流社区(www.airmyth.com)
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    
    关闭

    站长推荐上一条 /4 下一条

    QQ|手机版|Archiver|网站地图|小黑屋|守望者 ( 京ICP备14061876号

    GMT+8, 2024-4-20 09:57 , Processed in 0.045853 second(s), 32 queries .

    守望者AIR

    守望者AIR技术交流社区

    本站成立于 2014年12月31日

    快速回复 返回顶部 返回列表