FranckG28 / Live-URL-Switcher

A small tool to control the URL rendered in a page in real time. Useful for adding dynamic webviews to your livestreams.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Live URL Switcher

Manage in real time what URL is displayed on a source page.

Screenshot 2023-03-04 at 12 34 34

For example, this is useful for creating dynamic webviews in a livestream. Add the source page in the scene and the controller page in a panel in your broadcast software.

Note that this was my first Node.js project and one of my first in javascript. The code might be very messy and contains english and french. However, i've used in in real livestreams for one year without never encountering any problem.

Two ways of controlling the source

Controller

Add a set of predefined url and switch between them with a click

image

Paster

Just Ctrl+V any pasted URL to render it instantly on the source

image

Usage

  1. Install dependencies with npm :

    npm i
    
  2. Start the server. Execute run.bat on Windows or run the command

    node app
    
  3. The app will run on port 8000.

    You can have multiples sources/controllers runnings at the same time. Just specify the same id of your choice in both the admin and viewer URL.

    Controller URL (please read using controllers) : localhost:8000/url/controller/[id]

    Paster controller URL : localhost:8000/url/controller/[id]

    Source URL : localhost:8000/url/paster/[id]

Example : localhost:8000/url/controller/myliveview will control the url rendered on localhost:8000/url/source/myliveview

Using controller

This step is not required when using the paster.

Saved adresses are stored in a json file located in ./data/controllers/ directory. You need to create this directory by yourself

The app doesn't support automatic creation of the controller files, you need to create it manually:

When using a new id, create an empty [id].json file containing an empty object ({}) in it.

Example for id myliveview:

./data/controllers/myliveview.json

{}

About

A small tool to control the URL rendered in a page in real time. Useful for adding dynamic webviews to your livestreams.


Languages

Language:CSS 99.1%Language:JavaScript 0.7%Language:EJS 0.1%Language:Batchfile 0.0%