Python - pause the media playback of a source

GeorgK

New Member
Hy Erveryone!
I want to write a very simple script, that just sets the actual playing media file to PAUSE (the reason for this is, that it should be triggered from a remote app) . After searching and googeling for hours, i hope someone in the forum can give me a hint. I think it must be some function of output or buffer, but i am not able to find the right hint.
Is it possible to do that from python or lua?

Thx in advance, George
 

upgradeQ

Member
obs.obs_source_media_play_pause(t.source,false)
Yes it possible to pause a media source either from LuaJIT or Python.
For LuaJIT I've wrote obs-libre-macros where you can add console filter to a source and interact with it, so the right API call for your situation is: obs.obs_source_media_play_pause(t.source,false) - this will unpause it, if you call it with true - it will pause.
In Python it's the almost the same as here .
Not so long ago, obs-websoket 4.9.0 was released, its now includes media sources playback control - link
 
Top