Skip to main content

MediaSource <Filters>

Hierarchy

Index

Constructors

constructor

Properties

audioMonitorType

audioMonitorType: MonitoringType = MonitoringType.None

audioSyncOffset

audioSyncOffset: number = 0

filters

filters: Filter<Settings, Source<{}>>[] = []

itemInstances

itemInstances: Set<SceneItem<Source<{}>, Scene<{}, {}>>> = ...

kind

kind: string

linked

linked: boolean = false

muted

muted: boolean = false

name

name: string

obs

obs: OBS

settings

settings: { buffering_mb?: number; clear_on_media_end?: boolean; close_when_inactive?: boolean; color_range?: ColorRange; hw_decode?: boolean; input?: string; input_format?: string; is_local_file?: boolean; linear_alpha?: boolean; local_file?: string; looping?: boolean; reconnect_delay_sec?: number; restart_on_activate?: boolean; seekable?: boolean; speed_percent?: number } = ...

Set transitively in initialize if source exists Set manually in createFirstSceneItem if source doesn’t exist


Type declaration

  • optionalbuffering_mb?: number
  • optionalclear_on_media_end?: boolean
  • optionalclose_when_inactive?: boolean
  • optionalcolor_range?: ColorRange
  • optionalhw_decode?: boolean
  • optionalinput?: string
  • optionalinput_format?: string
  • optionalis_local_file?: boolean
  • optionallinear_alpha?: boolean
  • optionallocal_file?: string
  • optionallooping?: boolean
  • optionalreconnect_delay_sec?: number
  • optionalrestart_on_activate?: boolean
  • optionalseekable?: boolean
  • optionalspeed_percent?: number

volume

volume: { db?: number; mul?: number } = ...

Type declaration

  • db: number
  • mul: number

Accessors

exists

  • get exists(): boolean
  • Whether this source has at least one scene item in OBS


    Returns boolean

initialized

  • get initialized(): boolean
  • Whether initialize has been called on this source yet


    Returns boolean

Methods

addFilter

  • addFilter(ref: string, filter: Filter<Settings, Source<{}>>): Promise<void>
  • Adds a filter to this source, provided that 1. The filter has not already been applied to another source, and 2. The source in OBS does not have a filter with a different type but the same name as the filter being added.


    Parameters

    Returns Promise<void>

createSceneItemObject

  • Overridable function for creating SceneItem instances for a source. Doesn’t create any objects in OBS. Instead, creates SceneItem objects that can override default SceneItem behaviours.


    Parameters

    • scene: Scene<{}, {}>
    • id: number
    • ref: string

    Returns SceneItem<MediaSource<Filters>, Scene<{}, {}>>

    An instance of SceneItem or a class that extends it.

endedListener

  • endedListener(args: {}): void
  • Parameters

    • args: {}

    Returns void

fetchExists

  • fetchExists(): Promise<boolean>
  • Returns Promise<boolean>

fetchProperties

  • fetchProperties(): Promise<void>
  • Fetches the input’s mute, volume, audio sync offset and audio monitor type from OBS and assigns them to the input


    Returns Promise<void>

filter

  • filter<R>(ref: R): Filters[R]
  • filter(ref: string): undefined | Filter<Settings, Source<{}>>
  • Gets a filter from the input by its ref


    Type parameters

    • R: string | number | symbol

    Parameters

    • ref: R

    Returns Filters[R]

getDefaultSettings

getPrivateSettings

  • getPrivateSettings(): Promise<Settings>
  • 8 Get a source’s private settings. This is an UNDOCUMENTED request of obs-websocket, and SHOULD NOT be used unless you know what you’re doing.


    Returns Promise<Settings>

initialize

  • initialize(obs: OBS): Promise<void>
  • Parameters

    Returns Promise<void>

off

  • off(event: keyof MediaSourceEvents, fn: () => void): EventEmitter<string | symbol, any>
  • Parameters

    Returns EventEmitter<string | symbol, any>

on

  • on(event: keyof MediaSourceEvents, fn: () => void): EventEmitter<string | symbol, any>
  • Parameters

    Returns EventEmitter<string | symbol, any>

once

  • once(event: keyof MediaSourceEvents, fn: () => void): EventEmitter<string | symbol, any>
  • Parameters

    Returns EventEmitter<string | symbol, any>

remove

  • remove(): Promise<void>
  • Returns Promise<void>

setAudioMonitorType

  • Parameters

    Returns Promise<void>

setAudioSyncOffset

  • setAudioSyncOffset(offset: number): Promise<void>
  • Parameters

    • offset: number

    Returns Promise<void>

setMuted

  • setMuted(muted: boolean): Promise<void>
  • Parameters

    • muted: boolean

    Returns Promise<void>

setName

  • setName(name: string): Promise<void>
  • Parameters

    • name: string

    Returns Promise<void>

setPrivateSettings

  • setPrivateSettings(settings: Settings): Promise<void>
  • Set a source’s private settings. This is an UNDOCUMENTED request of obs-websocket, and SHOULD NOT be used unless you know what you’re doing.


    Parameters

    • settings: Settings

    Returns Promise<void>

setSettings

  • setSettings(settings: { buffering_mb?: number; clear_on_media_end?: boolean; close_when_inactive?: boolean; color_range?: ColorRange; hw_decode?: boolean; input?: string; input_format?: string; is_local_file?: boolean; linear_alpha?: boolean; local_file?: string; looping?: boolean; reconnect_delay_sec?: number; restart_on_activate?: boolean; seekable?: boolean; speed_percent?: number }, overlay?: boolean): Promise<void>
  • Parameters

    • settings: { buffering_mb?: number; clear_on_media_end?: boolean; close_when_inactive?: boolean; color_range?: ColorRange; hw_decode?: boolean; input?: string; input_format?: string; is_local_file?: boolean; linear_alpha?: boolean; local_file?: string; looping?: boolean; reconnect_delay_sec?: number; restart_on_activate?: boolean; seekable?: boolean; speed_percent?: number }
    • overlay: boolean = true

    Returns Promise<void>

setVolume

  • setVolume(data: { db?: number; mul?: number }): Promise<void>
  • Parameters

    • data: { db?: number; mul?: number }

    Returns Promise<void>

startedListener

  • startedListener(args: {}): void
  • Parameters

    • args: {}

    Returns void

toggleMuted

  • toggleMuted(): Promise<boolean>
  • Returns Promise<boolean>