0
edits
Changes
→Incoming commands
<tt>'''HELLOBG'''</tt>
Used as a part of "handshake" procedure between client and TS Engine.
This commend must be sent by client right after establishing tcp-connection with TS Engine.
Соединение с TS Engine считается успешным после того, как клиент получил от TS Engine ответ на "рукопожатие" - команду HELLOTS
<tt>'''READY'''</tt>
Informs TS Engine that client is ready to receive outgoing commands
'''LOADASYNC''' <request_id> '''RAW''' <torrent_data> <developer_id> <affiliate_id> <zone_id></tt>
These commands perform loading torrent-file's content. They are used to allow client to get a list of files' names in file of interest. LOAD commands are performed synchronously, LOADASYNC commands - asynchronously (response comes in outgoing command LOADRESP).
Preferred method is asynchronous loading.
'''ПараметрыParameters:'''
<tt>'''request_id'''</tt> - случайное целое число - идентификатор запроса LOADASYNC; этот же идентификатор будет отослан клиенту в команде LOADRESP после того,как будет получен список файлов; данный идентификатор служит для того, чтобы клиент в случае отправки нескольких запросов LOAD точно знал, на какой из этих запросов получен ответ
Данные команды используются для начала загрузки определенного файла из торрент-файла либо для начала загрузки файла по прямой ссылке (START URL)
'''ПараметрыParameters:'''
<tt>'''file_indexes'''</tt> - a list of file's indexes from torrent file, which have to be loaded. Client receives file's indexes in a LOADRESP message, separated by commas. Indexes start with zero and match a list of files that was received by LOAD command. For example, if there is only one video file in torrent file, then 0 index has to be sent.
If there are 5 video files in torrent and playback has to start from the first one, but others have to be loaded, then 0,1,2,3,4 have to be sent.
If the third file has to be played, without loading others, 2 has to be sent.
<tt>'''torrent_url'''</tt> - ссылкаlink наto торрентtorrent файлfile (напримерfor example, http://sometracker.com/torrent/12345)
<tt>'''torrent_infohash'''</tt> - infohashtorrent's торрентаinfohash
<tt>'''player_id'''</tt> - кодplayer's плеераcode
<tt>'''torrent_data'''</tt> - содержимое торрентtorrent-файлаfile's content, вencoded кодировкеin base64
<tt>'''direct_url'''</tt> - прямаяdirect ссылкаlink наto файлfile (напримерfor example, http://somesite.com/files/video.mp4)
<tt>'''developer_id'''</tt> - кодdeveloper's разработчикаcode (еслиif неизвестноunknown, необходимо0 передаватьmust 0be sent)
<tt>'''affiliate_id'''</tt> - кодpartner's партнераcode (еслиif неизвестноunknown, необходимо0 передаватьmust 0be sent)
<tt>'''zone_id'''</tt> - кодcode зоныof партнераpartner's zone (еслиif неизвестноunknown, необходимо0 передаватьmust 0be sent)
<tt>'''GETPID''' <infohash> <developer_id> <affiliate_id> <zone_id></tt>
Getting code of the player through a set of parameters. This command is a synchronous command (see below). In response player's code or empty string (if player's code can't be received) is sent.
<tt>'''SHUTDOWN'''</tt>
Close connection with client.
<tt>'''STOP'''</tt>
Stop loading file that is being loaded at this moment.
<tt>'''DUR''' <video_url> <duration></tt>
Inform TS Engine about duration of video file that is being played by client at this moment. This command must be sent right after client had determined content duration.
'''ПараметрыParameters:'''
<tt>'''video_url'''</tt> - ссылкаlink наto видеоvideo, котораяwhich былаwas отправленаsent клиентуto послеclient окончанияafter пребуферизацииthe end of pre-buffering
<tt>'''duration'''</tt> - длительностьduration вin миллисекундахmilliseconds
<tt>'''PLAYBACK''' <video_url> <event></tt>
Inform TS Engine about percentage of played video
This command is especially important when playing advertising video - transition to the main video happens only after TS Engine gets command PLAYBACK 100 (after client has played advertising video till the end)
'''ПараметрыParameters:'''
<tt>'''video_url'''</tt> - ссылкаlink наto видеоvideo, котораяwhich былаwas отправленаsent клиентуto послеclient окончанияafter пребуферизацииthe end of pre-buffering
<tt>'''event'''</tt> - одноone изof данныхthese событийevents:
0 - starting playback
25 - 25% of video has been played
50 - 50% of video has been played
75 - 75% of video has been played
100 - проиграно 100% видеоof video has been played
== Исходящие команды ==