I'm working on an app for a client that is a one stop shop for their latest product videos. It will download the latest videos posted online, organize them into categories, and then allows the user to select videos to add to a VLC playlist. This is all working perfectly. However, the last piece of the puzzle is opening the VLC playlist using Adobe AIR directly. Here is my code:
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
The only caveat is that I don't know how to get the proper component information for VLC or how to get the playlist to start playing. The original code for the intent section directed towards the Settings screen, which worked, but I can't get it to launch any other app.
UPDATE: I've been able to launch VLC, playing the last video played using this page as reference: https://wiki.videolan.org/Android_Player_Intents/
Here's the updated url request string:
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");
That launches VLC and plays the last played video. However, I want it to play a specified playlist.