Build a Simple Extension
Add source for a Hello World extension to your basic installation
To get started building simple extensions, we will modify the starter project to create a basic Panel Extension that lets a broadcaster set a “Message of the Day” for their viewers, and another extension for viewers that shows them the message.
This exercise uses two extensions that are part of the MEDKit Hello World Example. The Broadcast Live Dashboard extension is defined by 'src/live.htm', and the extension for viewers is defined by 'src/viewer.htm'.
-
Open the source file for the Broadcast Live Dashboard extension (or create a new Panel Extension).
-
Add a text input box and button to this extension so that a broadcaster will be able to enter some message text, and press the button to publish the message to all current viewers.
-
Open the source file for the Viewer extension (or create a new Panel Extension).
-
Use the example code to modify another extension that viewers will see. This code subscribes to the broadcast stream and displays messages when they arrive. New viewers who visit the channel will see the most recent message the broadcaster sent.
Updated almost 3 years ago