Frontend Service

From MythTV Official Wiki
Revision as of 03:59, 15 November 2012 by George Nassas (talk | contribs) (Add PlayRecording & PlayVideo)

Jump to: navigation, search

Important.png Note: Unlike other services, the Frontend Service runs on frontend systems. The default Frontend Service API port is 6547.

Frontend Service API List

API Command POST Required? Description
GetStatus No Get the location, playback status, and a variety of other information about the current state of the Frontend.
SendMessage No Send a message to the frontend, which will appear as a popup message on the screen.
SendAction No Send an action such as UP, DOWN, SELECT, etc. to the frontend.
GetActionList No Get a list of actions which can be performed on the frontend using SendAction.
PlayRecording No Play a television recording.
PlayVideo No Play a video.

Frontend APIs

GetStatus

The GetStatus API takes no arguments.

Example Query:

http://FrontendIP:6547/Frontend/GetStatus

Example Return:

<FrontendStatus version="1.0" serializerVersion="1.1">
    <State>
        <String key="behindtime"/>
        <String key="chanid">34750</String>
        <String key="chapteridx">1</String>
        <String key="description">0:25:25 of 1:02:25</String>
        <String key="playedtime">0:25:25</String>
        <String key="position">407</String>
        <String key="progafter">0</String>
        <String key="progbefore">0</String>
        <String key="programid">EP012968460038</String>
        <String key="remainingtime">37:00</String>
        <String key="starttime">2011-11-14T17:59:00</String>
        <String key="state">WatchingPreRecorded</String>
        <String key="subtitle">Free Rick</String>
        <String key="title">American Chopper: Senior vs. Junior</String>
        <String key="titleidx">1</String>
        <String key="totaltime">1:02:25</String>
    </State>
</FrontendStatus>

SendMessage

The SendMessage API takes the following arguments:

Message (Required)
Parameter Type: String
The message to appear on the frontend popup.

Example Query:

http://FrontendIP:6547/Frontend/SendMessage?Message=Hello World!

Example Return:

Boolean return. Returns true if the message was sent, false if the message failed.

<bool>true</bool>


SendAction

The SendAction API takes the following arguments:

Action (Required)
Parameter Type: String
The action name to be sent to the frontend.
File (Required)
Parameter Type: String
The filename output where relevant (currently only used for the SCREENSHOT action).
Width (Required)
Parameter Type: Integer
The width of the output where relevant (currently only used for the SCREENSHOT action).
Height (Required)
Parameter Type: Integer
The height of the output where relevant (currently only used for the SCREENSHOT action).

Example Query:

http://FrontendIP:6547/Frontend/SendAction?Action=SELECT

Example Return:

Boolean return. Returns true if the action was accepted, false if the action failed.

<bool>true</bool>


GetActionList

The GetActionList API takes no arguments.

Example Query:

http://FrontendIP:6547/Frontend/GetActionList

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<FrontendActionList version="1.0" serializerVersion="1.1">
    <ActionList>
        <Action key="0">0</Action>
        <Action key="1">1</Action>
        <Action key="2">2</Action>
        <Action key="3">3</Action>
        <Action key="4">4</Action>
        <Action key="5">5</Action>
        <Action key="6">6</Action>
        <Action key="7">7</Action>
        <Action key="8">8</Action>
        <Action key="9">9</Action>
        <Action key="ADJUSTSTRETCH">Turn on time stretch control</Action>
        <Action key="ARBSEEK">Arbitrary Seek</Action>
        <Action key="BACK">Exit or return to DVD menu</Action>
        <Action key="BACKSPACE">Backspace</Action>
        <Action key="BIGJUMPFWD">Jump forward 10x the normal amount</Action>
        <Action key="BIGJUMPREW">Jump back 10x the normal amount</Action>
        <Action key="BLANKSCR">Blank screen</Action>
        <Action key="BOTTOMLIST">Move to bottom of list</Action>
        <Action key="BROWSE">Change browsable in video manager</Action>
        <Action key="Burn DVD">Burn DVD</Action>
        <Action key="CANCEL">Cancel news item updating</Action>
        <Action key="CHANGEGROUPVIEW">Change Group View</Action>
        <Action key="CHANGERECGROUP">Change Recording Group</Action>
        <Action key="CHANNELDOWN">Channel down</Action>
        <Action key="CHANNELUP">Channel up</Action>
        <Action key="CHANUPDATE">Switch channels without exiting guide in Live TV mode.</Action>
        <Action key="CLEARMAP">Clear editing cut points</Action>
        <Action key="CLEAROSD">Clear OSD</Action>
        <Action key="COPY">Copy text from textedit</Action>
    </ActionList>
<FrontendActionList>


PlayRecording

The PlayRecording API takes the following arguments:

ChanId (Required)
Parameter Type: Integer
The database channel id for the recording.
StartTime (Required)
Parameter Type: String
The recording start time for the item. This should be in MySQL ISO format, eg: 2011-08-29 18:59:00. You can replace the space with %20 or T.

Example Query:

http://FrontendIP:6547/Frontend/PlayRecording?ChanId=34736&StartTime=2011-09-26T19:00:00

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<bool>true</bool>


PlayVideo

The PlayVideo API takes the following arguments:

Id (Required)
Parameter Type: String
The database id for the video file.
UseBookmark (Optional)
Parameter Type: Boolean
Pass 1 to resume playback at a bookmark.

Example Query:

http://FrontendIP:6547/Frontend/PlayVideo?Id=73&UseBookmark=1

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<bool>true</bool>