Work continues on https://github.com/master312/SamplesApp
This project provides reusable Web Components for building WebRTC applications with Ant Media Server. Sample demonstrations using these components can be found in the /samples/ directory.
-
Fix 'stream-simple-state' bugs
-
Custom selector instead of <select> for dropdowns? So that it can be customised?
-
URL Parameter Handling?
-
Detailed docs for components?
-
Better organize simples or something?
-
Make sure to have AMS running on http://localhost:5080/WebRTCAppEE
-
Just serve it using any http server. Check out a simple python webserver in
./start_server.sh -
Enjoy the index.html!
Components can be styled by setting AntMediaCSSConfig.js configuration, or by overriding CSS paths directly on top of HTML file. See samples/css-customization.html for examples.
- Setup custom styling based on exmaple
- Import components as ES6 modules:
import { ComponentName } from './components/component-name.js' - Most components require a WebRTC adaptor instance via
setup(adaptor)method. See projects in/samples/for examples - Many components are self-managing and listen to adaptor events automatically (check individual component source files for specific behavior)
All components use CSS that can be overriden. Default CSS files are stored in ./components/styles/. You can always override those like shown in example below. The code responsible for managing this is in ./components/component-common.js
<!-- Load config first -->
<script src="AntMediaCSSConfig.js"></script>
<!-- Override default paths, or create your own custom AntMediaCSSConfig based on exisitng exmaple-->
<script>
window.AntMediaConfig.componentStyles['stream-controls'] = './my-custom.css';
</script>
<!-- Load components -->
<script type="module" src="components/stream-controls.js"></script>More details about individual component, see the component source files in the /components directory.
stream-controls- Stream ID input with start/stop togglestream-simple-state- Stream status and role display [BROKEN]video-view- Video player component
input-audio-selector- Audio device selectioninput-video-selector- Video device and screen sharing selectiontoggle-camera- Camera enable/disable buttontoggle-microphone- Microphone mute/unmute buttonresolution-selector- Stream resolution quality selection dropdown for play
advanced-audio-publisher-settings- Audio processing controls (noise suppression, gain)advanced-video-publisher-settings- Video configuration (bitrate configuration)virtual-background-manager- Background blur and custom imagesdeepar-effects-manager- DeepAR effects selection
stream-play-analytics- Real-time play statistics with chartsstream-publish-analytics- Real-time publish statistics with chartsmsg-display- WebRTC event logging and debugging
broadcast-browser- Live broadcast browsing with filtersvod-browser- VOD file browsing with paginationvod-uploader- File upload with drag-and-drop
data-channel-messaging- WebRTC data channel chatdata-channel-file-share- File sharing over WebRTC data channels with image previewcollaborative-canvas- Real-time collaborative drawing
component-common- CSS configuration utilities and common stuff