obsproject / obs-browser

CEF-based OBS Studio browser plugin
GNU General Public License v2.0
783 stars 225 forks source link

Getting the OBS name of the source #74

Open paul-lrr opened 7 years ago

paul-lrr commented 7 years ago

The getCurrentSource() method gives info on the current OBS scene, but is there any way to get the name in OBS of the BrowserSource itself? Not the or the url of the html file but the name it has been given in the Sources listing.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/SReject"><img src="https://avatars.githubusercontent.com/u/1975663?v=4" />SReject</a> commented <strong> 7 years ago</strong> </div> <div class="markdown-body"> <p>There currently isn't a way.<br /> Just a critique, the method is <code>.getCurrentScene()</code> </p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/paul-lrr"><img src="https://avatars.githubusercontent.com/u/11876694?v=4" />paul-lrr</a> commented <strong> 7 years ago</strong> </div> <div class="markdown-body"> <blockquote> <p>Just a critique, the method is .getCurrentScene()</p> </blockquote> <p>Oops! Subconscious wishful thinking on my part, I guess 😄 </p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/paul-lrr"><img src="https://avatars.githubusercontent.com/u/11876694?v=4" />paul-lrr</a> commented <strong> 7 years ago</strong> </div> <div class="markdown-body"> <p>On a related note, it would be useful to have something like <code>getSourceScene()</code> so that a source could know what scene(s) it has been added to. Combined with <code>getCurrentScene()</code> it would allow a source to do something when its scene becomes active. </p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/OsirisNL"><img src="https://avatars.githubusercontent.com/u/5693027?v=4" />OsirisNL</a> commented <strong> 7 years ago</strong> </div> <div class="markdown-body"> <p>A source can already do something when it's scene becomes active. There's already an event for scene changes.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/paul-lrr"><img src="https://avatars.githubusercontent.com/u/11876694?v=4" />paul-lrr</a> commented <strong> 7 years ago</strong> </div> <div class="markdown-body"> <p>There is the event for scene changes, but is there a way to tell if the scene it changed to is the one that the source is on?</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/OsirisNL"><img src="https://avatars.githubusercontent.com/u/5693027?v=4" />OsirisNL</a> commented <strong> 7 years ago</strong> </div> <div class="markdown-body"> <p>That would only be useful if the source doesn't have "shutdown when not visible" checked though?</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/macharborguy"><img src="https://avatars.githubusercontent.com/u/3058330?v=4" />macharborguy</a> commented <strong> 7 years ago</strong> </div> <div class="markdown-body"> <blockquote> <p>That would only be useful if the source doesn't have "shutdown when not visible" checked though?</p> </blockquote> <p>Actually, letting a source know if it is or is not on the current scene is useful if you want a source that is still running when not on the scene, but not to output audio.</p> <p>Example, part of our on-screen chat widget is a popup when a user mentions us on twitter and displays a thank you, and makes a noise as well.</p> <p>rather than unloading the whole widget, and reloading it when i go back to the scene, i used to use (in OBS Classic), OBS Remote to determine if the widget was still in the current scene, and if it wasn't, it would mute all audio alerts so we could have "quiet" scenes</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/paul-lrr"><img src="https://avatars.githubusercontent.com/u/11876694?v=4" />paul-lrr</a> commented <strong> 3 years ago</strong> </div> <div class="markdown-body"> <p>I was just wondering if there has been any more thought about this feature. A browser source being able to know its own obs name and what scene(s) it appears on would be very useful. Aside from the use case above (allowing a source to do something when it is being displayed on the current scene), I was recently thinking that a browser source could use obs-websocket to do advanced manipulation of itself (eg. scale, crop, rotate, apply filters, etc) but ran into the issue that a browser source doesn't actually know any obs-specific information about itself. If it knew its obs name or item id, I could use that info to target the source with obs-websocket, but as it is, I can't see a way for a given browser source to find itself in the list of obs sources.</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>