Warmuptill
Active Member
If a VLC source is containing a playlist that is looping forever it will never reach the state "ended" or "played to end". (Or at least that is my assumption)I have the same problem as mr. Urbanian.
My goal was to make promo inserts between the clips from the playlist.
The workaround is as follows:
Two scenes, A (A: VLC source with playlist; loop; paused on hiding)
And B (B: Source with simple media source with promo; restart on active)
I made two macros:
1) From A to B: If A:VLCSource is "ended" - switch to scene B
2) From B to A: If B:Source is "ended" - switch to scene A.
And it wasn't works. Plugin even not switched scene A to B at all. Only B to A.
Already I've tried use not macros but Media rules instead. They not work at all (tested with "ended" and "played to end" events)
BUT! I've founded the solution "from the reverse"
I changed macros 1) to next:
Code:From A to B: If A:VLCSource is "playing" and "time remaining shorter" than 1-2 second: switch to scene B, switch next track in A:VLCSource, pause it at the moment.
Therefore, I came to the conclusions:
a) the "ended" event does not work for VLC Source (OBS level or plugin?)
b) Media rules do not work properly
c) When the "loop" setting is enabled in VLC, the "played to ended" event does not work either.
As you have correctly identified you can use the "time remaining shorter" to identify individual playlist items coming to an end.
If you have suggestions on how to make this more clear I am all ears! :)
Should I maybe introduce a separate state called "playlist item ended" or something similar?
Below is an example on how to set up automated commercial breaks on fixed interval, but not interrupting individual playlist items.
Hope that helps.
I know you have already set up your media source correctly but for completeness in case others want to replicate the setup:
The important part is the "Pause if not visible, unpause when visible" so that the playback does not restart when switching away and back to the scene containing the VLC source.
Next we will need two macros.
- The first macro is responsible for detecting when a transition to the next playlist item takes place and if the specified time interval, after which a commercial shall be played, has passed.
If both are the case a scene switch will take place.
You can find a screenshot of the settings I used here:
- The second macro is only responsible for automatically switching back to the scene containing the VLC video source playing back the playlist.
A screenshot of the settings I used for testing can be found here:
Note that the media action is probably not strictly necessary, but I added it just in case.