A WHEP player web page for OBS Studio's browser source. It automatically starts playback of a WEHP stream (sent out from another instance of OBS Studio) with no mute.
- Clone this repository.
- Host the repository's root directory on a web server like
dotnet-serve
. - Access to the index.html with a browser.
No need of isntalling npm
or node.js
for using this project. As written in the Build section, just one thing to make the app work is to host the files on a web server.
If you want to edit the source code, then you need to run npm install
for setting up Unit Test environment.
See Testing section for details.
- Install
dotnet-serve
withdotnet tool install --global dotnet-serve
. - Run
dotnet serve
in the repository's root directory.- If you want to use a specific port, run
dotnet serve --port <port number>
. - If you want to use a specific hostname, run
dotnet serve --host <hostname>
. - If you want to use a specific hostname and port, run
dotnet serve --host <hostname> --port <port number>
. - If you want to open a Web Browser automatically, run
dotnet serve --open
. - If you want to host it with HTTPS, run
dotnet serve --tls
. Make it sure its certificate is trusted by the Web Browser. You can usedotnet dev-certs https --trust
to trust the certificate.
- If you want to use a specific port, run
- Access to the index.html with a browser, with some query parameters.
streamUrl
: The URL of the WHEP stream to open. It must be URL-encoded.volume
: The volume of the audio. It must be a number between 0 and 1. (default:1
)muted
: Whether the audio is muted. It must betrue
orfalse
.(default:flase
)autoplay
: Whether the video is automatically played. It must betrue
orfalse
. (default:true
)loop
: Whether the video is automatically looped. It must betrue
orfalse
. (default:false
)controls
: Whether the video controls are shown. It must betrue
orfalse
. (default:false
)debug
: Whether the debug information is shown. It must betrue
orfalse
. (default:false
, but it'strue
when the page is NOT opened by OBS Studio's browser source)
- This project utilizes JavaScript modules. You need to host the files on a web server to use them.
- Modern web browsers do not allow autoplay of media without user interaction. This application automatically mute the audio of the video element, when it's opened by Web Browser like Google Chrome, Microsoft Edge, etc.
- When the page is opened by OBS Studio's browser source, the audio is not muted. The player automatically detects that it's opened by OBS Studio's browser source, and unmute the audio.
This project uses Jest with Babel and jsdom, for testing.
Before running the tests, you need to install the dependencies.
Node.js v20.10.0
is used for the initial development phase so it'd be better to use the same version of nodejs.
npm install
npm test
It automatically collects code coverage information and generates a coverage report in the coverage
directory.
No need of running npm install
or npm run build
, as long as you don't edit the source code.
This project jsut works with the files checked into this repository. index.html
is the entry point of this project.