How can we improve Zappiti API ?

Player API (during actual playback) for better smarthome integration support

Zappiti API extension

Queries
1. Extend respond of status: add play, queue, power tag:
Get status
http://your-player-ip:8990/zpt?q=status

Respond:
<zpt:query xmlns:zpt="http://your-player-ip:8990&quot; zpt:count="" zpt:created="time:date" zpt:version=".">
<results>
<play status=””>
<type></type>
<url></url>
<position current=”” total=”” />
<title current=”” total=”” />
<chapter current=”” total=”” start=”” end=”” />
<position current=”” total=”” />
</play>
<queue>
<total></total>
<current></current>
<mode></mode>
</queue>
<power status=”” />
</results>
</zpt:query>

play section:
status is none (nothing playing) | pause | play
type is audio|video|picture
url - see command start_playing
position:
current returns position in seconds. If content contain title/chapter information, position is current time on title. For type=pictures nothing returns
total returns total time of content in seconds. If title/chapter information is available, returns а total time of title.
chapter:
current is a current chapter number on title
total is a number of chapters on title
start is a time of chapter’s begin on title (in seconds)
end is a time of chapter’s end on title (in seconds)
title:
current is a current title number
total is a number of titles on content

If nothing playing, nested tags of play is not present.
If the information on the titles/chapters is not available, title/chapter tag is not present.

queue section:
total - total count of queue
current - current position on queue list
mode - mode of queue normal | repeatall | repeatonce | shuffle

power section:
status is on|sleep|off

2. Get play infos
http://your-player-ip:8990/zpt?q=play_info

Respond:
<zpt:query xmlns:zpt="http://your-player-ip:8990&quot; zpt:count="" zpt:created="time:date" zpt:version=".">
<results>
<type>audio|video|picture</type>

<!-- for audio type show ID3 tags -->
<!-- for picture type show EXIF tags -->

<!-- for video type -->
<audios>
<track id=0 title=”Russian” selected=”yes”>
<name>MKV - Track Name</name>
<lang>MKV/M2TS/M2TS-3DISO - Language</lang>
<format>AC3|EAC3|DTS|DTS-HD|TrueHD</format>
<channels>1.0|2.0|5.1|7.2</channels>
<bitrate>192/256/384</bitrate>
</track>

<track id=6 title=”Maguar” selected=”no” />
</audios>

<subs>
<subtitle id=0 title=”Russian” selected=”yes”>
<name>MKV - Subtitle name</name>
<lang>MKV/M2TS/M2TS-3DISO - Subtitle language</lang>
</subtitle>

<subtitle id=6 title=”Japan” selected=”no”/>
</subs>
<chapters>
<!-- see below -->
</chapters>
</results>
</zpt:query>

Chapters information if present on content, shows on http://chapterdb.org/Home/Download/18?type=xml format

If content contain title information, tags audios, subs, chapters wrap in title tag
title tag attributes:
id - index number of title
name of title
duration of title in seconds
chaptercount - a number of chapters on title

3. Get volume level
http://your-player-ip:8990/zpt?q=volume

Respond:
<zpt:query xmlns:zpt="http://your-player-ip:8990&quot; zpt:count="" zpt:created="time:date" zpt:version=".">
<results>
<volume level=”%d” mute=”%s” />
</results>
</zpt:query>

level is 0-31
mute is on|off

4. Get 3D status
http://your-player-ip:8990/zpt?q=video3d

Respond:
<zpt:query xmlns:zpt="http://your-player-ip:8990&quot; zpt:count="" zpt:created="time:date" zpt:version=".">
<results>
<video3d avaiable=”yes|no” state=”on|off” />
</results>
</zpt:query>

5. Get queue list
http://your-player-ip:8990/zpt?q=queue

Respond:
<zpt:query xmlns:zpt="http://your-player-ip:8990&quot; zpt:count="" zpt:created="time:date" zpt:version=".">
<results>
<queue mode=”” current=””>
<item id=”” type=””>
<url></url>
<options></options>
</item>

</queue>
</results>
</zpt:query>

queue mode is audio|video|picture
queue current is id of current list item

item type, url, options see below in start_playing

Commands
6. Start playing
http://your-player-ip:8990/zpt?cmd=start_playing&type=%s&url=%s[&options=%s]
type is audio|video|picture
url is a urlencoded link to a content:
- path to local file (maybe file://<path>)
- http link (e.g. http://server/path/file.avi or http://user:passwd@server/path/file.avi )
- smb:// or nfs:// share and path on this share, divided tab symbol
examples:
smb://server/share /path/file.avi
nfs://share /path/file.avi

for Samba and nfs protocols can define additional mount options in options parameter
About parameters see nfs and cifs manuals.

7. Stop playing
http://your-player-ip:8990/zpt?cmd=stop_playing

8. Play positioning
http://your-player-ip:8990/zpt?cmd=pos_playing&position=%d
position attribute in second

9. Set audio track
http://your-player-ip:8990/zpt?cmd=audio_track&track_id=%d

Id - see video_info

10. Set subtitles
http://your-player-ip:8990/zpt?cmd=subtitle&sub_id=%s
Id - see video_info or “off”

11. Set volume level
http://your-player-ip:8990/zpt?cmd=volume&level=%s
Level is 0-31 or “off” (mute) or “on”

12. Goes to chapter
http://your-player-ip:8990/zpt?cmd=chapter&chapter_no=%d
chapter_no - ordinal number - chapterAtom from the list (see video_info). Numbering begins on one (not zero)!

13. Set 3D status
http://your-player-ip:8990/zpt?cmd=video3d&state3d=on|off

14. Set power status
http://your-player-ip:8990/zpt?cmd=power&state=on|sleep|off

Queue commands:
15. Clear queue
http://your-player-ip:8990/zpt?cmd=queue_clear

16. Add queue item
http://your-player-ip:8990/zpt?cmd=queue_add&type=%s&url=%s[&options=%s]

17. Insert queue item before id
http://your-player-ip:8990/zpt?cmd=queue_add&id=%n&type=%s&url=%s[&options=%s]

18. Remove queue item
http://your-player-ip:8990/zpt?cmd=queue_remove&id=%n

19. Play queue item
http://your-player-ip:8990/zpt?cmd=queue_play&id=%n

id is <number>|next|prev
if id is not set - play current item

20. Set queue mode
http://your-player-ip:8990/zpt?cmd=queue_set&mode

mode is normal|repeatall|repeatonce|shuffle

3 votes
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)

We’ll send you updates on this idea

Vyacheslav Belov shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base