npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nodecg-obs-scene

v6.1.7

Published

A NodeCG utility that provides a UI for configuring a connection to OBS via obs-websocket

Downloads

10

Readme

<nodecg-obs-scene> Bower version

nodecg-obs-scene is a Polymer element that provides realtime data bindings with information about a given scene in OBS Studio. It's made to be used with nodecg-utility-obs and nodecg-widget-obs.

For documentation on how to set up and use nodecg-utility-obs and nodecg-widget-obs, see nodecg-obs.

Requirements

  • NodeCG v0.9.x
  • nodecg-utility-obs and nodecg-widget-obs will also need to be added to your bundle. See the main nodecg-obs documentation for instructions on how to do that.

Install

nodecg-obs-scene should be installed as a dependency of your bundle.

Due to limitations of Bower, you'll need to install bower-npm-resolver to install nodecg-obs-scene.

  1. Install bower-npm-resolver via npm:
    cd nodecg/bundles/my-bundle
    npm install --save bower-npm-resolver
  2. Add bower-npm-resolver to a .bowerrc file in the root of your bundle (create it if it does not exist):
    {
       "resolvers": [
           "bower-npm-resolver"
       ]
    }
  3. Install nodecg-obs-scene via Bower
    bower install --save npm:nodecg-obs-scene

$ bower install --save nodecg-obs-scene

Table of Contents

Example

<link rel="import" href="../bower_components/nodecg-obs-scene/nodecg-obs-scene.html">

<!-- A simple example element that prints if a given OBS Studio scene is in "preview", "program", or "none". -->
<dom-module id="my-element">
    <template>
        <style>
            :host {
                display: block;
            }
        </style>
        
        <nodecg-obs-scene scene-name="test-scene" state="{{sceneState}}"></nodecg-obs-scene>
        <div>test-scene is currently in: [[sceneState]]</div>
    </template>
    
    <script>
        class MyElement extends Polymer.Element {
            static get is() { 
                return 'my-element';
            }
            
            static get properties() { 
                return {
                    sceneState: String
                };
            }
        }
        
        customElements.define(MyElement.is, MyElement);
    </script>
</dom-module>

Features

  • Realtime updates on the Preview/Program state of a scene, via either events or the state property.

Planned Features

  • None at this time, but there's a ton of things that this element could do if there's a strong case for it, such as:
    • Enumeration of sources in the scene
    • Two-way bindings of source properties, such as visibility, position, transform, etc.
    • A bunch more that I haven't thought of yet!

Events

<nodecg-obs-scene> will emit an event whenever the status of the scene specified by the sceneName property changes. There are three such events:

  • program
  • preview
  • none

You can listen to them with addEventListener or with Polymer's annotated event listeners:

sceneElement.addEventListener('program', () => { /* ... */ });
sceneElement.addEventListener('preview', () => { /* ... */ });
sceneElement.addEventListener('none', () => { /* ... */ });

You can also use the state-changed event emitted by Polymer, if you'd like to catch all state changes:

sceneElement.addEventListener('state-changed', e => {
	console.log(e.detail.value); // Will be one of "program", "preview", or "none".
});

Caveats

  • If a scene is in both Preview and Program, nodecg-obs-scene will always report it as being in Program.
  • You may need to call .refresh(true) on your instance of nodecg-obs-scene on initial page load, because the first state change event may happen before the rest of your code is ready.