Skip to content

ReplaySource

Defined in: core/source/replay.ts:38

The ReplaySource class represents the sources of the replay 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 ReplayItem class. See: #core/ReplayItem Core/ReplayItem

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.ReplaySource) {
// Manipulate your game source here
sources[i].setSilenceDetectionEnabled(true);
}
}
})
})

All methods marked as Chainable resolve with the original ReplaySource instance.

  • IAudio
  • ISourceReplay

new ReplaySource(props?): ReplaySource

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

ReplaySource

Source.constructor

getChannel: () => Promise<string>

Defined in: core/source/replay.ts:42

See: #core/ISourceReplay#getChannel getChannel

Promise<string>

ISourceReplay.getChannel


getCustomName: () => Promise<string>

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

See: #core/ISource#getCustomName getCustomName

Promise<string>

Source.getCustomName


getHotkey: () => Promise<number>

Defined in: core/source/replay.ts:48

See: #core/ISourceReplay#getHotkey getHotkey

Promise<number>

ISourceReplay.getHotkey


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


getReplayState: () => Promise<number>

Defined in: core/source/replay.ts:66

See: #core/ISourceReplay#getReplayState getReplayState

Promise<number>

ISourceReplay.getReplayState


getReplayTime: () => Promise<number>

Defined in: core/source/replay.ts:54

See: #core/ISourceReplay#getReplayTime getReplayTime

Promise<number>

ISourceReplay.getReplayTime


getType: () => Promise<ItemTypes>

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

See: #core/ISource#getType getType

Promise<ItemTypes>

Source.getType


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/replay.ts:77

See: #core/IAudio#getVolume getVolume

Promise<number>

IAudio.getVolume


isAudioAvailable: () => Promise<boolean>

Defined in: core/source/replay.ts:101

See: #core/IAudio#isAudioAvailable isAudioAvailable

Promise<boolean>

IAudio.isAudioAvailable


isAutoMute: () => Promise<boolean>

Defined in: core/source/replay.ts:83

See: #core/IAudio#isAutoMute isAutoMute

Promise<boolean>

IAudio.isAutoMute


isAutostartOnSceneLoad: () => Promise<boolean>

Defined in: core/source/replay.ts:69

See: #core/ISourceReplay#isAutostartOnSceneLoad isAutostartOnSceneLoad

Promise<boolean>

ISourceReplay.isAutostartOnSceneLoad


isMute: () => Promise<boolean>

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

See: #core/IAudio#isMute isMute

Promise<boolean>

IAudio.isMute


isStreamOnlyAudio: () => Promise<boolean>

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

See: #core/IAudio#isStreamOnlyAudio isStreamOnlyAudio

Promise<boolean>

IAudio.isStreamOnlyAudio


refresh: () => Promise<Source>

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

See: #core/ISource#refresh refresh

Promise<Source>

Source.refresh


setAutoMute: (value) => Promise<ReplaySource>

Defined in: core/source/replay.ts:92

See: #core/IAudio#setAutoMute setAutoMute

boolean

Promise<ReplaySource>

IAudio.setAutoMute


setAutostartOnSceneLoad: (value) => Promise<ReplaySource>

Defined in: core/source/replay.ts:72

See: #core/ISourceReplay#setAutostartOnSceneLoad setAutostartOnSceneLoad

boolean

Promise<ReplaySource>

ISourceReplay.setAutostartOnSceneLoad


setChannel: (channel) => Promise<ReplaySource>

Defined in: core/source/replay.ts:45

See: #core/ISourceReplay#setChannel setChannel

string

Promise<ReplaySource>

ISourceReplay.setChannel


setCustomName: () => Promise<Source>

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

See: #core/ISource#setCustomName setCustomName

Promise<Source>

Source.setCustomName


setHotkey: (hotkey) => Promise<ReplaySource>

Defined in: core/source/replay.ts:51

See: #core/ISourceReplay#setHotkey setHotkey

number

Promise<ReplaySource>

ISourceReplay.setHotkey


setKeepLoaded: (value) => Promise<Source>

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

See: #core/ISource#setKeepLoaded setKeepLoaded

boolean

Promise<Source>

Source.setKeepLoaded


setMute: (value) => Promise<ReplaySource>

Defined in: core/source/replay.ts:89

See: #core/IAudio#setMute setMute

boolean

Promise<ReplaySource>

IAudio.setMute


setName: (value) => Promise<Source>

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

See: #core/ISource#setName setName

string

Promise<Source>

Source.setName


setReplayTime: (buffer) => Promise<ReplaySource>

Defined in: core/source/replay.ts:57

See: #core/ISourceReplay#setReplayTime setReplayTime

number

Promise<ReplaySource>

ISourceReplay.setReplayTime


setStreamOnlyAudio: (value) => Promise<ReplaySource>

Defined in: core/source/replay.ts:98

See: #core/IAudio#setStreamOnlyAudio setStreamOnlyAudio

boolean

Promise<ReplaySource>

IAudio.setStreamOnlyAudio


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<ReplaySource>

Defined in: core/source/replay.ts:86

See: #core/IAudio#setVolume setVolume

number

Promise<ReplaySource>

IAudio.setVolume


startReplay: () => Promise<ReplaySource>

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

See: #core/ISourceReplay#startReplay startReplay

Promise<ReplaySource>

ISourceReplay.startReplay


stopReplay: () => Promise<ReplaySource>

Defined in: core/source/replay.ts:63

See: #core/ISourceReplay#stopReplay stopReplay

Promise<ReplaySource>

ISourceReplay.stopReplay

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