diff --git a/README.md b/README.md index e4205d3..ab89c0c 100644 --- a/README.md +++ b/README.md @@ -27,17 +27,13 @@ Usage is very easy after you have setup the server at local network. The viewer 5. run `npm start` # Default usage -Viewer is located at: http://127.0.0.1:8000
-Admin interface is located at: http://127.0.0.1:8000/admin
+Viewer is located at: http://localhost:8000
+Admin interface is located at: http://localhost:8000/admin
Defaults to user: `admin`, pass: `admin`
It's highly encouraged to change the defaults to something else! # Local stream support for OBS -> Works only when config has `mediaServer` set to `true` -> if you have changed the default port from 8000, the admin interface can be found port +1 - -Stream admin interface is located at: http://127.0.0.1:8001/admin -Defaults to same admin username and password, which you connect to admin interface as well. +> Works only when config has `mediaServer` set to `true` at OBS go to: `Settings` -> `Stream`
set following options:
@@ -45,14 +41,16 @@ set following options:
|Setting|Value| |:---|:---| |Stream Type:| Custom Streaming Server| -|URL:| `rtmp://127.0.0.1/live`| +|URL:| `rtmp://localhost/live`| |Stream key:|`STREAM_NAME`| +Later it is possible to define other stream names/keys too, but for now only this one is supported. + # Environment variables |ENV|default|Usage| |:---|:---|:---| |PORT|8000|Server listen port| -|HOST|127.0.0.1|Host or ip from where to server is externally accessible| +|HOST|localhost|Host or ip from where to server is externally accessible| |ADMIN_USER|admin|Username to access admin interface| |ADMIN_PASS|admin|Password for the admin interface| diff --git a/app.js b/app.js index 2616f8b..73ed6fe 100644 --- a/app.js +++ b/app.js @@ -10,8 +10,8 @@ const EventEmitter = require('events'); let cookieParser = require('cookie-parser')(config.sessionKey); class Dispatcher extends EventEmitter {} + const eventDispatcher = new Dispatcher(); -const cli = require('./modules/cli'); let app = express(); let server = require('http').Server(app); @@ -59,7 +59,6 @@ if (config.mediaServer) { const NodeMediaServer = require('node-media-server'); const nodeServerConfig = { - logType: 2, rtmp: { port: 1935, chunk_size: 60000, @@ -70,19 +69,16 @@ if (config.mediaServer) { http: { port: (parseInt(config.serverListenPort) + 1), allow_origin: '*' - }, - auth: { - api : true, - api_user: config.admins[0].username, - api_pass: config.admins[0].password } }; let nms = new NodeMediaServer(nodeServerConfig); - nms.run(); + nms.run(); } + + i18next .use(FilesystemBackend) .use(i18nextMiddleware.LanguageDetector) diff --git a/modules/admin.js b/modules/admin.js index f1c6797..405db90 100644 --- a/modules/admin.js +++ b/modules/admin.js @@ -130,10 +130,11 @@ class admin { if (serverOptions.isStreaming === false) { serverOptions.loop = false; - serverOptions.streamSource = "http://" + config.serverHost + ":" + (parseInt(config.serverListenPort) + 1) + "/live/" + data.streamName + ".flv"; + serverOptions.streamSource = "http://" + config.serverHost + ":" + (config.serverListenPort + 1) + "/live/" + data.streamName + ".flv"; serverOptions.isStreaming = true; cli.success("start stream"); } else { + serverOptions.loop = true; serverOptions.isStreaming = false; serverOptions.streamSource = ""; diff --git a/package.json b/package.json index b8fbe1f..d2e2367 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "infoscreen3", - "version": "1.1.0", + "version": "1.2.0", "private": true, "scripts": { "start": "node --expose-gc ./bin/infoscreen3" diff --git a/public/js/edit.js b/public/js/edit.js index 75a1e0d..abfb82a 100644 --- a/public/js/edit.js +++ b/public/js/edit.js @@ -194,7 +194,7 @@ function undo() { if (bundleData.styleHeader.fontSize !== fontSize) { object.setOptions({fontSize: fontSize}); } - if (bundleData.styleHeader.stroke !== "") { + if (bundleData.styleHeader.fill !== "") { object.setShadow({color: "rgba(0,0,0,0.6)", blur: 5, offsetX: 2, offsetY: 2}); } } else { @@ -202,7 +202,7 @@ function undo() { if (bundleData.styleText.fontSize !== fontSize) { object.setOptions({fontSize: fontSize}); } - if (bundleData.styleText.stroke !== "") { + if (bundleData.styleText.fill !== "") { object.setShadow({color: "rgba(0,0,0,0.6)", blur: 5, offsetX: 2, offsetY: 2}); } } @@ -476,7 +476,7 @@ function nextSlide(data) { if (bundleData.styleHeader.fontSize !== fontSize) { object.setOptions({fontSize: fontSize}); } - if (bundleData.styleHeader.stroke !== "") { + if (bundleData.styleHeader.fill !== "") { object.setShadow({color: "rgba(0,0,0,0.6)", blur: 5, offsetX: 2, offsetY: 2}); } } else { @@ -484,7 +484,7 @@ function nextSlide(data) { if (bundleData.styleText.fontSize !== fontSize) { object.setOptions({fontSize: fontSize}); } - if (bundleData.styleText.stroke !== "") { + if (bundleData.styleText.fill !== "") { object.setShadow({color: "rgba(0,0,0,0.6)", blur: 5, offsetX: 2, offsetY: 2}); } } @@ -558,12 +558,10 @@ function addText(content, isHeader) { y = 30; } - var needShadow = bundleData.styleText.stroke === "" ? true : false; if (isHeader) { text.id = "header"; text.setOptions(bundleData.styleHeader); text.setOptions({top: y + 10, left: 150}); - needShadow = bundleData.styleHeader.stroke === "" ? true : false; } else { text.setOptions(bundleData.styleText); text.setOptions({top: y + 10, left: 250}); @@ -573,9 +571,8 @@ function addText(content, isHeader) { text.hasControls = false; text.lockUniScaling = true; text.hasRotatingPoint = false; - if (needShadow) { - text.setShadow({color: "#000", blur: 5, offsetX: 2, offsetY: 2}); - } + + text.setShadow({color: "#000", blur: 5, offsetX: 2, offsetY: 2}); canvas.add(text); } @@ -788,8 +785,8 @@ function saveAsFullScreenImage(name = "untitled", imageData) { objects: [{ type: "image", version: "2.6.0", - width: 1920, - height: 1080, + width: 1280, + height: 720, crossOrigin: "", src: dataurl, filters: [] diff --git a/public/js/preview.js b/public/js/preview.js index 85bee2a..c199b86 100644 --- a/public/js/preview.js +++ b/public/js/preview.js @@ -138,7 +138,7 @@ function fixCanvas() { width = con.innerWidth(), height = Math.floor(width * aspect); - canvas.setWidth(1920).setHeight(1080); + canvas.setWidth(1280).setHeight(720); $("#c").css("width", width + "px").css("height", height + "px"); canvas.calcOffset(); } diff --git a/views/admin/editSlide.twig b/views/admin/editSlide.twig index 7f956ce..18718c1 100644 --- a/views/admin/editSlide.twig +++ b/views/admin/editSlide.twig @@ -13,7 +13,10 @@ color: white; } - canvas { + canvas { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -moz-font-smoothing: antialiased; font-smoothing: antialiased; text-rendering: geometricPrecision; font-smooth: always; @@ -186,7 +189,7 @@
- +
@@ -231,7 +234,7 @@
- +