The Live Streaming Controller is a subset of a three-part application designed to view a stream of one or more live events on Azure Media Services. These parts are:
- Live Streaming API: Turn on or off one more live events on Azure Media Services
- Live Streaming Controller: A simple tool for the event broadcaster to interface with the Live Streaming API
- Stream Switch: A front-end, viewer application for viewing one or more live streams on a website
In production, an event broadcaster would use the Live Streaming Controller as a front-end application to make a POST
call to the /broadcaster
endpoint, a DELETE
call to the /broadcaster
, and a GET
call to the /broadcaster
endpoint on the Live Streaming API to respectively start the streaming services at the beginning of an event, stop the services at the end, and read the status of these resources at any point before, during, or after. All of these calls are authenticated, since they can reveal sensitive information about the state of your resources, or result in a state change, and thus a billing change, on the broadcaster's Azure account.
A viewer would then go to a website which has the Stream Switch installed to view the event. That application calls the /locators
endpoint to fetch the streaming URLs from Azure to play inside of an HTML5 video player on the web. Since this endpoint intended for public consumption, it is the only endpoint in the API which is not authenticated.
This portion of the application trio focuses on turning on and off the live streaming services on Azure. All of the technical complexity of the service orchestration and ordering is abstracted behind a simple toggle button. Simply press the switch to turn it and all of the necessary services on in Azure, and press the switch again to turn them all off. This simplistic approach empowers a non-technical live event broadcaster to quickly get one or more of their live events online within seconds.
Please note that the Live Streaming Controller is not a standalone application. It requires an instance of the Live Streaming API to be installed on Azure Functions to directly control the services, and that the Stream Switch is installed on a website so that viewers may watch a live event. Please follow the directions at each of the above links prior to continuing.
Since this application controls sensitive pieces of information about your live events on Azure, it is required that you have an access key to indicate that you are authorized to make these kinds of changes to your Azure account.
- Go to the Azure Portal
- Go to the Azure Function Apps
- Open up the application which has an installation of the Live Streaming API
- Click on the App Keys tab
- Click on the New Host Key button
- Give this key a name, such as
Live Streaming Controller
, and click OK - Copy the value of this key to your clipboard. You'll need this value when setting up the Live Streaming Controller.
Once the other applications are set up, you may install this application.
- Download and install this app from the Microsoft Store
- Open up the application
- Click on the three dots at the top-right of the window, then go to Settings
- Enter the name of the domain where the Live Streaming API is hosted, such as
livestreamingapi.mychurch.com
. If you installed the API on Azure function and did not use a custom domain, the domain name will look likeXXXXXX.azurewebsites.net
. - Enter the Streaming Endpoint name, as shown in the Azure Portal. The Streaming Endpoint name is available under the Streaming Endpoints tab in the Media Service resource you created on Azure.
- Enter the Live Event names, as shown in the Azure Portal. If you have more than one live event to turn on and off in unison, simply seperate each name with a comma, such as
audio,video
. The Live Event names are avaialble under the Live Streaming > Live Events tab in the Media Service resource you created on Azure. - Enter the API Key you created in the Azure Portal into this field
- The Polling Interval is optional. Check the Enabled checkbox and enter a positive number in the number field to configure how often the controller checks for status changes, in case another event broadcaster makes changes to the streaming services.
- Save the form
In addition to the listing on the Microsoft Store, here are a few screenshots of the application at work.
This application was inspired by a need for the live streaming pipeline we use at Literal Life Church
Contributors: