Adding an Admin Panel
This guide will provide an explanation about adding an admin panel to the live streaming server. The admin panel allows you to browse the list of live streams, delete them, and preview the live streams via HTTP-FLV.
Step 1: Initialize a New Project and Add Required Packages
An admin panel is served by a middleware of ASP.NET Core. Create an empty ASP.NET Core Web application and add the necessary packages using the following commands:
dotnet new web
dotnet add package LiveStreamingServerNet
dotnet add package LiveStreamingServerNet.AdminPanelUI
dotnet add package LiveStreamingServerNet.Standalone
dotnet add package LiveStreamingServerNet.Flv
The LiveStreamingServerNet.AdminPanelUI
package is responsible for supplying the admin panel user interface. The LiveStreamingServerNet.Standalone
package delivers the Web API endpoints that the admin panel UI utilizes. Meanwhile, the LiveStreamingServerNet.Flv
package enables the HTTP-FLV preview functionality.
Step 2: Configure Your Live Streaming Server
Edit Program.cs
file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
This code adds the live streaming server to the ASP.NET Core web app, while the live streaming server will run in the background using port 1935. In addition, the web app will serve both HTTP-FLV and the admin panel UI, as well as the API endpoints required by the admin panel.
Step 3: Launch Your Live Streaming Server
Execute your live streaming server by running the following command:
dotnet run --urls="https://+:8080"
Now, your live streaming server should be running and ready to accept RTMP streams via port 1935, and you can visit the admin panel at https://localhost:8080/ui
.