Request for video media source - pause and unpause when showing/hiding

dcmouser

Member
When you add a (video) media source, you get options to: Loop, Restart playback when source becomes active, Close file when inactive.

To save valuable resources, I typically enable this latter option so that when I switch away from a scene with a video it unloads.
But I'd love when I switch back to the scene containing that video source, for it to RESUME playing where it left off when I last switched away from it.

ACTUALLY:
It seems like OBS actually IGNORES the option to "Close file when inactive" if you don't also check the option to "Restart playback", which you can see if you use exeldro's Media Controls plugins (you can see that the file continues playing even when you switch away).

SO
I'd like to propose that this request doesn't even need any new UI options, and that OBS should simply obey the combination of UNCHECKING restart playback and CHECKING "close file when inactive", and in this case implement this by in fact PAUSING the video in this case when switching away, and unpausing it when switching back (or behind the scenes closing and re-seeking on play).
 

dcmouser

Member
Ok I've modified the appropriate source code (obs-ffmpeg-source.c) to support auto pausing and unpausing of video sources on deactivate-activate, using a new option for video sources.. I just have to figure out how to suggest the change in github.
 

dcmouser

Member
Note that upon further consideration my original request to use the combination of unchecking "restart playback" and checking "close file when inactive", doesn't quite make sense. Restart playback is a bit of a bad label for the option, what it really says to do is start playing when the source is made active. So if it is unchecked, the proper behavior is probably to do nothing when switching to it.

That's why I ended up adding a new option for pause and resume.
 

nunowonder

New Member
Hi!
I am having the same problem, I wish the Media sources had the option to "Start Manually" also. I mean, the " Restart playback when source becomes active" is excellent for sources that we want to launch the media automatically, so if I uncheck it, it´s ok, it won´t play if source becomes active, BUT, when I start OBS, all media sources that are not "Restart playback when source becomes active" just starts playing and that´s annoying, because I have to go to all scenes and stop them. What can I do?
 

goodastruff

New Member
Hi, I need this feature. Actually, with the VLC Video Source, it do exactly what we need, but there is some kind of buffering delay with the audio. This cause a problem during scene switch (the audio come 2 seconds after the image and make this source unusable). Is it possible to put this simple option for the Media Control source please ? Thanks you...
 
Top