Cinegy Player PRO REST API Manual

General Information

Cinegy Player PRO REST API allows using JSON data types.

The base URL to access the player via REST API has the following format:

Default URL can be changed in the PlayerPRO.exe.config file which can be found in the Cinegy Player PRO installation folder:

C:\Program Files\Cinegy\Cinegy Player PRO (x64)\PlayerPRO.exe.config

Multiple instances of Cinegy Player PRO can be started simultaneously. To do so, you should specify individual REST host for each instance with the following registry key before Player PRO startup:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cinegy LLC\Cinegy\Player]
"EnableWebApis"=dword:00000001

Media-based Methods

Open Media

Name

LoadItem

Method

POST

URL

http://localhost:8123/Player/LoadItem?path={arg}

Description

Open media target.

Usage
function LoadMedia(arg) {
  $.ajax({
        url: "http://localhost:8123/Player/LoadItem?path=" + arg,
        type: "POST",
    });
}

Play Media

Name

Play

Method

POST

URL

http://localhost:8123/Player/Play

Description

Play loaded media target.

Usage
function PlayMedia() {
  $.ajax({
        url: "http://localhost:8123/Player/Play",
        type: "POST",
    });
}

Pause Media

Name

Stop

Method

POST

URL

http://localhost:8123/Player/Stop

Description

Stop playing media target on current position.

Usage
function PauseMedia() {
  $.ajax({
        url: "http://localhost:8123/Player/Stop",
        type: "POST",
    });
}

Get Media

Name

CurrentItem

Method

GET

URL

http://localhost:8123/Player/CurrentItem

Response

Playlist xml

Description

Get loaded media target.

Usage
function GetMediaTimeline() {
    var xml= $.ajax( {
        url: "http://localhost:8123/Player/CurrentItem",
        type: "GET",
        dataType: ‘json’,
        success: onGetCurrentItemSuccess,
        cache: false,
        crossDomain: true,
    });
    return xml;
}
function onGetCurrentItemSuccess(response) {
 if (response.responseJSON != null) {
  var timeline = response.responseJSON;

  console.log(timeline);
 }
}
Response Example
<timeline duration="30.0633667" version="5">
	<group type="video" width="1920" height="1080" aspect="16:9" framerate="29.97" progressive="n">
		<track>
			<clip srcref="0" start="0" stop="30.0633667" mstart="0" mstop="30.0633667">
				<quality src="E:\Shared\T378238.mxf" id="0" />
			</clip>
		</track>
	</group>
	<group type="audio" channels="2">
		<track>
			<clip srcref="15" start="0" stop="30.0633667" mstart="0" mstop="30.0633667">
				<quality src="E:\Shared\T378238.mxf" track="14" channels="0;_" id="0" />
			</clip>
		</track>
		<track>
			<clip srcref="16" start="0" stop="30.0633667" mstart="0" mstop="30.0633667">
				<quality src="E:\Shared\T378238.mxf" track="15" channels="_;0" id="0" />
			</clip>
		</track>
	</group>
</timeline>

Set Aspect Ratio

Name

SetAspect

Method

POST

URL

http://localhost:8123/Player/SetAspect?Aspect={arg}

Description

Set aspect ratio (see table below) for media target.

Usage
function SetAspectRatio(arg) {
  $.ajax({
        url: "http://localhost:8123/Player/SetAspect?Aspect=" + arg,
        type: "POST",
    });
}
Table AspectType Enum Type Members

Origin

Aspect4x3

Aspect16x9

Reset Player Control

Name

Clear

Method

POST

URL

http://localhost:8123/Player/Clear

Description

Reset target media and player presets.

Usage
function ResetPlayer() {
  $.ajax({
        url: "http://localhost:8123/Player/Clear",
        type: "POST",
    });
}

Timecode-based Methods

Get In Timecode

Name

In

Method

GET

URL

http://localhost:8123/Player/In

Response

Double

Description

Get initial media target timecode value.

Usage
function GetInTC() {
  var timecode = $.ajax({
        url: "http://localhost:8123/Player/In",
        type: "POST",
                    dataType: ‘json’,
                    success: onGetInSuccess,
                    cache: false,
                    crossDomain: true,
    });
    return timecode;
}
function onGetInSuccess(response) {
 console.log(response);
}

Set In Timecode

Name

SetIn

Method

POST

URL

http://localhost:8123/Player/SetIn?In={arg}

Description

Set initial media target timecode value.

Usage
function SetInTC(arg) {
  $.ajax({
        url: "http://localhost:8123/Player/SetIn?In=" + arg,
        type: "POST",
    });
}

Get Out Timecode

Name

Out

Method

GET

URL

http://localhost:8123/Player/Out

Response

Double

Description

Get last media target timecode value.

Usage
function GetInTC() {
  var timecode = $.ajax({
        url: "http://localhost:8123/Player/Out",
        type: "POST",
                    dataType: ‘json’,
                    success: onGetOutSuccess,
                    cache: false,
                    crossDomain: true,
    });
    return timecode;
}
function onGetInSuccess(response) {
 console.log(response);
}

Set Out Timecode

Name

SetOut

Method

POST

URL

http://localhost:8123/Player/SetOut?Out={arg}

Description

Set last media target timecode value.

Usage
function SetOutTC(arg) {
  $.ajax({
        url: "http://localhost:8123/Player/SetOut?Out=" + arg,
        type: "POST",
    });
}

Get Position Timecode

Name

Position

Method

GET

URL

http://localhost:8123/Player/Position

Response

Double

Description

Get playback media target timecode value.

Usage
function getPlaybackTC() {
    var timecode= $.ajax(
    {
        url: "http://localhost:8123/Player/Position",
        type: "GET",
        dataType: 'json',
        success: onGetPositionSuccess,
        cache: false,
        crossDomain: true,
    });
    return timecode;
}

function onGetPositionSuccess(response) {
 console.log(response);
}

Set Position Timecode

Name

SetPosition

Method

POST

URL

http://localhost:8123/Player/SetPosition?Pos={arg}

Description

Set playback media target timecode value.

Usage
function SetPositionTC(arg) {
  $.ajax({
        url: "http://localhost:8123/Player/SetPoisition?Pos=" + arg,
        type: "POST",
    });
}