【问题标题】:Using AIR and AS3 to Launch VLC on Android使用 AIR 和 AS3 在 Android 上启动 VLC
【发布时间】:2017-03-30 13:56:46
【问题描述】:

我正在为一位客户开发一款应用程序,该应用程序是他们最新产品视频的一站式商店。它将下载在线发布的最新视频,将它们分类,然后允许用户选择要添加到 VLC 播放列表的视频。这一切都很完美。然而,最后一块拼图是直接使用 Adob​​e AIR 打开 VLC 播放列表。这是我的代码:

var fs:FileStream=new FileStream();   // Creates a new filestream
var path:String=File.userDirectory.resolvePath($fle).nativePath;  // Creates the playlist path
var file:File=new File(path);         // Creates the file
try{fs.open(file,FileMode.WRITE);}    // Opens the file to write the data
catch(error:Error){}
fs.writeUTFBytes(outputStr);          // Writes the data
fs.close();                           // Closes the filestream
//file.openWithDefaultApplication();  // I found out this doesn't work with Android systems
var url:String = ("intent:#Intent;" +
              "action=android.intent.action.MAIN;" +
              "category=android.intent.category.LAUNCHER;" +
              "component=org.videolan.vlc/.AppEntry;" +
              "end");                 // The intent string
navigateToURL(new URLRequest(url));   // Navigates to the app

唯一需要注意的是,我不知道如何为 VLC 获取正确的组件信息或如何让播放列表开始播放。指向“设置”屏幕的意图部分的原始代码有效,但我无法让它启动任何其他应用程序。

更新: 我已经能够启动 VLC,播放使用此页面播放的最后一个视频作为参考: https://wiki.videolan.org/Android_Player_Intents/

这是更新后的 url 请求字符串:

var url:String = ("intent:#Intent;" +
                  "action=android.intent.action.MAIN;" +
                  "category=android.intent.category.LAUNCHER;" +
                  "component=org.videolan.vlc/org.videolan.vlc.gui.video.VideoPlayerActivity;" +
                  "end");

这会启动 VLC 并播放最后播放的视频。但是,我希望它播放指定的播放列表。

【问题讨论】:

    标签: android actionscript-3 air adobe


    【解决方案1】:

    一个不错的做法是 ANE,空气原生扩展, ANE 让您执行本机(android 或 ios 或 ...)代码 所以你有更多的选择来运行 VLC 和访问它的属性

    还有read it
    如果您对 ane 开发有任何问题,请告诉我以改进此答案,我认为您对 java 端编程没有任何问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-14
      • 2023-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多