HtmlSource
Defined in: core/source/html.ts:44
The HtmlSource class represents the sources of the html items that has been added to the stage. A single source could have multiple items linked into it and any changes to the source would affect all items linked to it.
Each item is represented by the HtmlItem class. See: #core/HtmlItem Core/HtmlItem
Inherits from: #core/Source Core/Source
Basic Usage
Section titled “Basic Usage”var xjs = require('xjs');
xjs.Scene.getActiveScene().then(function(scene) { scene.getSources().then(function(sources) { for (var i in sources) { if (sources[i] instanceof XJS.HtmlSource) { // Manipulate your html source here sources[i].setSilenceDetectionEnabled(true); } } })})All methods marked as Chainable resolve with the original HtmlSource
instance.
Extends
Section titled “Extends”Implements
Section titled “Implements”ISourceConfigurableIAudioISourceHtml
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new HtmlSource(
props?):HtmlSource
Defined in: core/source/source.ts:75
Parameters
Section titled “Parameters”props?
Section titled “props?”Returns
Section titled “Returns”HtmlSource
Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”applyConfig
Section titled “applyConfig”applyConfig: (
configObj) =>Promise<HtmlSource>
Defined in: core/source/html.ts:195
See: #core/ISourceConfigurable#applyConfig applyConfig
Parameters
Section titled “Parameters”configObj
Section titled “configObj”any
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”ISourceConfigurable.applyConfig
call: () =>
Promise<HtmlSource>
Defined in: core/source/html.ts:50
See: #core/ISourceHtml#call call
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”ISourceHtml.call
enableBrowser60FPS
Section titled “enableBrowser60FPS”enableBrowser60FPS: (
value) =>Promise<HtmlSource>
Defined in: core/source/html.ts:80
See: #core/ISourceHtml#enableBrowser60FPS enableBrowser60FPS
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”ISourceHtml.enableBrowser60FPS
enableBrowserJS
Section titled “enableBrowserJS”enableBrowserJS: (
value) =>Promise<HtmlSource>
Defined in: core/source/html.ts:120
See: #core/ISourceHtml#enableBrowserJS enableBrowserJS
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”ISourceHtml.enableBrowserJS
enableBrowserTransparency
Section titled “enableBrowserTransparency”enableBrowserTransparency: (
value) =>Promise<HtmlSource>
Defined in: core/source/html.ts:70
See: #core/ISourceHtml#enableBrowserTransparency enableBrowserTransparency
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”ISourceHtml.enableBrowserTransparency
enableCustomCSS
Section titled “enableCustomCSS”enableCustomCSS: (
value) =>Promise<HtmlSource>
Defined in: core/source/html.ts:140
See: #core/ISourceHtml#enableCustomCSS enableCustomCSS
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”ISourceHtml.enableCustomCSS
enableReloadOnSceneEnter
Section titled “enableReloadOnSceneEnter”enableReloadOnSceneEnter: (
value) =>Promise<HtmlSource>
Defined in: core/source/html.ts:170
See: #core/ISourceHtml#enableReloadOnSceneEnter enableReloadOnSceneEnter
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”ISourceHtml.enableReloadOnSceneEnter
enableReloadOnShow
Section titled “enableReloadOnShow”enableReloadOnShow: (
value) =>Promise<HtmlSource>
Defined in: core/source/html.ts:160
See: #core/ISourceHtml#enableReloadOnShow enableReloadOnShow
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”ISourceHtml.enableReloadOnShow
getAllowRightClick
Section titled “getAllowRightClick”getAllowRightClick: () =>
Promise<boolean>
Defined in: core/source/html.ts:95
See: #core/ISourceHtml#getAllowRightClick getAllowRightClick
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”ISourceHtml.getAllowRightClick
getBrowserCustomSize
Section titled “getBrowserCustomSize”getBrowserCustomSize: () =>
Promise<Rectangle>
Defined in: core/source/html.ts:85
See: #core/ISourceHtml#getBrowserCustomSize getBrowserCustomSize
Returns
Section titled “Returns”Promise<Rectangle>
Implementation of
Section titled “Implementation of”ISourceHtml.getBrowserCustomSize
getBrowserJS
Section titled “getBrowserJS”getBrowserJS: () =>
Promise<string>
Defined in: core/source/html.ts:105
See: #core/ISourceHtml#getBrowserJS getBrowserJS
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”ISourceHtml.getBrowserJS
getBrowserLoadStatus
Section titled “getBrowserLoadStatus”getBrowserLoadStatus: () =>
Promise<string>
Defined in: core/source/html.ts:150
See: #core/ISourceHtml#getBrowserLoadStatus getBrowserLoadStatus
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”ISourceHtml.getBrowserLoadStatus
getCustomCSS
Section titled “getCustomCSS”getCustomCSS: () =>
Promise<string>
Defined in: core/source/html.ts:125
See: #core/ISourceHtml#getCustomCSS getCustomCSS
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”ISourceHtml.getCustomCSS
getCustomName
Section titled “getCustomName”getCustomName: () =>
Promise<string>
Defined in: core/source/source.ts:291
See: #core/ISource#getCustomName getCustomName
Returns
Section titled “Returns”Promise<string>
Inherited from
Section titled “Inherited from”getId: () =>
Promise<string>
Defined in: core/source/source.ts:316
See: #core/ISource#getId getId
Returns
Section titled “Returns”Promise<string>
Inherited from
Section titled “Inherited from”getItemList
Section titled “getItemList”getItemList: () =>
Promise<Item[]>
Defined in: core/source/source.ts:321
See: #core/ISource#getItemList getItemList
Returns
Section titled “Returns”Promise<Item[]>
Inherited from
Section titled “Inherited from”getKeepLoaded
Section titled “getKeepLoaded”getKeepLoaded: () =>
Promise<boolean>
Defined in: core/source/source.ts:306
See: #core/ISource#getKeepLoaded getKeepLoaded
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”getName
Section titled “getName”getName: () =>
Promise<string>
Defined in: core/source/source.ts:281
See: #core/ISource#getName getName
Returns
Section titled “Returns”Promise<string>
Inherited from
Section titled “Inherited from”getType
Section titled “getType”getType: () =>
Promise<ItemTypes>
Defined in: core/source/source.ts:331
See: #core/ISource#getType getType
Returns
Section titled “Returns”Promise<ItemTypes>
Inherited from
Section titled “Inherited from”getURL
Section titled “getURL”getURL: () =>
Promise<string>
Defined in: core/source/html.ts:55
See: #core/ISourceHtml#getURL getURL
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”ISourceHtml.getURL
getValue
Section titled “getValue”getValue: () =>
Promise<string|XML>
Defined in: core/source/source.ts:296
See: #core/ISource#getValue getValue
Returns
Section titled “Returns”Promise<string | XML>
Inherited from
Section titled “Inherited from”getVolume
Section titled “getVolume”getVolume: () =>
Promise<number>
Defined in: core/source/html.ts:200
See: #core/IAudio#getVolume getVolume
Returns
Section titled “Returns”Promise<number>
Implementation of
Section titled “Implementation of”IAudio.getVolume
isAudioAvailable
Section titled “isAudioAvailable”isAudioAvailable: () =>
Promise<boolean>
Defined in: core/source/html.ts:224
See: #core/IAudio#isAudioAvailable isAudioAvailable
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”IAudio.isAudioAvailable
isAutoMute
Section titled “isAutoMute”isAutoMute: () =>
Promise<boolean>
Defined in: core/source/html.ts:206
See: #core/IAudio#isAutoMute isAutoMute
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”IAudio.isAutoMute
isBrowser60FPS
Section titled “isBrowser60FPS”isBrowser60FPS: () =>
Promise<boolean>
Defined in: core/source/html.ts:75
See: #core/ISourceHtml#isBrowser60FPS isBrowser60FPS
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”ISourceHtml.isBrowser60FPS
isBrowserJSEnabled
Section titled “isBrowserJSEnabled”isBrowserJSEnabled: () =>
Promise<boolean>
Defined in: core/source/html.ts:115
See: #core/ISourceHtml#isBrowserJSEnabled isBrowserJSEnabled
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”ISourceHtml.isBrowserJSEnabled
isBrowserOptimized
Section titled “isBrowserOptimized”isBrowserOptimized: () =>
Promise<boolean>
Defined in: core/source/html.ts:145
See: #core/ISourceHtml#isBrowserOptimized isBrowserOptimized
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”ISourceHtml.isBrowserOptimized
isBrowserTransparent
Section titled “isBrowserTransparent”isBrowserTransparent: () =>
Promise<boolean>
Defined in: core/source/html.ts:65
See: #core/ISourceHtml#isBrowserTransparent isBrowserTransparent
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”ISourceHtml.isBrowserTransparent
isCustomCSSEnabled
Section titled “isCustomCSSEnabled”isCustomCSSEnabled: () =>
Promise<boolean>
Defined in: core/source/html.ts:135
See: #core/ISourceHtml#isCustomCSSEnabled isCustomCSSEnabled
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”ISourceHtml.isCustomCSSEnabled
isMute
Section titled “isMute”isMute: () =>
Promise<boolean>
Defined in: core/source/html.ts:203
See: #core/IAudio#isMute isMute
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”IAudio.isMute
isReloadOnSceneEnterEnabled
Section titled “isReloadOnSceneEnterEnabled”isReloadOnSceneEnterEnabled: () =>
Promise<boolean>
Defined in: core/source/html.ts:165
See: #core/ISourceHtml#isReloadOnSceneEnterEnabled isReloadOnSceneEnterEnabled
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”ISourceHtml.isReloadOnSceneEnterEnabled
isReloadOnShowEnabled
Section titled “isReloadOnShowEnabled”isReloadOnShowEnabled: () =>
Promise<boolean>
Defined in: core/source/html.ts:155
See: #core/ISourceHtml#isReloadOnShowEnabled isReloadOnShowEnabled
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”ISourceHtml.isReloadOnShowEnabled
isSourceAvailable
Section titled “isSourceAvailable”isSourceAvailable: () =>
Promise<boolean>
Defined in: core/source/html.ts:173
See: #core/ISourceHtml#isSourceAvailable isSourceAvailable
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”ISourceHtml.isSourceAvailable
isStreamOnlyAudio
Section titled “isStreamOnlyAudio”isStreamOnlyAudio: () =>
Promise<boolean>
Defined in: core/source/html.ts:218
See: #core/IAudio#isStreamOnlyAudio isStreamOnlyAudio
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”IAudio.isStreamOnlyAudio
loadConfig
Section titled “loadConfig”loadConfig: () =>
Promise<any>
Defined in: core/source/html.ts:179
See: #core/ISourceConfigurable#loadConfig loadConfig
Returns
Section titled “Returns”Promise<any>
Implementation of
Section titled “Implementation of”ISourceConfigurable.loadConfig
refresh
Section titled “refresh”refresh: () =>
Promise<Source>
Defined in: core/source/source.ts:326
See: #core/ISource#refresh refresh
Returns
Section titled “Returns”Promise<Source>
Inherited from
Section titled “Inherited from”requestSaveConfig
Section titled “requestSaveConfig”requestSaveConfig: (
configObj) =>Promise<HtmlSource>
Defined in: core/source/html.ts:189
See: #core/ISourceConfigurable#requestSaveConfig requestSaveConfig
Parameters
Section titled “Parameters”configObj
Section titled “configObj”any
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”ISourceConfigurable.requestSaveConfig
saveConfig
Section titled “saveConfig”saveConfig: (
configObj) =>Promise<HtmlSource>
Defined in: core/source/html.ts:184
See: #core/ISourceConfigurable#saveConfig saveConfig
Parameters
Section titled “Parameters”configObj
Section titled “configObj”any
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”ISourceConfigurable.saveConfig
setAllowRightClick
Section titled “setAllowRightClick”setAllowRightClick: (
value) =>Promise<HtmlSource>
Defined in: core/source/html.ts:100
See: #core/ISourceHtml#setAllowRightClick setAllowRightClick
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”ISourceHtml.setAllowRightClick
setAutoMute
Section titled “setAutoMute”setAutoMute: (
value) =>Promise<HtmlSource>
Defined in: core/source/html.ts:215
See: #core/IAudio#setAutoMute setAutoMute
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”IAudio.setAutoMute
setBrowserCustomSize
Section titled “setBrowserCustomSize”setBrowserCustomSize: (
value) =>Promise<HtmlSource>
Defined in: core/source/html.ts:90
See: #core/ISourceHtml#setBrowserCustomSize setBrowserCustomSize
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”ISourceHtml.setBrowserCustomSize
setBrowserJS
Section titled “setBrowserJS”setBrowserJS: () =>
Promise<HtmlSource>
Defined in: core/source/html.ts:110
See: #core/ISourceHtml#setBrowserJS setBrowserJS
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”ISourceHtml.setBrowserJS
setCustomCSS
Section titled “setCustomCSS”setCustomCSS: (
value) =>Promise<HtmlSource>
Defined in: core/source/html.ts:130
See: #core/ISourceHtml#setCustomCSS setCustomCSS
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”ISourceHtml.setCustomCSS
setCustomName
Section titled “setCustomName”setCustomName: () =>
Promise<Source>
Defined in: core/source/source.ts:286
See: #core/ISource#setCustomName setCustomName
Returns
Section titled “Returns”Promise<Source>
Inherited from
Section titled “Inherited from”setKeepLoaded
Section titled “setKeepLoaded”setKeepLoaded: (
value) =>Promise<Source>
Defined in: core/source/source.ts:311
See: #core/ISource#setKeepLoaded setKeepLoaded
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<Source>
Inherited from
Section titled “Inherited from”setMute
Section titled “setMute”setMute: (
value) =>Promise<HtmlSource>
Defined in: core/source/html.ts:212
See: #core/IAudio#setMute setMute
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”IAudio.setMute
setName
Section titled “setName”setName: (
value) =>Promise<Source>
Defined in: core/source/source.ts:276
See: #core/ISource#setName setName
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<Source>
Inherited from
Section titled “Inherited from”setStreamOnlyAudio
Section titled “setStreamOnlyAudio”setStreamOnlyAudio: (
value) =>Promise<HtmlSource>
Defined in: core/source/html.ts:221
See: #core/IAudio#setStreamOnlyAudio setStreamOnlyAudio
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”IAudio.setStreamOnlyAudio
setURL
Section titled “setURL”setURL: () =>
Promise<HtmlSource>
Defined in: core/source/html.ts:60
See: #core/ISourceHtml#setURL setURL
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”ISourceHtml.setURL
setValue
Section titled “setValue”setValue: (
value) =>Promise<Source>
Defined in: core/source/source.ts:301
See: #core/ISource#setValue setValue
Parameters
Section titled “Parameters”string | XML
Returns
Section titled “Returns”Promise<Source>
Inherited from
Section titled “Inherited from”setVolume
Section titled “setVolume”setVolume: (
value) =>Promise<HtmlSource>
Defined in: core/source/html.ts:209
See: #core/IAudio#setVolume setVolume
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Promise<HtmlSource>
Implementation of
Section titled “Implementation of”IAudio.setVolume
Methods
Section titled “Methods”getAllSources()
Section titled “getAllSources()”
staticgetAllSources():Promise<Source[]>
Defined in: core/source/source.ts:220
return: Promise<Source[]>
Get all unique Source from every scene.
Total number of Sources returned may be less than total number of items on
all the scenes due to Linked items only having a single Source.
xjs.Source.getAllSources().then(function(sources) { for(var i = 0 ; i < sources.length ; i++) { if(sources[i] instanceof xjs.HtmlSource) { // Manipulate HTML Source here } }})Returns
Section titled “Returns”Promise<Source[]>
Inherited from
Section titled “Inherited from”getCurrentSource()
Section titled “getCurrentSource()”
staticgetCurrentSource():Promise<Source>
Defined in: core/source/source.ts:108
return: Promise
Get the current source (when function is called by sources), or the source that was right-clicked to open the source properties window (when function is called from the source properties window)
xjs.Source.getCurrentSource().then(function(source) { // This will fetch the current source (the plugin)}).catch(function(err) { // Handle the error here. Errors would only occur // if we try to execute this method on Extension plugins});Returns
Section titled “Returns”Promise<Source>
Inherited from
Section titled “Inherited from”getItemList()
Section titled “getItemList()”
staticgetItemList():Promise<Item[]>
Defined in: core/source/source.ts:167
return: Promise<Item[]>
Get the item List of the current Source. The item list is a list of items linked to a single Source.
xjs.Source.getItemList().then(function(items) { // This will fetch the item list of the current Source for (var i = 0 ; i < items.length ; i++) { // Manipulate each item here }});This is just the shorter way of getting items that are linked to a single source. See the long version below:
xjs.Source.getCurrentSource().then(source.getItemList).then(function(items) {// Manipulate the items here})Returns
Section titled “Returns”Promise<Item[]>