diff --git a/dist/change-obs-scene.amd.js b/dist/change-obs-scene.amd.js index 2177152..6323eef 100644 --- a/dist/change-obs-scene.amd.js +++ b/dist/change-obs-scene.amd.js @@ -1 +1 @@ -define("OBSWebSocket",["obs-websocket-js"],(function(e){"use strict";var n=new e;return function(){var e,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ws://localhost:4455",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];null!==t&&!1!==t&&""!==t||(t=void 0),n.on("ConnectionOpened",(function(){console.log("Connection Opened")})),n.on("Identified",(function(){console.log("Identified, good to go!"),n.call("GetSceneList").then((function(e){console.log("Scenes:",e),i(e,o)})).catch((function(e){console.error("Error on GetSceneList call:",e.code,e.message)}))})),n.connect(c,t).then((function(e){console.log("WOOHOO! We successfully connected to OBS WS Server ",e)}),(function(e){console.error("Failed to connect",e.code,e.message)}));var i=function(o,c){setInterval((function(){e=r(o,e,s);var c=o.scenes[e];n.call("SetCurrentProgramScene",{sceneName:c.sceneName}).then((function(){console.log("Switched to scene:",c.sceneName)})).catch((function(e){console.error("Error switching scenes:",e)}))}),1e3*c)},r=function(e,n,o){do{var c;n=null!==(c=n)&&void 0!==c?c:e.scenes.findIndex((function(n){return n.sceneName===e.currentProgramSceneName})),n=++n>=e.scenes.length?0:n}while(o.includes(e.scenes[n].sceneName));return n}}})); +define("OBSWebSocket",["obs-websocket-js"],(function(e){"use strict";var n=new e;return function(){var e,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ws://localhost:4455";null!==t&&!1!==t&&""!==t||(t=void 0),n.on("ConnectionOpened",(function(){console.log("Connection Opened")})),n.on("Identified",(function(){console.log("Identified, good to go!"),n.call("GetSceneList").then((function(e){console.log("Scenes:",e),i(e,o)})).catch((function(e){console.error("Error on GetSceneList call:",e.code,e.message)}))})),n.connect(s,t).then((function(e){console.log("WOOHOO! We successfully connected to OBS WS Server ",e)}),(function(e){console.error("Failed to connect",e.code,e.message)}));var i=function(o,t){setInterval((function(){e=r(o,e,c);var t=o.scenes[e];n.call("SetCurrentProgramScene",{sceneName:t.sceneName}).then((function(){console.log("Switched to scene:",t.sceneName)})).catch((function(e){console.error("Error switching scenes:",e)}))}),1e3*t)},r=function(e,n,o){do{var c;n=null!==(c=n)&&void 0!==c?c:e.scenes.findIndex((function(n){return n.sceneName===e.currentProgramSceneName})),n=++n>=e.scenes.length?0:n}while(o.includes(e.scenes[n].sceneName));return n}}})); diff --git a/dist/change-obs-scene.cjs.js b/dist/change-obs-scene.cjs.js index 2313f97..7213715 100644 --- a/dist/change-obs-scene.cjs.js +++ b/dist/change-obs-scene.cjs.js @@ -1 +1 @@ -"use strict";var e=new(require("obs-websocket-js"));module.exports=function(){var n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ws://localhost:4455",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];null!==t&&!1!==t&&""!==t||(t=void 0),e.on("ConnectionOpened",(function(){console.log("Connection Opened")})),e.on("Identified",(function(){console.log("Identified, good to go!"),e.call("GetSceneList").then((function(e){console.log("Scenes:",e),r(e,o)})).catch((function(e){console.error("Error on GetSceneList call:",e.code,e.message)}))})),e.connect(c,t).then((function(e){console.log("WOOHOO! We successfully connected to OBS WS Server ",e)}),(function(e){console.error("Failed to connect",e.code,e.message)}));var r=function(o,c){setInterval((function(){n=i(o,n,s);var c=o.scenes[n];e.call("SetCurrentProgramScene",{sceneName:c.sceneName}).then((function(){console.log("Switched to scene:",c.sceneName)})).catch((function(e){console.error("Error switching scenes:",e)}))}),1e3*c)},i=function(e,n,o){do{var c;n=null!==(c=n)&&void 0!==c?c:e.scenes.findIndex((function(n){return n.sceneName===e.currentProgramSceneName})),n=++n>=e.scenes.length?0:n}while(o.includes(e.scenes[n].sceneName));return n}}; +"use strict";var e=new(require("obs-websocket-js"));module.exports=function(){var n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ws://localhost:4455";null!==t&&!1!==t&&""!==t||(t=void 0),e.on("ConnectionOpened",(function(){console.log("Connection Opened")})),e.on("Identified",(function(){console.log("Identified, good to go!"),e.call("GetSceneList").then((function(e){console.log("Scenes:",e),r(e,o)})).catch((function(e){console.error("Error on GetSceneList call:",e.code,e.message)}))})),e.connect(s,t).then((function(e){console.log("WOOHOO! We successfully connected to OBS WS Server ",e)}),(function(e){console.error("Failed to connect",e.code,e.message)}));var r=function(o,t){setInterval((function(){n=i(o,n,c);var t=o.scenes[n];e.call("SetCurrentProgramScene",{sceneName:t.sceneName}).then((function(){console.log("Switched to scene:",t.sceneName)})).catch((function(e){console.error("Error switching scenes:",e)}))}),1e3*t)},i=function(e,n,o){do{var c;n=null!==(c=n)&&void 0!==c?c:e.scenes.findIndex((function(n){return n.sceneName===e.currentProgramSceneName})),n=++n>=e.scenes.length?0:n}while(o.includes(e.scenes[n].sceneName));return n}}; diff --git a/dist/change-obs-scene.esm.js b/dist/change-obs-scene.esm.js index 30f317f..74e2efe 100644 --- a/dist/change-obs-scene.esm.js +++ b/dist/change-obs-scene.esm.js @@ -1 +1 @@ -import e from"obs-websocket-js";var n=new e,o=function(){var e,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ws://localhost:4455",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];null!==t&&!1!==t&&""!==t||(t=void 0),n.on("ConnectionOpened",(function(){console.log("Connection Opened")})),n.on("Identified",(function(){console.log("Identified, good to go!"),n.call("GetSceneList").then((function(e){console.log("Scenes:",e),r(e,o)})).catch((function(e){console.error("Error on GetSceneList call:",e.code,e.message)}))})),n.connect(c,t).then((function(e){console.log("WOOHOO! We successfully connected to OBS WS Server ",e)}),(function(e){console.error("Failed to connect",e.code,e.message)}));var r=function(o,c){setInterval((function(){e=l(o,e,s);var c=o.scenes[e];n.call("SetCurrentProgramScene",{sceneName:c.sceneName}).then((function(){console.log("Switched to scene:",c.sceneName)})).catch((function(e){console.error("Error switching scenes:",e)}))}),1e3*c)},l=function(e,n,o){do{var c;n=null!==(c=n)&&void 0!==c?c:e.scenes.findIndex((function(n){return n.sceneName===e.currentProgramSceneName})),n=++n>=e.scenes.length?0:n}while(o.includes(e.scenes[n].sceneName));return n}};export{o as default}; +import e from"obs-websocket-js";var n=new e,o=function(){var e,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ws://localhost:4455";null!==t&&!1!==t&&""!==t||(t=void 0),n.on("ConnectionOpened",(function(){console.log("Connection Opened")})),n.on("Identified",(function(){console.log("Identified, good to go!"),n.call("GetSceneList").then((function(e){console.log("Scenes:",e),r(e,o)})).catch((function(e){console.error("Error on GetSceneList call:",e.code,e.message)}))})),n.connect(s,t).then((function(e){console.log("WOOHOO! We successfully connected to OBS WS Server ",e)}),(function(e){console.error("Failed to connect",e.code,e.message)}));var r=function(o,t){setInterval((function(){e=l(o,e,c);var t=o.scenes[e];n.call("SetCurrentProgramScene",{sceneName:t.sceneName}).then((function(){console.log("Switched to scene:",t.sceneName)})).catch((function(e){console.error("Error switching scenes:",e)}))}),1e3*t)},l=function(e,n,o){do{var c;n=null!==(c=n)&&void 0!==c?c:e.scenes.findIndex((function(n){return n.sceneName===e.currentProgramSceneName})),n=++n>=e.scenes.length?0:n}while(o.includes(e.scenes[n].sceneName));return n}};export{o as default}; diff --git a/package.json b/package.json index d4371c9..65b47f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@b3nelly/change-obs-scene", - "version": "1.2.0", + "version": "1.3.0", "description": "With just a few lines of code, automate changing your OBS scenes. Happy streaming! 💜", "author": "web3nelly", "license": "MIT", @@ -42,7 +42,7 @@ }, "homepage": "https://github.com/web3nelly/change-obs-scene#readme", "dependencies": { - "@b3nelly/change-obs-scene": "^1.2.0", + "@b3nelly/change-obs-scene": "^1.3.0", "obs-websocket-js": "^5.0.2" }, "devDependencies": {