This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:tvipjsapi:2 [2015/09/29 18:22] Alexi [int getCurrentVideoStreamIndex();] |
en:tvipjsapi:2 [2017/08/04 17:52] (current) Alexander [bool addMountPoint(int id, bool temp, int type, String name, Object options);] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | FIXME **This page is not fully translated, yet. Please help completing the translation.**\\ //(remove this paragraph once the translation is finished)// | + | |
====== TVIP JavaScript API #2 ====== | ====== TVIP JavaScript API #2 ====== | ||
Line 35: | Line 35: | ||
Add or change mount point with indicated //id//. | Add or change mount point with indicated //id//. | ||
- | If //temp// equal //true//, then mount point will be saved after device reload, if //false// - then mount point will be deleted after reload or application restart.The possible mount points types (//type//): 1 - SMB, 2 - NFS. Point name at mount system (for example, at pop-up message): //name//. Parameter //options// set specific options as object: | + | If //temp// equal //false//, then mount point will be saved after device reload, if //true// - then mount point will be deleted after reload or application restart.The possible mount points types (//type//): 1 - SMB, 2 - NFS. Point name at mount system (for example, at pop-up message): //name//. Parameter //options// set specific options as object: |
SMB: | SMB: | ||
Line 71: | Line 71: | ||
====String getCurrentTimezone();==== | ====String getCurrentTimezone();==== | ||
- | Return currently time zone (for example, //Europe/Moscow//). | + | Returns currently time zone (for example, //Europe/Moscow//). |
\\ \\ | \\ \\ | ||
Line 113: | Line 113: | ||
====String getEnvValue(String name);==== | ====String getEnvValue(String name);==== | ||
- | Get variable from the browser store. If //name// not found, empty string returns. | + | Gets variable from the browser store. If //name// not found, empty string returns. |
\\ \\ | \\ \\ | ||
Line 119: | Line 119: | ||
====String getMainMacAddress();==== | ====String getMainMacAddress();==== | ||
- | Returns main MAC address as string. Usually it's Ethernet interface mac. | + | Returns main MAC address as string. Usually it's Ethernet interface MAC. |
\\ \\ | \\ \\ | ||
Line 135: | Line 135: | ||
====List getSmbServers(String group);==== | ====List getSmbServers(String group);==== | ||
- | Perform servers search in specified //group// network group and returns NetBIOS server names \\ | + | Performs servers search in specified //group// network group and returns NetBIOS server names \\ |
Example: \\ | Example: \\ | ||
<code> | <code> | ||
Line 189: | Line 189: | ||
====void launchPreferences();==== | ====void launchPreferences();==== | ||
- | Launch system preferences Tvip. | + | Launches system preferences Tvip. |
\\ \\ | \\ \\ | ||
Line 196: | Line 196: | ||
====void logDebug(String message);==== | ====void logDebug(String message);==== | ||
- | Output debugging message to terminal(Linux) or logcat(Android). | + | Outputs debugging message to terminal(Linux) or logcat(Android). |
\\ \\ | \\ \\ | ||
Line 202: | Line 202: | ||
====void rebootSystem();==== | ====void rebootSystem();==== | ||
- | Reboot system. | + | Reboots system. |
\\ \\ | \\ \\ | ||
Line 209: | Line 209: | ||
====void removeMountPoint(int id);==== | ====void removeMountPoint(int id);==== | ||
- | Remove mount point from mount manager. //id// - Mount point identifier | + | Removes mount point from mount manager. //id// - Mount point identifier |
\\ \\ | \\ \\ | ||
Line 215: | Line 215: | ||
====void setColorKey(int color);==== | ====void setColorKey(int color);==== | ||
- | Setup UI color that could be consider as transparent for video layer. //color// in RGB model. | + | Setups UI color that could be consider as transparent for video layer. //color// in RGB model. |
\\ \\ | \\ \\ | ||
Line 221: | Line 221: | ||
====void setCustomHeader(String header, String value);==== | ====void setCustomHeader(String header, String value);==== | ||
- | Define HTTP-header for browser. | + | Defines HTTP-header for browser. |
//header// - header name, //value// - header value. If //value// is empty, previously defined header will be purged. | //header// - header name, //value// - header value. If //value// is empty, previously defined header will be purged. | ||
Line 229: | Line 229: | ||
====void setEnvValue(String name, String value);==== | ====void setEnvValue(String name, String value);==== | ||
- | Save variable in browsers persistent storage. All variables are available for all browser pages. | + | Saves variable in browsers persistent storage. All variables are available for all browser pages. |
\\ \\ | \\ \\ | ||
Line 235: | Line 235: | ||
====void setDirectoryListFilters(String filters);==== | ====void setDirectoryListFilters(String filters);==== | ||
- | Setup filename filter for getDirectoryFiles and getDirectoryDirs. **|** Will be count as delimiter. \\ | + | Setups filename filter for getDirectoryFiles and getDirectoryDirs. **|** Will be count as delimiter. \\ |
**?** and ***** applicable as well. \\ | **?** and ***** applicable as well. \\ | ||
e.g. | e.g. | ||
Line 270: | Line 270: | ||
====void setStandBy(bool enabled);==== | ====void setStandBy(bool enabled);==== | ||
- | Switch STB in sleep mode (//enabled//==true) or return it to operation mode (//enabled//==false). | + | Switches STB in sleep mode (//enabled//==true) or return it to operation mode (//enabled//==false). |
\\ \\ | \\ \\ | ||
Line 281: | Line 281: | ||
====void reset();==== | ====void reset();==== | ||
- | Reset settings: \\ transparent color; \\ HTTP-header; \\ file filter. | + | Resets settings: \\ transparent color; \\ HTTP-header; \\ file filter. |
\\ \\ | \\ \\ | ||
Line 289: | Line 289: | ||
====void reset();==== | ====void reset();==== | ||
- | Reset playback. If we don't need playback after page change this routine should be called. | + | Resets playback. If we don't need playback after page change this routine should be called. |
\\ \\ | \\ \\ | ||
Line 336: | Line 336: | ||
====void unpause();==== | ====void unpause();==== | ||
- | Continue playback. | + | Continues playback. |
\\ \\ | \\ \\ | ||
Line 342: | Line 342: | ||
====void seek(int position);==== | ====void seek(int position);==== | ||
- | Set playback //position// in milliseconds. Keep in mind that beginning of playback is minPosition see below | + | Sets playback //position// in milliseconds. Keep in mind that beginning of playback is minPosition see below |
\\ \\ | \\ \\ | ||
Line 427: | Line 427: | ||
==== int getCurrentAudioStreamIndex(); ==== | ==== int getCurrentAudioStreamIndex(); ==== | ||
- | Возвращает номер потока с аудио-дорожкой, проигрываемой в данный момент. | + | Returns currently played audio stream index. |
Line 434: | Line 434: | ||
==== void setCurrentAudioStreamIndex(int index); ==== | ==== void setCurrentAudioStreamIndex(int index); ==== | ||
- | Устанавливает номер активной аудио-дорожки (//index//). | + | Sets active audio stream (//index//). |
\\ \\ | \\ \\ | ||
Line 440: | Line 440: | ||
==== void setAspectRatio (String ratio) === | ==== void setAspectRatio (String ratio) === | ||
- | Устанавливает режим aspect ratio. На данный момент поддерживаются значения: "box" - Оригинал, "full" - На весь экран, "zoom" - Увеличенный. | + | Sets aspect ratio. \\ |
+ | Available values: \\ | ||
+ | "box" - Original \\ | ||
+ | "full" - Full screen \\ | ||
+ | "zoom" - Zoomed. | ||
\\ \\ | \\ \\ | ||
Line 448: | Line 451: | ||
==== String addRecord(String name, String url, String path, String start, String end); ==== | ==== String addRecord(String name, String url, String path, String start, String end); ==== | ||
- | Добавляет новое задание на запись эфира. \\ Здесь: //name// - произвольное имя записи, //url// - URL потока (поддерживаются потоки в формате MPEGTS через UDP, RTP и HTTP, //path// - локальный путь для записи, //start// и //end// - время начала и окончания записи в UNIX TIMESTAMP либо в формате "YYYYMMDDTHHmmss".\\ | + | Adds new record job. \\ |
- | Возвращает уникальный идентификатор созданного задания. | + | Here: \\ |
+ | //name// - record name, \\ | ||
+ | //url// - stream URL (MPEGTS via UDP, RTP, HTTP are supported.) \\ | ||
+ | //path// - Local path to record, \\ | ||
+ | //start// и //end// - start/stop time in UNIX TIMESTAMP or "YYYYMMDDTHHmmss" format.\\ | ||
+ | Returns unique record job id. | ||
\\ \\ | \\ \\ | ||
==== bool cancelRecord(String id, bool removeFile); ==== | ==== bool cancelRecord(String id, bool removeFile); ==== | ||
- | Удаляет задание на запись с уникальным идентификатором //id//. Если //removeFile=true//, удаляется также записанный на диск поток. Возвращает //true// в случае успешного удаления. | + | Removes record job by //id//. If //removeFile=true//, stream stored to storage also will be removed. \\ |
+ | Returns //true// in success. | ||
\\ \\ | \\ \\ | ||
==== void updateStartEndTime(String id, String start, String end); ==== | ==== void updateStartEndTime(String id, String start, String end); ==== | ||
- | Меняет время начала и/или окончания записи с уникальным идентификатором //id//. Если требуется поменять только одно из значений, то второе - пустая строка. Формат //start// и //end// см. в описании addRecord. | + | Updates start time or(and) end time of recording //id//. If we need to set only one parameter leave second one empty. \\ |
+ | Fromat for //start// //end// see at addRecord | ||
\\ \\ | \\ \\ | ||
Line 468: | Line 477: | ||
==== List getRecordIds(); ==== | ==== List getRecordIds(); ==== | ||
- | Возвращает список уникальных идентификаторов заданий, которые добавлены в настоящий момент. | + | Returns currently added jobs list. |
\\ \\ | \\ \\ | ||
Line 475: | Line 484: | ||
==== Object getRecord(id); ==== | ==== Object getRecord(id); ==== | ||
- | Возвращает объект с параметрами записи с уникальным идентификатором //id//. | + | Returns object (by //id//) with record parameters. |
<code> | <code> | ||
Line 488: | Line 497: | ||
</code> | </code> | ||
- | Здесь: <id>, <name>, <start>, <end> - соответствуют параметром метода addRecord; <status> - статус записи: //"waiting"// - ожидает запись, //"recording"// - запись в процессе, //"finished"// - запись завершена, //"error"// - произошла ошибка. | + | Here: \\ <id>, <name>, <start>, <end> - corresponds with addRecord routine parameter; \\ <status> - record status: \\ //"waiting"// - waiting for record, \\ //"recording"// - record in progress, \\ //"finished"// - record finished, \\ //"error"// - error occurred. |
\\ \\ | \\ \\ | ||