The ARTC SDK for Web supports custom plug-ins for the name bar feature. A name bar is a text label overlaid on a video stream during a meeting or video chat that displays the username or other identification information.
Prerequisites
An application is created, and the application ID and AppKey are obtained.
The SDK is integrated. For more information, see Getting started with the ARTC Web SDK.
Implementation
Define a UserNamePlugin class that inherits AliRtcPlugin and implements its constructor and abstract methods.
Use the plug-in
The SDK provides the enablePlugin, setPluginOption, and removePlugin methods to manage plug-ins.
Enable the name bar plug-in
The following code displays the text Name bar A in the lower-right corner of the local video preview.
// instance indicates the AliRtcEngine instance.
instance.enablePlugin(new UserNamePlugin('Name bar A'));Update the name bar plug-in
The following code changes the displayed text to Name bar B.
// instance indicates the AliRtcEngine instance.
instance.setPluginOption('UserNamePlugin', { text: 'Name bar B' });Delete the name bar plug-in
The following code removes the name bar from the local video preview.
// instance indicates the AliRtcEngine instance.
instance.removePlugin('UserNamePlugin');FAQ
How do I troubleshoot low stream bitrate or playback stuttering after enabling the name bar?
If low stream bitrate or playback stuttering occur on the viewer side after enabling the name bar feature, troubleshoot the issue by performing the following steps:
On the Real-time Monitoring page in the ApsaraVideo Live console, check the Stream Ingest Statistics to verify whether the current average bitrate and frame rate are normal.
If the bitrate is significantly lower than the recommended value, try disabling the name bar feature and then stream again. This helps you determine whether feature stacking causes encoding resource strain.
Check whether the CPU usage of the stream ingest device, such as a mobile phone, is excessively high. Feature stacking may cause insufficient encoding performance on the device.
Verify that the local network bandwidth is sufficient. Local network congestion can also cause degraded stream quality and playback stuttering.