This topic describes the core features of AliPlayerKit. It covers product positioning, core architecture, component responsibilities, core interfaces, and the details of its six core systems.
Product positioning
Design goals
AliPlayerKit is designed as a universal playback architecture layer, not merely a player UI component, with the following goals:
Design goal | Description |
Low-code integration | Integrate complete playback scenarios with minimal code. |
Multi-scenario coverage | Cover various playback scenarios, such as video-on-demand (VOD), live streaming, and short videos. |
Reusable architecture | Avoid redundant development of player features across different services using a slot and policy architecture. |
Unified foundation | Serve as the unified foundation for all player solutions and scenario-based solutions. |
Architecture layers
In the architecture hierarchy, AliPlayerKit sits above the player kernel. It supports common features for various playback services through a unified UI component system and playback scenario abstraction.
Layer | Positioning | Module location | Responsibility |
Component layer | Player UI component |
| Provide out-of-the-box, configurable player UI components that cover basic playback and common interactive features. |
Scenario layer | Scenario-based solutions |
| Provide standardized integration examples for typical scenarios, such as short-form dramas, medium and long-form videos, and live streaming. This helps customers quickly build complete playback capabilities with minimal code. |
Core architecture
AliPlayerKit uses a 3+1 core architecture to build its player framework:
Three runtime interfaces: These interfaces follow the Model-View-Controller (MVC) architecture pattern, which separates and decouples the responsibilities of UI display, playback control, and data configuration.
AliPlayerView: The player UI component that handles interface rendering and user interaction (View).AliPlayerController: The playback control component that handles playback logic and state management (Controller).AliPlayerModel: The data model component that encapsulates the player's playback configuration and media information (Model).
One global interface: This interface provides framework initialization and global feature management. It serves as the unified entry point for the player framework.
AliPlayerKit: Initializes the framework and provides basic features, such as global configuration, log management, and preloading.
Architecture design
AliPlayerKit uses the classic MVC architecture to divide the player into independent components.
Component responsibilities
Component | Type | Responsibility | Lifecycle |
| Global entry point | Global configuration, cache management, version information. | Application-level |
| View | UI display, slot management, lifecycle binding. | Page-level |
| Controller | Playback control, state management, event distribution. | Page-level |
| Model | Configuration data encapsulation, Builder pattern. | Request-level |
Core interfaces
The core interfaces to call for each player instance include the following:
Interface | Description |
| Create a controller. |
| Build a data model. |
| Attach the controller and data. |
| Detach and release resources. |
| Handle the back button event (optional). |
For a complete list of methods and parameter descriptions for each component, see the API Reference.
Call sequence
The complete call flow of the core interfaces covers the entire lifecycle, from creation, binding, and playback to release.
For complete integration steps, see the Quick Start.
Core features
Slot system
The slot system divides the player UI into independent components. Each slot is responsible for a specific feature, such as the top control bar, progress bar, or thumbnail. You can combine these components freely. You can use the default interface for quick integration, replace components as needed, or fully customize the interface. The UI components are completely decoupled from the player core. Customization does not require source code modification, and there is no risk of code conflicts during upgrades. Different playback scenarios can reuse the same slot components, which avoids redundant development. For more information, see Slot system.
Policy system
The policy system encapsulates player business logic into independent policy components. Each policy implements a specific feature, such as first frame statistics, stuttering detection, traffic protection, or resume playback. You can extend the policy layer without changing the framework core. Each policy has a single, isolated responsibility. Policies can be reused across player instances and enabled or disabled as needed. Framework upgrades and business customizations do not interfere with one another. For more information, see Policy system.
Event system
The event system uses a publish-subscribe pattern to decouple AliPlayerKit components. UI components subscribe to events and send commands without holding a reference to the controller. The controller processes commands and publishes states without knowing its listeners. This architecture supports independent development and maintenance of the UI and business logic. It also naturally isolates communication among multiple player instances through events that carry a playerId. For more information, see Event system.
Player lifecycle policy
The player lifecycle policy manages the creation, reuse, recycling, and destruction of instances. It includes four built-in policies: Default, Singleton, ReusePool, and IdScopedPool. These policies are suitable for general, single-player, list playback, and preloading scenarios, respectively. You can simply select a policy to balance performance and resources. For example, using ReusePool for short video lists can significantly improve scrolling smoothness and first frame speed. For more information, see Player lifecycle policy.
Log system
The log system provides a unified log center, LogHub. It supports multi-level output and filtering, listener extensions, and other features. This ensures that key nodes during player runtime are fully traceable, which assists with issue diagnosis and performance analysis. You can enable detailed logs for debugging during development and streamline output in production environments. You can also use listeners to write logs to a file or report them to a server. This enables technical support teams to quickly troubleshoot issues. For more information, see Log system.
Multiple video source support
AliPlayerKit supports multiple video source types. We recommend using the VidAuth method. For more information, see Multiple video source support.
Source type | Creation method | Scenarios |
VidAuth source |
| The recommended method for Alibaba Cloud VOD (Recommended). |
VidSts source |
| Uses temporary credentials from Alibaba Cloud Security Token Service (STS). |
URL source |
| Live streaming or simple scenarios. |