About

Since version 3.1 we implemented API to control app engine via HTTP. To do that, you should send appropriate HTTP GET query to the app engine (default IP:port is 127.0.0.1:6878)

Limitations

You can't use HTTP API with AJAX queries from secured (https) pages, because HTTP API is not secured, and such behaviour (http query from https page) will be blocked by browser.
So you must have and serve a dedicated unsecured page on your secured site to work with engine HTTP API.

Checking local engine availability

Send JSON query to http://127.0.0.1:6878/webui/api/service?method=get_version&format=jsonp. If app engine is running, then it return version string in JSON format.

Additional features

Engine can provide some additional features to control playback session, such as extra commands, session statistics and events polling.
To access such features, you must add this param to playback session options:

Sending extra commands to the app engine

Via command_url link you can control playback session.

Command name passed to app engine via method param.
For the moment you can use only one command: stop - stop playback session.
Its recommended to send "stop" command to the app engine when user stops playback in the media player UI/controls.

Notifications about missing paid option

In some cases user must have a permit (the paid option) to playback some content. If such permit not granted, then app engine will stop the playback and send a notification to user (by showing some predefined text in the default browser).
This behaviour can be overrided, and then client API will handle user notifications by itself. To do this, engine playback session should be started with use_stop_notifications=1 param.
In this case at playback stop app engine will not send notification to user, but send a event to client.

Player ID

Player ID (pid) - random string, used for player identification during engine connect session.

"Player ID" purpose - app engine must distinguish one player session from another, as in the current engine implementation user cannot play the same live stream with two (or more) players simultaneously from one engine, and engine will stop to serve requests from one player, when got a new request from another.