For Developers

Русская версия

This article describes how to develop your own video Plugin for Perfect Player.

The aim of plugin is to download site’s pages, parse pages and return videos and folders lists to the player. It must return links’ names, URLs and types (file/folder). Also, plugin can return links’ thumbs URLs and descriptions. Player can send commands to plugin, such as: go to next page, go to previous page, select item, refresh data.
Basic Java development experience is recommended.

To avoid any copyrights issues I’ll use my own photos as posters for videos.
Suppose that the base site link with videos is

1. As a development enviroment we’ll use Eclipse IDE for Java Developersdownload

2. Add new Java Project Plugin TestPlugin (File -> New -> Java Project)

3. Add new Java Class and name it TestPlugin (File -> New -> Class)

4. Copy plugin-0.4.0.jar library to libs folder of the Project and add it to be used by Project
(Project -> Properties -> Java Build Path -> Libraries)

5. Create plugin icon.png and put it to src folder of the Project
(Recommended icon resolution is 96×96 px)

6. Write and test previously created class

7. Export plugin as jar-file (select only src folder to export)

8. If you want your plugin to work on Android platform too, you need to make classes.dex file of plugin classes and copy it into jar-file (jar-file is usual zip archive). You need to use dx.bat utility (it is in Android SDK) to get classes.dex.

Inside jar-file should look like this:

9. The plugin is ready! It can be used with Perfect Player.

For the full Plugin TestPlugin Project sources go here

Download testplugin-0.1.0.jar

One Response to For Developers

  1. Pingback: Plugins development | NIKLABS

Comments are closed.