Skip to content
WarmUpTill edited this page Oct 14, 2022 · 2 revisions

Media condition

The "Media" macro condition allows you to check the state and current playback time of various media source types.

Source selection

Supported source types are:

  • Media Source
  • VLC Video Source
  • Image Slide Show

The source to test can be selected at (1).

Media1

State selection

The states that can be checked for are the following:

  • Playing
  • Opening
  • Buffering
  • Paused
  • Stopped
  • Ended
  • Ended (Playlist)
  • Any

The state to check for can be selected at (2).

Media2

Notes

  • Select "Any" if you would like to only test for conditions in the time selection.

  • The "Ended" will trigger when individual playlist items end when using VLC Video Sources.

  • The "Ended (Playlist)" state is intended to be used in combination with VLC Video Source playlists.
    It is not a media state natively supported by OBS and thus comes with some drawbacks. It works by checking if the selected media source reports the "ended" state for an extended period of time.
    Thus if VLC Video Source is configured to be continuously looping this state will not trigger.

    You can work around this limitation by using a macro to do the looping of the playlist instead and disabling the "Loop Playlist" of the VLC video source. VLCEndedExample

  • "Stopped" and "Ended" behave differently.
    The former is trigger if the playback is manually stopped using the media controls, the latter if the playback ended on its own.

  • Prior to OBS version 28.0.2 the media state reported by the Image Slide show was very inconsistent with what the source was actually doing. (E.g. would remain in Ended state even though the playback was restarted)

  • The different source types might behave sightly differently in regard to when which state is active so you might have to experiment a bit.

Time Selection

You will be able to check the total length of the media source and the remaining time of the current playback using the time selection at (3).

Media3

Notes

  • Select "None" if you would like to only test for conditions in the state selection.

Example guides

Explanations

Clone this wiki locally