Skip to content

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

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.

  • ISourceConfigurable
  • IAudio
  • ISourceHtml

new HtmlSource(props?): HtmlSource

Defined in: core/source/source.ts:75

HtmlSource

Source.constructor

applyConfig: (configObj) => Promise<HtmlSource>

Defined in: core/source/html.ts:195

See: #core/ISourceConfigurable#applyConfig applyConfig

any

Promise<HtmlSource>

ISourceConfigurable.applyConfig


call: () => Promise<HtmlSource>

Defined in: core/source/html.ts:50

See: #core/ISourceHtml#call call

Promise<HtmlSource>

ISourceHtml.call


enableBrowser60FPS: (value) => Promise<HtmlSource>

Defined in: core/source/html.ts:80

See: #core/ISourceHtml#enableBrowser60FPS enableBrowser60FPS

boolean

Promise<HtmlSource>

ISourceHtml.enableBrowser60FPS


enableBrowserJS: (value) => Promise<HtmlSource>

Defined in: core/source/html.ts:120

See: #core/ISourceHtml#enableBrowserJS enableBrowserJS

boolean

Promise<HtmlSource>

ISourceHtml.enableBrowserJS


enableBrowserTransparency: (value) => Promise<HtmlSource>

Defined in: core/source/html.ts:70

See: #core/ISourceHtml#enableBrowserTransparency enableBrowserTransparency

boolean

Promise<HtmlSource>

ISourceHtml.enableBrowserTransparency


enableCustomCSS: (value) => Promise<HtmlSource>

Defined in: core/source/html.ts:140

See: #core/ISourceHtml#enableCustomCSS enableCustomCSS

boolean

Promise<HtmlSource>

ISourceHtml.enableCustomCSS


enableReloadOnSceneEnter: (value) => Promise<HtmlSource>

Defined in: core/source/html.ts:170

See: #core/ISourceHtml#enableReloadOnSceneEnter enableReloadOnSceneEnter

boolean

Promise<HtmlSource>

ISourceHtml.enableReloadOnSceneEnter


enableReloadOnShow: (value) => Promise<HtmlSource>

Defined in: core/source/html.ts:160

See: #core/ISourceHtml#enableReloadOnShow enableReloadOnShow

boolean

Promise<HtmlSource>

ISourceHtml.enableReloadOnShow


getAllowRightClick: () => Promise<boolean>

Defined in: core/source/html.ts:95

See: #core/ISourceHtml#getAllowRightClick getAllowRightClick

Promise<boolean>

ISourceHtml.getAllowRightClick


getBrowserCustomSize: () => Promise<Rectangle>

Defined in: core/source/html.ts:85

See: #core/ISourceHtml#getBrowserCustomSize getBrowserCustomSize

Promise<Rectangle>

ISourceHtml.getBrowserCustomSize


getBrowserJS: () => Promise<string>

Defined in: core/source/html.ts:105

See: #core/ISourceHtml#getBrowserJS getBrowserJS

Promise<string>

ISourceHtml.getBrowserJS


getBrowserLoadStatus: () => Promise<string>

Defined in: core/source/html.ts:150

See: #core/ISourceHtml#getBrowserLoadStatus getBrowserLoadStatus

Promise<string>

ISourceHtml.getBrowserLoadStatus


getCustomCSS: () => Promise<string>

Defined in: core/source/html.ts:125

See: #core/ISourceHtml#getCustomCSS getCustomCSS

Promise<string>

ISourceHtml.getCustomCSS


getCustomName: () => Promise<string>

Defined in: core/source/source.ts:291

See: #core/ISource#getCustomName getCustomName

Promise<string>

Source.getCustomName


getId: () => Promise<string>

Defined in: core/source/source.ts:316

See: #core/ISource#getId getId

Promise<string>

Source.getId


getItemList: () => Promise<Item[]>

Defined in: core/source/source.ts:321

See: #core/ISource#getItemList getItemList

Promise<Item[]>

Source.getItemList


getKeepLoaded: () => Promise<boolean>

Defined in: core/source/source.ts:306

See: #core/ISource#getKeepLoaded getKeepLoaded

Promise<boolean>

Source.getKeepLoaded


getName: () => Promise<string>

Defined in: core/source/source.ts:281

See: #core/ISource#getName getName

Promise<string>

Source.getName


getType: () => Promise<ItemTypes>

Defined in: core/source/source.ts:331

See: #core/ISource#getType getType

Promise<ItemTypes>

Source.getType


getURL: () => Promise<string>

Defined in: core/source/html.ts:55

See: #core/ISourceHtml#getURL getURL

Promise<string>

ISourceHtml.getURL


getValue: () => Promise<string | XML>

Defined in: core/source/source.ts:296

See: #core/ISource#getValue getValue

Promise<string | XML>

Source.getValue


getVolume: () => Promise<number>

Defined in: core/source/html.ts:200

See: #core/IAudio#getVolume getVolume

Promise<number>

IAudio.getVolume


isAudioAvailable: () => Promise<boolean>

Defined in: core/source/html.ts:224

See: #core/IAudio#isAudioAvailable isAudioAvailable

Promise<boolean>

IAudio.isAudioAvailable


isAutoMute: () => Promise<boolean>

Defined in: core/source/html.ts:206

See: #core/IAudio#isAutoMute isAutoMute

Promise<boolean>

IAudio.isAutoMute


isBrowser60FPS: () => Promise<boolean>

Defined in: core/source/html.ts:75

See: #core/ISourceHtml#isBrowser60FPS isBrowser60FPS

Promise<boolean>

ISourceHtml.isBrowser60FPS


isBrowserJSEnabled: () => Promise<boolean>

Defined in: core/source/html.ts:115

See: #core/ISourceHtml#isBrowserJSEnabled isBrowserJSEnabled

Promise<boolean>

ISourceHtml.isBrowserJSEnabled


isBrowserOptimized: () => Promise<boolean>

Defined in: core/source/html.ts:145

See: #core/ISourceHtml#isBrowserOptimized isBrowserOptimized

Promise<boolean>

ISourceHtml.isBrowserOptimized


isBrowserTransparent: () => Promise<boolean>

Defined in: core/source/html.ts:65

See: #core/ISourceHtml#isBrowserTransparent isBrowserTransparent

Promise<boolean>

ISourceHtml.isBrowserTransparent


isCustomCSSEnabled: () => Promise<boolean>

Defined in: core/source/html.ts:135

See: #core/ISourceHtml#isCustomCSSEnabled isCustomCSSEnabled

Promise<boolean>

ISourceHtml.isCustomCSSEnabled


isMute: () => Promise<boolean>

Defined in: core/source/html.ts:203

See: #core/IAudio#isMute isMute

Promise<boolean>

IAudio.isMute


isReloadOnSceneEnterEnabled: () => Promise<boolean>

Defined in: core/source/html.ts:165

See: #core/ISourceHtml#isReloadOnSceneEnterEnabled isReloadOnSceneEnterEnabled

Promise<boolean>

ISourceHtml.isReloadOnSceneEnterEnabled


isReloadOnShowEnabled: () => Promise<boolean>

Defined in: core/source/html.ts:155

See: #core/ISourceHtml#isReloadOnShowEnabled isReloadOnShowEnabled

Promise<boolean>

ISourceHtml.isReloadOnShowEnabled


isSourceAvailable: () => Promise<boolean>

Defined in: core/source/html.ts:173

See: #core/ISourceHtml#isSourceAvailable isSourceAvailable

Promise<boolean>

ISourceHtml.isSourceAvailable


isStreamOnlyAudio: () => Promise<boolean>

Defined in: core/source/html.ts:218

See: #core/IAudio#isStreamOnlyAudio isStreamOnlyAudio

Promise<boolean>

IAudio.isStreamOnlyAudio


loadConfig: () => Promise<any>

Defined in: core/source/html.ts:179

See: #core/ISourceConfigurable#loadConfig loadConfig

Promise<any>

ISourceConfigurable.loadConfig


refresh: () => Promise<Source>

Defined in: core/source/source.ts:326

See: #core/ISource#refresh refresh

Promise<Source>

Source.refresh


requestSaveConfig: (configObj) => Promise<HtmlSource>

Defined in: core/source/html.ts:189

See: #core/ISourceConfigurable#requestSaveConfig requestSaveConfig

any

Promise<HtmlSource>

ISourceConfigurable.requestSaveConfig


saveConfig: (configObj) => Promise<HtmlSource>

Defined in: core/source/html.ts:184

See: #core/ISourceConfigurable#saveConfig saveConfig

any

Promise<HtmlSource>

ISourceConfigurable.saveConfig


setAllowRightClick: (value) => Promise<HtmlSource>

Defined in: core/source/html.ts:100

See: #core/ISourceHtml#setAllowRightClick setAllowRightClick

boolean

Promise<HtmlSource>

ISourceHtml.setAllowRightClick


setAutoMute: (value) => Promise<HtmlSource>

Defined in: core/source/html.ts:215

See: #core/IAudio#setAutoMute setAutoMute

boolean

Promise<HtmlSource>

IAudio.setAutoMute


setBrowserCustomSize: (value) => Promise<HtmlSource>

Defined in: core/source/html.ts:90

See: #core/ISourceHtml#setBrowserCustomSize setBrowserCustomSize

Rectangle

Promise<HtmlSource>

ISourceHtml.setBrowserCustomSize


setBrowserJS: () => Promise<HtmlSource>

Defined in: core/source/html.ts:110

See: #core/ISourceHtml#setBrowserJS setBrowserJS

Promise<HtmlSource>

ISourceHtml.setBrowserJS


setCustomCSS: (value) => Promise<HtmlSource>

Defined in: core/source/html.ts:130

See: #core/ISourceHtml#setCustomCSS setCustomCSS

string

Promise<HtmlSource>

ISourceHtml.setCustomCSS


setCustomName: () => Promise<Source>

Defined in: core/source/source.ts:286

See: #core/ISource#setCustomName setCustomName

Promise<Source>

Source.setCustomName


setKeepLoaded: (value) => Promise<Source>

Defined in: core/source/source.ts:311

See: #core/ISource#setKeepLoaded setKeepLoaded

boolean

Promise<Source>

Source.setKeepLoaded


setMute: (value) => Promise<HtmlSource>

Defined in: core/source/html.ts:212

See: #core/IAudio#setMute setMute

boolean

Promise<HtmlSource>

IAudio.setMute


setName: (value) => Promise<Source>

Defined in: core/source/source.ts:276

See: #core/ISource#setName setName

string

Promise<Source>

Source.setName


setStreamOnlyAudio: (value) => Promise<HtmlSource>

Defined in: core/source/html.ts:221

See: #core/IAudio#setStreamOnlyAudio setStreamOnlyAudio

boolean

Promise<HtmlSource>

IAudio.setStreamOnlyAudio


setURL: () => Promise<HtmlSource>

Defined in: core/source/html.ts:60

See: #core/ISourceHtml#setURL setURL

Promise<HtmlSource>

ISourceHtml.setURL


setValue: (value) => Promise<Source>

Defined in: core/source/source.ts:301

See: #core/ISource#setValue setValue

string | XML

Promise<Source>

Source.setValue


setVolume: (value) => Promise<HtmlSource>

Defined in: core/source/html.ts:209

See: #core/IAudio#setVolume setVolume

number

Promise<HtmlSource>

IAudio.setVolume

static getAllSources(): 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
}
}
})

Promise<Source[]>

Source.getAllSources


static getCurrentSource(): 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
});

Promise<Source>

Source.getCurrentSource


static getItemList(): 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
})

Promise<Item[]>

Source.getItemList