【发布时间】:2017-03-30 13:56:46
【问题描述】:
我正在为一位客户开发一款应用程序,该应用程序是他们最新产品视频的一站式商店。它将下载在线发布的最新视频,将它们分类,然后允许用户选择要添加到 VLC 播放列表的视频。这一切都很完美。然而,最后一块拼图是直接使用 Adobe 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