Updated:2026-05-25
Separate Beauty Effect Configuration for Hosts and Audiences of LetMagic Beauty SDK in UniApp Integrated with RongCloud Audio & Video When developing entertainment live streaming applications with UniApp, integrating RongCloud audio and video services for low-latency live interaction and embedding beauty SDK to enhance image quality are core business requirements. Distinguishing beauty effects between hosts and audiences serves as a critical detail to elevate live experience. Hosts demand delicate and natural beauty filters to attract viewers, while audiences prefer mild and authentic retouch for mic linking. Uniform beauty settings often lead to under-processed host images or overly distorted audience appearances, undermining user experience on both sides. This article shares practical implementation experience of differentiated beauty configuration from five dimensions: core design principles, role identification and stream binding, personalized parameter setup, full-process deployment and cross-platform optimization. All content fits actual development scenarios and can be directly applied to projects. I. Core Design Principles Differentiated beauty configuration is not mere parameter adjustment. It is designed around role positioning, usage scenarios and sensory experience to deliver rational classification, natural visuals and smooth operation. Three fundamental principles guide the whole development. First, effect differentiation matches role positioning. As the core of live streaming, hosts enjoy comprehensive beauty options covering skin texture refinement, facial contour optimization, skin smoothing, whitening, face slimming and virtual makeup with adjustable intensity. Audiences, as interactive participants, only access basic mild beautification to preserve facial features and authentic communication atmosphere. Second, independent configuration ensures controllability. Beauty parameters for hosts and audiences are stored and invoked separately to avoid mutual coverage and interference. Dynamic adjustment is supported. Hosts can customize exclusive styles, and audiences may turn mild beauty effects on or off freely. Third, collaborative linkage guarantees fluency. The configuration mechanism closely coordinates with UniApp page lifecycle, RongCloud stream transmission and beauty SDK initialization. Beauty effects switch synchronously without lag during role changes and mic connections, maintaining stable audio and video streaming. Developers shall focus on accurate role recognition, differentiated parameters, reasonable stream binding and cross-device compatibility to align with technical characteristics of UniApp and RongCloud. II. Premise: Role Identification and Accurate Audio & Video Stream Binding Distinguishing user roles and binding each role with exclusive audio and video streams lays the foundation for classified beauty rendering. The beauty SDK loads targeted parameters according to user identities. 1. Dual-verification Role Recognition Roles are judged combining user identity tags and real-time scene status to eliminate recognition errors. - Identity marking: The backend assigns a fixed host tag to live stream creators and viewer tags to entering users. The UniApp frontend obtains tags for preliminary judgment. - Scene status verification: Hosts hold live management authority and stay in broadcasting state. Viewers keep viewing or interacting status without management privileges, even when joining mic linking. Confirmed roles are saved in global state management modules for consistent access by all functional components. ### 2. Exclusive Stream Binding RongCloud allocates independent streams for each user. Hosts publish streams, audiences receive streams, and linked viewers both send and receive streams. 1. Acquire unique stream ID during stream initialization. Each ID corresponds to fixed user role and account. 2. Build a global mapping table associating roles, stream IDs and beauty parameters. The SDK queries matching settings quickly via stream identifiers. Relevant bindings update instantly when viewers switch mic linking status to avoid abnormal beauty display. III. Core Implementation: Differentiated Beauty Parameter Configuration Personalized parameter systems, initialization rules and dynamic updating strategies are formulated based on respective role demands. 1. Hierarchical Parameter System - Host parameters: Full-range adjustable beauty and makeup functions with intensity ranging from 0 to 100. Default values conform to public aesthetics and support personalized saving. - Audience parameters: Limited basic skin smoothing and whitening with maximum intensity capped at 60 to prevent excessive distortion. Only simple switches and fine tuning are available. Two independent parameter classes are created to standardize data format. 2. Role-based SDK Initialization 1. Monitor role status and stream readiness in page lifecycle functions. 2. Load corresponding preset or custom parameters and initialize the beauty SDK bound with target stream ID. Hide advanced adjustment entries for audience terminals. 3. Adopt Promise or callback mechanism to ensure beauty initialization completes before stream transmission starts. 3. Real-time Parameter Synchronization Host adjustments only apply to local publishing streams and synchronize to audience playback screens. Audience modifications take effect merely on personal views without influencing others. All updates run in child threads to prevent main thread blockage. IV. Four-step Deployment Process Step 1 Basic Environment Preparation Complete docking with RongCloud SDK and beauty SDK, design differentiated parameters and build global state management framework. ### Step 2 Role Recognition and Stream Binding Realize dual-verification judgment, obtain stream identifiers and establish global association mapping. ### Step 3 Differentiated Initialization and Update Develop role-based beauty loading logic and interactive adjustment interfaces, implement instant parameter synchronization. Step 4 Testing and Fine Optimization Verify effect classification under various live scenarios, optimize synchronization fluency and unify display performance across devices. V. Cross-platform Adaptation and Performance Optimization 1. Multi-device Compatibility Optimize rendering logic for Android and iOS, dynamically adjust rendering resolution and ensure stable SDK operation under different compilation modes. 2. Performance Tuning Enable GPU acceleration for host high-precision beautification, simplify audience rendering calculation and limit maximum frame rate on low-end devices to balance effect and power consumption. 3. Exception Handling Automatically switch to original video mode when SDK initialization fails. Refresh beauty settings timely responding to role switching and stream disconnection. VI. Conclusion The core of classified beauty configuration lies in precise role identification, independent parameter management, exclusive stream binding and cross-device adaptation. Reasonable differentiated schemes satisfy personalized aesthetic demands of hosts and audiences, improving overall live interaction experience. Developers shall coordinate the collaboration between UniApp, RongCloud and beauty SDK, and adjust functions according to actual business modes. Delicate classified beauty design effectively enhances product competitiveness and user retention.