aliplayer_widget-v7.9.0
[7.9.0] – Slot System for Full UI Customization & Documentation Restructure
New Features
Slot-Based UI Customization System
Introduced a powerful slot system to enable fine-grained, component-level customization of the player UI:
- Provides dedicated slots for key UI regions such as:
• Top bar, bottom bar, play controls
• Cover image, subtitles, setting menu
• Center feedback (volume/brightness/seek), seek thumbnail, play state display
• Overlay layer for custom business widgets (e.g., like/share/comment, badges, watermarks) - Each slot can be:
• Left as default (built-in UI)
• Replaced with a custom builder
• Explicitly disabled (hidden) when not needed - Enables easy creation of different player themes (minimal, classic, short-video style, etc.) and injection of business-specific UI without modifying core player logic.
Overlay Slot Unification
Consolidated all overlay-related customization into a dedicated overlays slot, unifying floating UI components under the new slot mechanism. This provides a clearer and more extensible way to manage all overlay elements on top of the video surface.
Improvements
Backward-Compatible Overlay Usage
Existing usage of the overlays parameter remains fully supported to ensure compatibility with older integrations. Internally, overlays are now unified with the slot-based architecture, simplifying future UI extensions and maintenance.
Documentation Restructure (docs/ Directory)
Reorganized documentation into modular, topic-focused guides under docs/, including:
- Integration Guide
- Quick Start
- Core Components
- API Reference
- Advanced Features (e.g., video source types, overlays/slot system)
The main README (EN & CN) is now lighter and serves primarily as an entry point, linking to these dedicated documents instead of embedding all details inline.
Practical Examples
Added comprehensive usage examples in example/lib/pages/slot/slot_demo_page.dart, demonstrating:
- Implementation of modern, classic, and minimalist UI styles
- Customization of top bar, bottom bar, and play control slots
- External player control via Notifier from outside the widget tree
- Scene-adaptive behavior across
vod,live,listPlayer,restricted, andminimalmodes
Example snippets:
// Hide top and bottom bars for a clean look
AliPlayerWidget(controller, slotBuilders: {
SlotType.topBar: null,
SlotType.bottomBar: null,
});
// Add custom business overlay
AliPlayerWidget(controller, slotBuilders: {
SlotType.overlays: (context) => MyLikeShareButtons(),
});
// Fully branded UI
AliPlayerWidget(controller, slotBuilders: {
SlotType.topBar: (context) => MyAppTopBar(),
SlotType.bottomBar: (context) => MyAppBottomBar(),
SlotType.settingMenu: null, // hide settings
});Breaking Changes
Deprecation of Legacy overlays Parameter
The standalone overlays parameter in AliPlayerWidget is now deprecated in favor of the unified slot system (SlotType.overlays). While still functional for backward compatibility, new code should use slotBuilders exclusively. The legacy parameter will be removed in a future release.
Note: The
playerSurfaceslot handles core video rendering. Customizing it is not recommended, as it may cause playback instability.
This release empowers developers to build highly tailored player experiences while maintaining clean separation from core logic. Combined with the restructured documentation and practical examples, the slot system significantly lowers the barrier to advanced UI customization. Upgrading is recommended for any app requiring branded, minimal, or feature-rich player interfaces.