0
edits
Changes
→Исходящие команды
100 - 100% of video has been played
== Outgoing commands ==
<tt>'''HELLOTS'''</tt>
response command as a part of handshake procedure
<tt>'''AUTH''' <auth_level></tt>
User's access level
<tt>auth_level</tt> - целое числоinteger - уровеньaccess доступаlevel
At this moment two values of access level are available:
0 - advanced features are not available for user (rewind and playback of torrent files with several video files)
1 - advanced features are available for user
<tt>'''STATE''' <state_id></tt>
Information about current state of TS Engine
<tt>'''SHUTDOWN'''</tt>
TS Engine завершилfinished работуits work
<tt>'''PLAYADI''' <video_url></tt>
<tt>'''PLAY'''</tt> - проигрываниеplayback основногоof видеоthe main video
<tt>'''PLAYAD'''</tt> - playback of uninterrupted advertising video (user can't rewind or skip this advertising video)
<tt>'''PLAYADI'''</tt> - playback of interrupted advertising video (user can rewind or skip this advertising video)
<tt>'''PAUSE'''</tt>
TS Engine began buffering, because there's not enough data for video playback without interruptions
<tt>'''RESUME'''</tt>
TS Engine завершилfinished буферизациюbuffering
<tt>'''LOADRESP''' <request_id> <response></tt>
Response to LOAD command
<tt>'''request_id'''</tt> - идентификаторrequest запросаidentifier
<tt>'''response'''</tt> - списокa файловlist вof форматеfiles in json вformat in такогоthis видаform:
{
"status": 1,
}
<tt>'''status'''</tt> - 0: вthere торрентеare нетno видеоvideo файловfiles in torrent, 1 - вthere торрентеis одинone видеоvideo файлfile in torrent, 2 - вthere are more than торрентеone болееvideo одногоfiles видеоin файлаtorrent
<tt>'''infohash'''</tt> - infohashtorrent торрентаinfohash
<tt>'''files'''</tt> - a list of files; this is an array, each element of which consists of an array with two elements: the first - file's name, the second - file's position in torrent (this position must be sent inside START command to specify which file to download, if there are several of them).
<tt>'''INFO''' <message_id>;<message_text></tt>
Info message
<tt>'''message_id'''</tt> - кодmessage сообщенияcode
<tt>'''message_text'''</tt> - текстmessage сообщенияtext
<tt>'''STATUS''' <status_string></tt>
This message is sent periodically to inform client about current state of content download.
<tt>'''status_string'''</tt> - строкаstring описанногоin нижеformat форматаdescribed below
If the main content is being played:
<tt>STATUS main:status_string</tt>
If advertising video is being played:
<tt>STATUS main:status_string|ad:status_string</tt>
<tt>'''status_string:'''</tt>
TS Engine ничегоdoes не делаетnothing - <tt>'''idle'''</tt>
<tt>total_progress;immediate_progress;speed_down;http_speed_down;speed_up;peers;http_peers;downloaded;http_downloaded;uploaded</tt>
<tt>'''total_progress'''</tt> - сколькоhow всегоmuch закачаноof поthis данномуfile файлуis downloaded
<tt>'''immediate_progress'''</tt> - how much uninterruptible data is downloaded starting from the current position (to show amount of downloaded data)
'''ПримерыExamples:'''
<tt>STATUS main:prebuf;45;30|ad:buf;69
STATUS main:dl|ad:dl</tt>
'''Example of tranformation statuses into text messages that user can understand:'''
<tt>check - Checking xx%
buf - Buffering xx%
wait - Waiting sufficient download speed
err - showing an error message
dl, idle - ничегоdoing не выводимnothing</tt>
== Events ==