Difference between revisions of "WebPlugin"

From Ace Stream Wiki
Jump to: navigation, search
(Новая страница: «==Embed tag attributes== To embed the plugin into a webpage use the following <embed> template: <tt><embed type="application/x-acestream-plugin" /> <object classid…»)
 
(Примеры)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==Embed tag attributes==
+
==Атрибуты тега embed==
To embed the plugin into a webpage use the following <embed> template:
+
Чтобы встроить плагин в веб-страничку, используйте следующий шаблон <embed>:
 
  <tt><embed type="application/x-acestream-plugin" />
 
  <tt><embed type="application/x-acestream-plugin" />
 
  <object classid="clsid:79690976-ED6E-403c-BBBA-F8928B5EDE17"></object></tt>
 
  <object classid="clsid:79690976-ED6E-403c-BBBA-F8928B5EDE17"></object></tt>
  
===Required elements===
+
===Обязательные элементы===
*'''width''': Specifies the width of the plugin.  
+
*'''width''': Задает ширину плагина.  
*'''height''': Specifies the height of the plugin.
+
*'''height''': Задает высоту плагина.
  
===Optional elements===
+
===Необязательные элементы===
*'''bgcolor''' (string): Specifies the background color of the video player. Default: ''#000000''
+
*'''bgcolor''' (string): Задает цвет фона видеоплеера. По умолчанию: ''#000000''
*'''fontcolor''' (string): Specifies the font color. Default: ''#FFFFFF''
+
*'''fontcolor''' (string): Задает цвет шрифта. По умолчанию: ''#FFFFFF''
*'''videobgcolor''' (string): Specifies the background color of the video player when playing video. Default: ''#000000''
+
*'''videobgcolor''' (string): Задает цвет фона видеоплеера при проигрывании видео. По умолчанию: ''#000000''
*'''fscontrolsenable''' (bool): Specifies whether controls are enabled in the fullscreen. Default: ''true''
+
*'''fscontrolsenable''' (bool): Указывает включена ли панель управление в полноэкранном режиме. По умолчанию: ''true''
*'''nofscontrolsenable''' (bool): Specifies whether controls are enabled. Default: ''false''
+
*'''nofscontrolsenable''' (bool): Указывает включена ли панель управления. По умолчанию: ''false''
*'''loopable ''' (bool): Specifies whether the video loops on end. Default: ''false''
+
*'''loopable ''' (bool): Указывает повторяется ли видео после окончания. По умолчанию: ''false''
*'''fscontrols''' (bool): Specifies the theme for the fullscreen controls. Default: ''default''
+
*'''fscontrols''' (string): Задает стиль панели управления в полноэкранном режиме. По умолчанию: ''default''
*'''nofscontrols''' (bool): Specifies the theme for the controls. Default: ''default''
+
*'''nofscontrols''' (string): Задает стиль панели управления. По умолчанию: ''default''
*'''nofscontrolsheight''' (integer): Specifies the height of the toolbar in pixels. Default: ''36''
+
*'''nofscontrolsheight''' (integer): Задает высоту панели управления в пикселях. По умолчанию: ''36''
  
 
==Javascript API==
 
==Javascript API==
Some description
+
Некоторое описание
  
===Common read only properties===
+
===Общие свойства только для чтения===
*'''version''' (string): plugin's version
+
*'''version''' (string): версия плагина
*'''auth''' (integer): user access level
+
*'''auth''' (integer): уровень доступа пользователя
*'''info''' (string): info string
+
*'''info''' (string): информационная строка
*'''status''' (string): status string
+
*'''status''' (string): строка статуса
*'''error''' (string): error string
+
*'''error''' (string): строка ошибки
*'''state''' (integer): the engine's state (0 - idle, 1 - prebuffering, 2 - downloading, 3 - buffering)
+
*'''state''' (integer): состояние движка (0 - бездействующий, 1 - пребуферизация, 2 - скачивание, 3 - буферизация, 4 - завершено, 5 - проверка скачивания, 6 - ошибка, 7 - плагин подключается к движку, 8 - производится загрузка плейлиста)
  
===Playlist===
+
===Плейлист===
read only properties
+
свойства только для чтения
*'''playlistCount''' (integer): number of items in the playlist
+
*'''playlistCount''' (integer): количество пунктов в плейлисте
*'''playlistIsPlaying''' (bool): true if the current playlist item is playing
+
*'''playlistIsPlaying''' (bool): true, если данный пункт плейлиста проигрывается
*'''playlistCurrentItem''' (integer): zero-based index of the current playlist item
+
*'''playlistCurrentItem''' (integer): индекс с нуля данного пункта плейлиста
  
methods
+
методы
*'''void playlistAdd(string mrl, string name = "")''': add a playlist item as MRL
+
*'''void playlistAdd(string mrl, string name = "")''': добавить пункт плейлиста как MRL
*'''void playlistPlay(int position = 0)''': start playing the current playlist item
+
*'''void playlistPlay(int position = 0)''': начать проигрывание данного пункта плейлиста
*'''void playlistPlayItem(int index, intposition = 0, bool stop_current = true)''': start playing the item whose identifier is "index"
+
*'''void playlistPlayItem(int index, intposition = 0, bool stop_current = true)''': начать проигрывание пункта с идентификатором "index"
*'''void playlistTogglePause()''': toggle the pause state for the current playlist item
+
*'''void playlistTogglePause()''': переключать состояние паузы для данного пункта плейлиста
*'''void playlistStop(bool fullstop=false)''': stop playing the current playlist item. If fullstop is true then plugin tells engine to stop downloading item.
+
*'''void playlistStop(bool fullstop=false)''': остановить проигрывание данного пункта плейлиста. Если fullstop равен true, то плагин сообщает движку остановить загрузку данного пункта
*'''void playlistNext()''': iterate to the next playlist item
+
*'''void playlistNext()''': перейти к следующему пункту плейлиста
*'''void playlistPrev()''': iterate to the previous playlist item
+
*'''void playlistPrev()''': перейти к предыдущему пункту плейлиста
*'''void playlistClear()''': empty the current playlist, all items will be deleted from the playlist
+
*'''void playlistClear()''': очистить данный плейлист (все пункты будут удалены из плейлиста)
*'''void playlistRemoveItem(int index)''': remove the item from playlist whose identifier is "index"
+
*'''void playlistRemoveItem(int index)''': удалить из плейлиста пункт с идентификатором "index"
*'''string playlistItemTitle(int index)''': get the title of the specified item
+
*'''string playlistItemTitle(int index)''': получить название указанного пункта
*'''string playlistItemInfohash(int index)''': get the infohash of the specified item
+
*'''string playlistItemInfohash(int index)''': получить инфо-хеш указанного пункта
*'''int playlistItemState(int index)''': get the state of the specified item (0 - disabled, 1 - enabled)
+
*'''int playlistItemState(int index)''': получить состояние указанного пункта (0 - отключен, 1 - включен)
*'''bool playlistItemIsSaveable(int index)''': check whether the specified item can be saved on the disk
+
*'''bool playlistItemIsSaveable(int index)''': проверить можно ли сохранить указанный пункт на диск
*'''void playlistItemSave(int index)''': save the specified item on the disk (a dialog will be shown to choose destination)
+
*'''void playlistItemSave(int index)''': сохранить указанный пункт на диск (будет показан диалог для выбора места, куда сохранить)
*'''void playlistSetItemState(int index, bool active)''': set item state (enabled/disabled)
+
*'''void playlistSetItemState(int index, bool active)''': установить состояние пункта (включен/отключен)
*'''void playlistToggleItemState(int index)''': toggle item state
+
*'''void playlistToggleItemState(int index)''': переключить состояние пункта
*'''void playlistMoveItem(int indexfrom, int indexto)''': move the item to another position in the playlist
+
*'''void playlistMoveItem(int indexfrom, int indexto)''': передвинуть пункт на другую позицию плейлиста
*'''void playlistSelectAll()''': enable all items in the playlist
+
*'''void playlistSelectAll()''': включить все пункты плейлиста
*'''void playlistSelectNone()''': disable all items in the playlist
+
*'''void playlistSelectNone()''': отключить все пункты плейлиста
*these methods are used to load playlist from the specified source:
+
*эти методы используются для загрузки плейлиста из указанного источника:
**'''string playlistLoad(string torrentUrl, int developerId, int affiliateId, int zoneId)''': load from the torrent specified by ''torrentUrl''
+
**'''string playlistLoad(string torrentUrl, int developerId, int affiliateId, int zoneId)''': загрузить из торрента, указанного ''torrentUrl''
**'''string playlistLoadInfohash(string infohash, int developerId, int affiliateId, int zoneId)''': load by infohash
+
**'''string playlistLoadInfohash(string infohash, int developerId, int affiliateId, int zoneId)''': загрузить через инфо-хеш
**'''string playlistLoadPlayer(string contentId)''': load by content id
+
**'''string playlistLoadPlayer(string contentId)''': загрузить через content id (идентификатор контента)
**'''string playlistLoadRaw(string torrentData, int developerId, int affiliateId, int zoneId)''': load from raw torrent data (the contents of a torrent file encoded as base64)
+
**'''string playlistLoadRaw(string torrentData, int developerId, int affiliateId, int zoneId)''': загрузить из необработанных данных торрента (содержимое торрент-файла закодировано в base64)
:each method returns a string containing the list of items in json format
+
:каждый метод возвращает строку, содержащую список пунктов в формате json
:''developerId'', ''affiliateId'' and ''zoneId'' parameters should be set to ''0'' if you don't known what to do with them
+
:параметры ''developerId'', ''affiliateId'' и ''zoneId'' должны быть установлены на ''0'', если вы не знаете, что с ними делать
  
*these methods are the same as previous except they are executed asynchronously and return immediatelly:
+
*эти методы такие же, как предыдущие, кроме того, что они  выполняются асинхронно и возвращаются мгновенно:
 
**'''void playlistLoadAsync(string torrentUrl, int developerId, int affiliateId, int zoneId)'''
 
**'''void playlistLoadAsync(string torrentUrl, int developerId, int affiliateId, int zoneId)'''
 
**'''void playlistLoadAsyncInfohash(string infohash, int developerId, int affiliateId, int zoneId)'''
 
**'''void playlistLoadAsyncInfohash(string infohash, int developerId, int affiliateId, int zoneId)'''
Line 70: Line 70:
 
**'''void playlistLoadAsyncRaw(string torrentData, int developerId, int affiliateId, int zoneId)'''
 
**'''void playlistLoadAsyncRaw(string torrentData, int developerId, int affiliateId, int zoneId)'''
  
*'''void playlistLoadUrl(string url, int developerId, int affiliateId, int zoneId, string name, bool clear_playlist = false)''': add an url to the playlist. This url will be used by engine to retrieve the content. ''name'' parameter is used to set the item title in the playlist. If ''clear_playlist'' is true then the playlist will be cleared before the new item is added
+
*'''void playlistLoadUrl(string url, int developerId, int affiliateId, int zoneId, string name, bool clear_playlist = false)''': добавить url в плейлист. Этот url будет использоваться движком для извлечения контента. Параметр ''name'' используется, чтобы задать название пункта в плейлисте. Если ''clear_playlist'' равен true, то плейлист будет очищен перед добавлением нового пункта
  
*'''string playlistGetPlayerId(string infohash, int developerId, int affiliateId, int zoneId)''': get the content id for the given infohash, developer, affiliate and zone ids
+
*'''string playlistGetPlayerId(string infohash, int developerId, int affiliateId, int zoneId)''': получить content id для заданных infohash, developer, affiliate и zone идентификаторов
  
===Audio===
+
===Аудио===
read only properties
+
свойства только для чтения
*'''audioCount''' (integer): the number of audio track available
+
*'''audioCount''' (integer): количества доступных аудио дорожек
  
read/write properties
+
свойства для чтение/писания
*'''audioMute''' (bool): boolean value to mute and unmute the audio
+
*'''audioMute''' (bool): логическое значение для отключения или включения звука
*'''audioVolume''' (interger): a value between 0 and 100 which indicates a percentage of the volume
+
*'''audioVolume''' (interger): значение между 0 и 100, указывающее процент громкости
*'''audioTrack''' (integer): a value between 1 and plugin.audioCount which indicates the audio track to play or that is playing. a value of 0 means the audio is/will be disabled
+
*'''audioTrack''' (integer): значение между 1 и plugin.audioCount, указывающее аудио дорожку для проигрывания или которая уже проигрывается. Значение равное 0 означает, что аудио отключено или  будет отключено
*'''audioChannel''' (integer): integer value between 1 and 5 that indicates which audio channel mode is used, values can be: "1=stereo", "2=reverse stereo", "3=left", "4=right", "5=dolby". Use plugin.audioChannel to check if setting of the audio channel mode has succeeded
+
*'''audioChannel''' (integer): целое значение между 1 и 5, указывающее, какой режим аудио канала используется, значение могут быть: "1=stereo", "2=reverse stereo", "3=left", "4=right", "5=dolby". Используйте plugin.audioChannel, чтобы проверить успешно ли прошла установка режима аудио канала
  
methods
+
методы
*'''void audioToggleMute()''': boolean toggle that mutes and unmutes the audio based upon the previous state
+
*'''void audioToggleMute()''': логическое переключение, которое отключает и включает звук аудио, основываясь на предыдущем состоянии
*'''string audioDescription(int i)''': give the i-th audio track name. 0 corresponds to disable and 1 to the first audio track
+
*'''string audioDescription(int i)''': дает имя аудио дорожке номер i. 0 соответствует отключению, а 1 - первой аудио дорожке
  
===Input===
+
===Входящие значения===
read only properties
+
свойства только для чтения
*'''inputLength''' (integer): length of the input file in number of milliseconds. 0 is returned for 'live' streams or clips whose length cannot be determined by the plugin. It returns -1 if no input is playing.
+
*'''inputLength''' (integer): длина входящего файла в миллисекундах. 0 возвращается для 'живых' потоков (live stream) или клипов, чью длину движок не может определить. Функция возвращает -1, если нет проигрываемых входящих файлов.
*'''inputState''' (integer): current state of the input chain given as enumeration (IDLE=0, OPENING=1, BUFFERING=2, PLAYING=3, PAUSED=4, STOPPING=5, ENDED=6, ERROR=7). Note: Test for ENDED=6 to catch end of playback. Checking for STOPPING=5 is NOT ENOUGH.
+
*'''inputState''' (integer): действующее состояние входной цепи, заданное  перечислением (IDLE=0 (бездействие), OPENING=1 (открывается), BUFFERING=2 (буферизация), PLAYING=3 (проигрывается), PAUSED=4 (пауза), STOPPING=5 (остановка), ENDED=6 (завершено), ERROR=7 (ошибка)). Примечание: Протестируйте ENDED=6, чтобы словить окончание проигрывания. Проверки STOPPING=5 НЕ ДОСТАТОЧНО.
*'''inputFps''' (float): frames per second returned as a float (typically 60.0, 50.0, 23.976, etc...)  
+
*'''inputFps''' (float): кадров в секунду, возвращает плавающее значение (обычно 60.0, 50.0, 23.976, и т.д..)  
*'''inputHasVout''' (bool): a boolean that returns true when the video is being displayed, it returns false when video is not displayed
+
*'''inputHasVout''' (bool): boolean, который возвращает значение true, когда видео показывается, и значение false, когда видео не показывается
*'''inputIsAd''' (bool): true if ad is playing now
+
*'''inputIsAd''' (bool): true, если реклама сейчас воспроизводится
*'''inputIsInterruptableAd''' (bool): true if interruptible ad is playing now
+
*'''inputIsInterruptableAd''' (bool): true, если  прерываемая реклама сейчас воспроизводится
*'''inputIsP2P''' (bool): true if current item is played via P2P (not a regular file/stream)
+
*'''inputIsP2P''' (bool): true, если данный пункт проигрывается с помощью P2P (не обычный файл/поток)
  
read/write properties
+
свойства для чтение/писания
*'''inputPosition''' (float): normalized position in multimedia stream item given as a float value between [0.0 - 1.0]
+
*'''inputPosition''' (float): нормализованное положение пункта в мультимедиа потоке, заданное в плавающем значении между [0.0 - 1.0]
*'''inputTime''' (integer): the absolute position in time given in milliseconds, this property can be used to seek through the stream
+
*'''inputTime''' (integer): абсолютное положение во времени, в миллисекундах; данное свойство может использоваться для поиска через поток
*'''inputRate''' (float): input speed given as float (1.0 for normal speed, 0.5 for half speed, 2.0 for twice as fast, etc.)
+
*'''inputRate''' (float): входящая скорость, заданная плавающим значением (1.0 для нормальной скорости, 0.5 для половины скорости, 2.0 для ускорения в два раза, и т.д.)
  
===Subtitles===
+
===Субтитры===
read only properties
+
свойства только для чтения
*'''subtitleCount''' (integer): returns the number of subtitle available
+
*'''subtitleCount''' (integer): возвращает количество доступных субтитров
  
read/write properties
+
свойства для чтение/писания
*'''subtitleTrack''' (integer): get and set the subtitle track to show on the video screen. The property takes an integer as input value [1..65535]. If subtitle track is set to 0, the subtitles will be disabled. If set to a value outside the current subtitle tracks range, then it will return -1 and display an error message
+
*'''subtitleTrack''' (integer): получить и установить дорожку субтитров для показа на видео экране. Свойство принимает целое число, в качестве входящего значения [1..65535]. Если дорожка субтитров установлена на 0, субтитры будут отключены. Если установлено значение, превышающее количество действующих дорожек субтитров, будет возвращено значение -1 и показано сообщение об ошибке
  
methods
+
методы
*'''string subtitleDescription(int i)''': give the i-th subtitle name. 0 correspond to disable and 1 to the first subtitle
+
*'''string subtitleDescription(int i)''': задает имя субтитру номер i. 0 соответствует отключению, а 1 - первому субтитру
  
===Video===
+
===Видео===
read only properties
+
свойства только для чтения
*'''videoWidth''' (integer): returns the horizontal size of the video
+
*'''videoWidth''' (integer): возвращает горизонтальный размер видео
*'''videoHeight''' (integer): returns the vertical size of the video
+
*'''videoHeight''' (integer): возвращает вертикальный размер видео
  
read/write properties
+
свойства для чтение/писания
*'''videoFullscreen''' (bool): when set to true the video will be displayed in fullscreen mode, when set to false the video will be shown inside the video output size
+
*'''videoFullscreen''' (bool): когда установлено true, видео будет показываться в полноэкранном режиме; когда установлено false, видео будет показано внутри  размера выходного видео
*'''videoAspectRatio''' (string): get and set the aspect ratio to use in the video screen. Typical values are: "1:1", "4:3", "16:9", "16:10", "221:100" and "5:4"
+
*'''videoAspectRatio''' (string): получить и установить соотношение сторон, чтобы использовать для видео экрана. Обычные значение: "1:1", "4:3", "16:9", "16:10", "221:100" и "5:4"
*'''videoCrop''' (string): get and set the crop to use in the video screen. Typical values are: "16:9", "16:10", "185:100", "239:100", "5:3", "4:3", "5:4", "1:1"
+
*'''videoCrop''' (string): получить и установить кадрирование, чтобы использовать для видео экрана. Обычные значение: "16:9", "16:10", "185:100", "239:100", "5:3", "4:3", "5:4", "1:1"
*'''deinterlaceStatus''' (string): possible values are "off", "auto", "on"
+
*'''deinterlaceStatus''' (string): возможные значения: "off", "auto", "on"
*'''deinterlaceMode''' (string): possible values are "discard", "blend", "mean", "bob", "linear", "x", "yadif", "yadif2x"
+
*'''deinterlaceMode''' (string): возможные значения: "discard", "blend", "mean", "bob", "linear", "x", "yadif", "yadif2x"
  
methods
+
методы
*'''void videoToggleFullscreen()''': toggle the fullscreen mode based on the previous setting
+
*'''void videoToggleFullscreen()''': переключать полноэкранный режим, основываясь на предыдущих настройках
  
==Examples==
+
==Примеры==
Embedding the plugin into a webpage (for all browsers, except Internet Explorer):
+
Вставка плагина в веб-страничку (для всех браузеров, кроме Internet Explorer):
 
  <tt><!DOCTYPE html>
 
  <tt><!DOCTYPE html>
 
  <html>
 
  <html>
Line 149: Line 149:
 
  </html></tt>
 
  </html></tt>
  
Embedding the plugin into a webpage (Internet Explorer):
+
Вставка плагина в веб-страничку (Internet Explorer):
 
  <tt><!DOCTYPE html>
 
  <tt><!DOCTYPE html>
 
  <html>
 
  <html>
Line 170: Line 170:
 
  </html></tt>
 
  </html></tt>
  
Load playlist from the torrent or via content id:
+
Загрузите плейлист из торрента или с помощью content id:
 
  <tt><script type="text/javascript">
 
  <tt><script type="text/javascript">
 
  var plugin = document.getElementById("plugin");
 
  var plugin = document.getElementById("plugin");
 
   
 
   
  // load from torrent
+
  // загрузка из торрента
 
  plugin.playlistLoadAsync("http://static.torrentstream.org/torrents/sintel.torrent", 0, 0, 0);
 
  plugin.playlistLoadAsync("http://static.torrentstream.org/torrents/sintel.torrent", 0, 0, 0);
 
   
 
   
  // load by the content id
+
  // загрузка с помощью content id
  plugin.playlistLoadPlayerAsync("5953213c22c304b4f2aab0029a0915fbadca3f8a");
+
  plugin.playlistLoadAsyncPlayer("5953213c22c304b4f2aab0029a0915fbadca3f8a");
 
  </script></tt>
 
  </script></tt>

Latest revision as of 13:04, 28 July 2015

Атрибуты тега embed

Чтобы встроить плагин в веб-страничку, используйте следующий шаблон <embed>:

<embed type="application/x-acestream-plugin" />
<object classid="clsid:79690976-ED6E-403c-BBBA-F8928B5EDE17"></object>

Обязательные элементы

  • width: Задает ширину плагина.
  • height: Задает высоту плагина.

Необязательные элементы

  • bgcolor (string): Задает цвет фона видеоплеера. По умолчанию: #000000
  • fontcolor (string): Задает цвет шрифта. По умолчанию: #FFFFFF
  • videobgcolor (string): Задает цвет фона видеоплеера при проигрывании видео. По умолчанию: #000000
  • fscontrolsenable (bool): Указывает включена ли панель управление в полноэкранном режиме. По умолчанию: true
  • nofscontrolsenable (bool): Указывает включена ли панель управления. По умолчанию: false
  • loopable (bool): Указывает повторяется ли видео после окончания. По умолчанию: false
  • fscontrols (string): Задает стиль панели управления в полноэкранном режиме. По умолчанию: default
  • nofscontrols (string): Задает стиль панели управления. По умолчанию: default
  • nofscontrolsheight (integer): Задает высоту панели управления в пикселях. По умолчанию: 36

Javascript API

Некоторое описание

Общие свойства только для чтения

  • version (string): версия плагина
  • auth (integer): уровень доступа пользователя
  • info (string): информационная строка
  • status (string): строка статуса
  • error (string): строка ошибки
  • state (integer): состояние движка (0 - бездействующий, 1 - пребуферизация, 2 - скачивание, 3 - буферизация, 4 - завершено, 5 - проверка скачивания, 6 - ошибка, 7 - плагин подключается к движку, 8 - производится загрузка плейлиста)

Плейлист

свойства только для чтения

  • playlistCount (integer): количество пунктов в плейлисте
  • playlistIsPlaying (bool): true, если данный пункт плейлиста проигрывается
  • playlistCurrentItem (integer): индекс с нуля данного пункта плейлиста

методы

  • void playlistAdd(string mrl, string name = ""): добавить пункт плейлиста как MRL
  • void playlistPlay(int position = 0): начать проигрывание данного пункта плейлиста
  • void playlistPlayItem(int index, intposition = 0, bool stop_current = true): начать проигрывание пункта с идентификатором "index"
  • void playlistTogglePause(): переключать состояние паузы для данного пункта плейлиста
  • void playlistStop(bool fullstop=false): остановить проигрывание данного пункта плейлиста. Если fullstop равен true, то плагин сообщает движку остановить загрузку данного пункта
  • void playlistNext(): перейти к следующему пункту плейлиста
  • void playlistPrev(): перейти к предыдущему пункту плейлиста
  • void playlistClear(): очистить данный плейлист (все пункты будут удалены из плейлиста)
  • void playlistRemoveItem(int index): удалить из плейлиста пункт с идентификатором "index"
  • string playlistItemTitle(int index): получить название указанного пункта
  • string playlistItemInfohash(int index): получить инфо-хеш указанного пункта
  • int playlistItemState(int index): получить состояние указанного пункта (0 - отключен, 1 - включен)
  • bool playlistItemIsSaveable(int index): проверить можно ли сохранить указанный пункт на диск
  • void playlistItemSave(int index): сохранить указанный пункт на диск (будет показан диалог для выбора места, куда сохранить)
  • void playlistSetItemState(int index, bool active): установить состояние пункта (включен/отключен)
  • void playlistToggleItemState(int index): переключить состояние пункта
  • void playlistMoveItem(int indexfrom, int indexto): передвинуть пункт на другую позицию плейлиста
  • void playlistSelectAll(): включить все пункты плейлиста
  • void playlistSelectNone(): отключить все пункты плейлиста
  • эти методы используются для загрузки плейлиста из указанного источника:
    • string playlistLoad(string torrentUrl, int developerId, int affiliateId, int zoneId): загрузить из торрента, указанного torrentUrl
    • string playlistLoadInfohash(string infohash, int developerId, int affiliateId, int zoneId): загрузить через инфо-хеш
    • string playlistLoadPlayer(string contentId): загрузить через content id (идентификатор контента)
    • string playlistLoadRaw(string torrentData, int developerId, int affiliateId, int zoneId): загрузить из необработанных данных торрента (содержимое торрент-файла закодировано в base64)
каждый метод возвращает строку, содержащую список пунктов в формате json
параметры developerId, affiliateId и zoneId должны быть установлены на 0, если вы не знаете, что с ними делать
  • эти методы такие же, как предыдущие, кроме того, что они выполняются асинхронно и возвращаются мгновенно:
    • void playlistLoadAsync(string torrentUrl, int developerId, int affiliateId, int zoneId)
    • void playlistLoadAsyncInfohash(string infohash, int developerId, int affiliateId, int zoneId)
    • void playlistLoadAsyncPlayer(string contentId)
    • void playlistLoadAsyncRaw(string torrentData, int developerId, int affiliateId, int zoneId)
  • void playlistLoadUrl(string url, int developerId, int affiliateId, int zoneId, string name, bool clear_playlist = false): добавить url в плейлист. Этот url будет использоваться движком для извлечения контента. Параметр name используется, чтобы задать название пункта в плейлисте. Если clear_playlist равен true, то плейлист будет очищен перед добавлением нового пункта
  • string playlistGetPlayerId(string infohash, int developerId, int affiliateId, int zoneId): получить content id для заданных infohash, developer, affiliate и zone идентификаторов

Аудио

свойства только для чтения

  • audioCount (integer): количества доступных аудио дорожек

свойства для чтение/писания

  • audioMute (bool): логическое значение для отключения или включения звука
  • audioVolume (interger): значение между 0 и 100, указывающее процент громкости
  • audioTrack (integer): значение между 1 и plugin.audioCount, указывающее аудио дорожку для проигрывания или которая уже проигрывается. Значение равное 0 означает, что аудио отключено или будет отключено
  • audioChannel (integer): целое значение между 1 и 5, указывающее, какой режим аудио канала используется, значение могут быть: "1=stereo", "2=reverse stereo", "3=left", "4=right", "5=dolby". Используйте plugin.audioChannel, чтобы проверить успешно ли прошла установка режима аудио канала

методы

  • void audioToggleMute(): логическое переключение, которое отключает и включает звук аудио, основываясь на предыдущем состоянии
  • string audioDescription(int i): дает имя аудио дорожке номер i. 0 соответствует отключению, а 1 - первой аудио дорожке

Входящие значения

свойства только для чтения

  • inputLength (integer): длина входящего файла в миллисекундах. 0 возвращается для 'живых' потоков (live stream) или клипов, чью длину движок не может определить. Функция возвращает -1, если нет проигрываемых входящих файлов.
  • inputState (integer): действующее состояние входной цепи, заданное перечислением (IDLE=0 (бездействие), OPENING=1 (открывается), BUFFERING=2 (буферизация), PLAYING=3 (проигрывается), PAUSED=4 (пауза), STOPPING=5 (остановка), ENDED=6 (завершено), ERROR=7 (ошибка)). Примечание: Протестируйте ENDED=6, чтобы словить окончание проигрывания. Проверки STOPPING=5 НЕ ДОСТАТОЧНО.
  • inputFps (float): кадров в секунду, возвращает плавающее значение (обычно 60.0, 50.0, 23.976, и т.д..)
  • inputHasVout (bool): boolean, который возвращает значение true, когда видео показывается, и значение false, когда видео не показывается
  • inputIsAd (bool): true, если реклама сейчас воспроизводится
  • inputIsInterruptableAd (bool): true, если прерываемая реклама сейчас воспроизводится
  • inputIsP2P (bool): true, если данный пункт проигрывается с помощью P2P (не обычный файл/поток)

свойства для чтение/писания

  • inputPosition (float): нормализованное положение пункта в мультимедиа потоке, заданное в плавающем значении между [0.0 - 1.0]
  • inputTime (integer): абсолютное положение во времени, в миллисекундах; данное свойство может использоваться для поиска через поток
  • inputRate (float): входящая скорость, заданная плавающим значением (1.0 для нормальной скорости, 0.5 для половины скорости, 2.0 для ускорения в два раза, и т.д.)

Субтитры

свойства только для чтения

  • subtitleCount (integer): возвращает количество доступных субтитров

свойства для чтение/писания

  • subtitleTrack (integer): получить и установить дорожку субтитров для показа на видео экране. Свойство принимает целое число, в качестве входящего значения [1..65535]. Если дорожка субтитров установлена на 0, субтитры будут отключены. Если установлено значение, превышающее количество действующих дорожек субтитров, будет возвращено значение -1 и показано сообщение об ошибке

методы

  • string subtitleDescription(int i): задает имя субтитру номер i. 0 соответствует отключению, а 1 - первому субтитру

Видео

свойства только для чтения

  • videoWidth (integer): возвращает горизонтальный размер видео
  • videoHeight (integer): возвращает вертикальный размер видео

свойства для чтение/писания

  • videoFullscreen (bool): когда установлено true, видео будет показываться в полноэкранном режиме; когда установлено false, видео будет показано внутри размера выходного видео
  • videoAspectRatio (string): получить и установить соотношение сторон, чтобы использовать для видео экрана. Обычные значение: "1:1", "4:3", "16:9", "16:10", "221:100" и "5:4"
  • videoCrop (string): получить и установить кадрирование, чтобы использовать для видео экрана. Обычные значение: "16:9", "16:10", "185:100", "239:100", "5:3", "4:3", "5:4", "1:1"
  • deinterlaceStatus (string): возможные значения: "off", "auto", "on"
  • deinterlaceMode (string): возможные значения: "discard", "blend", "mean", "bob", "linear", "x", "yadif", "yadif2x"

методы

  • void videoToggleFullscreen(): переключать полноэкранный режим, основываясь на предыдущих настройках

Примеры

Вставка плагина в веб-страничку (для всех браузеров, кроме Internet Explorer):

<!DOCTYPE html>
<html>
<head>
    <title>Plugin Test</title>
</head>
<body>
    <embed id="plugin" type="application/x-acestream-plugin"
        width="800"
        height="600"
        fullscreencontrols="true"
        fscontrolsenable="true"
        fscontrols="default"
        nofscontrolsenable="true"
        nofscontrols="default"
        nofscontrolsheight="36"
        loopable="false" />
</body>
</html>

Вставка плагина в веб-страничку (Internet Explorer):

<!DOCTYPE html>
<html>
<head>
    <title>Plugin Test</title>
</head>
<body>
    <object id="plugin" classid="clsid:79690976-ED6E-403c-BBBA-F8928B5EDE17">
        <param name="width" value="800" />
        <param name="height" value="600" />
        <param name="fullscreencontrols" value="true" />
        <param name="fscontrolsenable" value="true" />
        <param name="fscontrols" value="default" />
        <param name="nofscontrolsenable" value="true" />
        <param name="nofscontrols" value="default" />
        <param name="nofscontrolsheight" value="36" />
        <param name="loopable" value="false" />
    </object>
</body>
</html>

Загрузите плейлист из торрента или с помощью content id:

<script type="text/javascript">
var plugin = document.getElementById("plugin");

// загрузка из торрента
plugin.playlistLoadAsync("http://static.torrentstream.org/torrents/sintel.torrent", 0, 0, 0);

// загрузка с помощью content id
plugin.playlistLoadAsyncPlayer("5953213c22c304b4f2aab0029a0915fbadca3f8a");
</script>