obsproject/obs-browser

Some Events (addEventListener) are not functioning in OBS30+

BarryCarlyon opened this issue · 2 comments

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

30.0.0

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/OHn6774kHAQOU11w

OBS Studio Crash Log URL

No response

Expected Behavior

Events work

Current Behavior

Most Events bound to addEventListener (on window) do not function/get called

The following still work/I've tested to still work:

  • obsSceneChanged
  • obsSourceVisibleChanged
  • obsSourceActiveChanged

(Tested most of the other events and nothing else seems to work, most notabled stream/recording starting/started/stopping/stopped which are the key events I utilise)

Steps to Reproduce

In a browser source use following example javascript code results in no console.log occuring indicating the event wasn't called.

    window.addEventListener('obsStreamingStarting', function() {
        console.log('OBS: obsStreamingStarting');
    });
    window.addEventListener('obsStreamingStarted', function() {
        console.log('OBS: obsStreamingStarted');
    });
    window.addEventListener('obsStreamingStopping', function() {
        console.log('OBS: obsStreamingStopping');
    });
    window.addEventListener('obsStreamingStopped', function() {
        console.log('OBS: obsStreamingStopped');
    });
    window.addEventListener('obsRecordingStarting', function() { console.log('OBS: obsRecordingStarting'); });
    window.addEventListener('obsRecordingStarted', function() { console.log('OBS: obsRecordingStarted'); });
    window.addEventListener('obsRecordingStopping', function() { console.log('OBS: obsRecordingStopping'); });
    window.addEventListener('obsRecordingStopped', function() { console.log('OBS: obsRecordingStopped'); });

Anything else we should know?

I tested this on

Control Level 2: Read Access to user information

and

Control Level 5: EVERYTHING (full access to OBS)

Under Control Level 5 the call to start/stop recording works via JavaScript so it seems that it is just the events side.

And/or using the UI buttons to start/stop recording/of streaming under control level 5 no console.log's occur/event emissions

I did not test every function jsut the listed "broken" ones above and obsSceneChanged

I just started noticing this issue within my own app; recently updated to OBS v30.

Scene changes are detected, but not the streaming state; tested with Twitch RTMP or WHIP outputs.

I can also confirm, I got the same issue as @BarryCarlyon.

If a log From Windows 11 is needed: https://obsproject.com/logs/Zm8XXkh7gUs4XBmy