Changes

Jump to: navigation, search

WebPlugin

5,934 bytes added, 13:04, 28 July 2015
Примеры
==Embed tag attributesАтрибуты тега embed==To embed the plugin into a webpage use the following Чтобы встроить плагин в веб-страничку, используйте следующий шаблон <embed> template:
<tt><embed type="application/x-acestream-plugin" />
<object classid="clsid:79690976-ED6E-403c-BBBA-F8928B5EDE17"></object></tt>
===Required elementsОбязательные элементы===*'''width''': Specifies the width of the pluginЗадает ширину плагина. *'''height''': Specifies the height of the pluginЗадает высоту плагина.
===Optional elementsНеобязательные элементы===*'''bgcolor''' (string): Specifies the background color of the video playerЗадает цвет фона видеоплеера. DefaultПо умолчанию: ''#000000''*'''fontcolor''' (string): Specifies the font colorЗадает цвет шрифта. DefaultПо умолчанию: ''#FFFFFF''*'''videobgcolor''' (string): Specifies the background color of the video player when playing videoЗадает цвет фона видеоплеера при проигрывании видео. DefaultПо умолчанию: ''#000000''*'''fscontrolsenable''' (bool): Specifies whether controls are enabled in the fullscreenУказывает включена ли панель управление в полноэкранном режиме. DefaultПо умолчанию: ''true''*'''nofscontrolsenable''' (bool): Specifies whether controls are enabledУказывает включена ли панель управления. DefaultПо умолчанию: ''false''*'''loopable ''' (bool): Specifies whether the video loops on endУказывает повторяется ли видео после окончания. DefaultПо умолчанию: ''false''*'''fscontrols''' (boolstring): Specifies the theme for the fullscreen controlsЗадает стиль панели управления в полноэкранном режиме. DefaultПо умолчанию: ''default''*'''nofscontrols''' (boolstring): Specifies the theme for the controlsЗадает стиль панели управления. DefaultПо умолчанию: ''default''*'''nofscontrolsheight''' (integer): Specifies the height of the toolbar in pixelsЗадает высоту панели управления в пикселях. DefaultПо умолчанию: ''36''
==Javascript API==
Some descriptionНекоторое описание
===Common read only propertiesОбщие свойства только для чтения===*'''version''' (string): plugin's versionверсия плагина*'''auth''' (integer): user access levelуровень доступа пользователя*'''info''' (string): info stringинформационная строка*'''status''' (string): status stringстрока статуса*'''error''' (string): error stringстрока ошибки*'''state''' (integer): the engine's state состояние движка (0 - idleбездействующий, 1 - prebufferingпребуферизация, 2 - downloadingскачивание, 3 - bufferingбуферизация, 4 - завершено, 5 - проверка скачивания, 6 - ошибка, 7 - плагин подключается к движку, 8 - производится загрузка плейлиста)
===PlaylistПлейлист===read only propertiesсвойства только для чтения*'''playlistCount''' (integer): number of items in the playlistколичество пунктов в плейлисте*'''playlistIsPlaying''' (bool): true if the current playlist item is playing, если данный пункт плейлиста проигрывается*'''playlistCurrentItem''' (integer): zero-based index of the current playlist itemиндекс с нуля данного пункта плейлиста
methodsметоды*'''void playlistAdd(string mrl, string name = "")''': add a playlist item as добавить пункт плейлиста как MRL*'''void playlistPlay(int position = 0)''': start playing the current playlist itemначать проигрывание данного пункта плейлиста*'''void playlistPlayItem(int index, intposition = 0, bool stop_current = true)''': start playing the item whose identifier is начать проигрывание пункта с идентификатором "index"*'''void playlistTogglePause()''': toggle the pause state for the current playlist itemпереключать состояние паузы для данного пункта плейлиста*'''void playlistStop(bool fullstop=false)''': stop playing the current playlist itemостановить проигрывание данного пункта плейлиста. If Если fullstop is равен true then plugin tells engine to stop downloading item., то плагин сообщает движку остановить загрузку данного пункта*'''void playlistNext()''': iterate to the next playlist itemперейти к следующему пункту плейлиста*'''void playlistPrev()''': iterate to the previous playlist itemперейти к предыдущему пункту плейлиста*'''void playlistClear()''': empty the current playlist, all items will be deleted from the playlistочистить данный плейлист (все пункты будут удалены из плейлиста)*'''void playlistRemoveItem(int index)''': remove the item from playlist whose identifier is удалить из плейлиста пункт с идентификатором "index"*'''string playlistItemTitle(int index)''': get the title of the specified itemполучить название указанного пункта*'''string playlistItemInfohash(int index)''': get the infohash of the specified itemполучить инфо-хеш указанного пункта *'''int playlistItemState(int index)''': get the state of the specified item получить состояние указанного пункта (0 - disabledотключен, 1 - enabledвключен)*'''bool playlistItemIsSaveable(int index)''': check whether the specified item can be saved on the diskпроверить можно ли сохранить указанный пункт на диск*'''void playlistItemSave(int index)''': save the specified item on the disk сохранить указанный пункт на диск (a dialog will be shown to choose destinationбудет показан диалог для выбора места, куда сохранить)*'''void playlistSetItemState(int index, bool active)''': set item state установить состояние пункта (enabledвключен/disabledотключен)*'''void playlistToggleItemState(int index)''': toggle item stateпереключить состояние пункта*'''void playlistMoveItem(int indexfrom, int indexto)''': move the item to another position in the playlistпередвинуть пункт на другую позицию плейлиста*'''void playlistSelectAll()''': enable all items in the playlistвключить все пункты плейлиста*'''void playlistSelectNone()''': disable all items in the playlistотключить все пункты плейлиста *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 playlistLoadInfohash(string infohash, int developerId, int affiliateId, int zoneId)''': load by infohashзагрузить через инфо-хеш**'''string playlistLoadPlayer(string contentId)''': load by загрузить через 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):each method returns a string containing the list of items in каждый метод возвращает строку, содержащую список пунктов в формате json format:параметры ''developerId'', ''affiliateId'' and и ''zoneId'' parameters should be set to должны быть установлены на ''0'' if you don't known what to do with them, если вы не знаете, что с ними делать
*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 playlistLoadAsyncInfohash(string infohash, 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, то плейлист будет очищен перед добавлением нового пункта
*'''string playlistGetPlayerId(string infohash, int developerId, int affiliateId, int zoneId)''': get the получить content id for the given для заданных infohash, developer, affiliate and и zone idsидентификаторов
===AudioАудио===read only propertiesсвойства только для чтения*'''audioCount''' (integer): the number of audio track availableколичества доступных аудио дорожек
readсвойства для чтение/write propertiesписания*'''audioMute''' (bool): boolean value to mute and unmute the audioлогическое значение для отключения или включения звука*'''audioVolume''' (interger): a value between значение между 0 and и 100 which indicates a percentage of the volume, указывающее процент громкости*'''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означает, что аудио отключено или будет отключено*'''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, чтобы проверить успешно ли прошла установка режима аудио канала
methodsметоды*'''void audioToggleMute()''': boolean toggle that mutes and unmutes the audio based upon the previous stateлогическое переключение, которое отключает и включает звук аудио, основываясь на предыдущем состоянии*'''string audioDescription(int i)''': give the дает имя аудио дорожке номер i-th audio track name. 0 corresponds to disable and соответствует отключению, а 1 to the first audio track- первой аудио дорожке
===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 pluginstream) или клипов, чью длину движок не может определить. It returns Функция возвращает -1 if no input is playing, если нет проигрываемых входящих файлов.*'''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НЕ ДОСТАТОЧНО.*'''inputFps''' (float): frames per second returned as a float кадров в секунду, возвращает плавающее значение (typically обычно 60.0, 50.0, 23.976, etcи т.д..) *'''inputHasVout''' (bool): a boolean that returns , который возвращает значение true when the video is being displayed, it returns когда видео показывается, и значение false when video is not displayed , когда видео не показывается *'''inputIsAd''' (bool): true if ad is playing now, если реклама сейчас воспроизводится*'''inputIsInterruptableAd''' (bool): true if interruptible ad is playing now, если прерываемая реклама сейчас воспроизводится*'''inputIsP2P''' (bool): true if current item is played via , если данный пункт проигрывается с помощью P2P (not a regular fileне обычный файл/streamпоток)
readсвойства для чтение/write propertiesписания*'''inputPosition''' (float): normalized position in multimedia stream item given as a float value between нормализованное положение пункта в мультимедиа потоке, заданное в плавающем значении между [0.0 - 1.0]*'''inputTime''' (integer): the absolute position in time given in millisecondsабсолютное положение во времени, this property can be used to seek through the streamв миллисекундах; данное свойство может использоваться для поиска через поток*'''inputRate''' (float): input speed given as float входящая скорость, заданная плавающим значением (1.0 for normal speedдля нормальной скорости, 0.5 for half speedдля половины скорости, 2.0 for twice as fastдля ускорения в два раза, etcи т.д.)
===SubtitlesСубтитры===read only propertiesсвойства только для чтения*'''subtitleCount''' (integer): returns the number of subtitle availableвозвращает количество доступных субтитров
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и показано сообщение об ошибке
methodsметоды*'''string subtitleDescription(int i)''': give the задает имя субтитру номер i-th subtitle name. 0 correspond to disable and соответствует отключению, а 1 to the first subtitle- первому субтитру
===VideoВидео===read only propertiesсвойства только для чтения*'''videoWidth''' (integer): returns the horizontal size of the videoвозвращает горизонтальный размер видео*'''videoHeight''' (integer): returns the vertical size of the video возвращает вертикальный размер видео
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, видео будет показано внутри размера выходного видео*'''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"*'''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"*'''deinterlaceStatus''' (string): possible values are возможные значения: "off", "auto", "on"*'''deinterlaceMode''' (string): possible values are возможные значения: "discard", "blend", "mean", "bob", "linear", "x", "yadif", "yadif2x"
methodsметоды*'''void videoToggleFullscreen()''': toggle the fullscreen mode based on the previous settingпереключать полноэкранный режим, основываясь на предыдущих настройках
==ExamplesПримеры==Embedding the plugin into a webpage Вставка плагина в веб-страничку (for all browsersдля всех браузеров, except кроме Internet Explorer):
<tt><!DOCTYPE html>
<html>
</html></tt>
Embedding the plugin into a webpage Вставка плагина в веб-страничку (Internet Explorer):
<tt><!DOCTYPE html>
<html>
</html></tt>
Load playlist from the torrent or via Загрузите плейлист из торрента или с помощью content id:
<tt><script type="text/javascript">
var plugin = document.getElementById("plugin");
// load from torrentзагрузка из торрента
plugin.playlistLoadAsync("http://static.torrentstream.org/torrents/sintel.torrent", 0, 0, 0);
// load by the загрузка с помощью content id plugin.playlistLoadPlayerAsyncplaylistLoadAsyncPlayer("5953213c22c304b4f2aab0029a0915fbadca3f8a");
</script></tt>

Navigation menu