Vimu player API for 3rd-party apps
Application developers are welcome to use Vimu Player as a playback engine.
3rd party streaming apps can control some Vimu properties over intent extras like intent.putExtra(key, value). Here are some keys:
"forcename"=>String — the string will be displayed on the infobar as the name of the content.
"forcedsrt"=>String — URL of a subtitle (SRT) file to be attached to the video.
"startfrom"=>int — player will seek to provided timestamp (in msecs) at playback start (if file's format is seekable).
"forceresume"=>boolean — enable resume playback feature for current URL.
App can be started with startActivityForResult to get info back from the app.
Result code will be returned:
1 - playback completed (to the end)
0 - playback was interrupted. In that case interrupt "position" integer will be returned in the intent data.
4 - playback failed with a error
It's possible to upload a playlist over intent. Example:
Intent vpIntent = new Intent(Intent.ACTION_VIEW);
ArrayList<String> names = new ArrayList<String>();
ArrayList<String> files = new ArrayList<String>();
vpIntent.putStringArrayListExtra("asusfilelist", files); vpIntent.putStringArrayListExtra("asusnamelist", names);
Playlist can be with startActivityForResult to get info back from the app. Result codes are the same. In case of interrupt, "url" of interrupted file in playlist and "position" will be returned.