SceneType is an abstraction in AliPlayerKit for defining playback scenarios. By specifying a SceneType, the player automatically adapts its UI behavior, gesture controls, and slot visibility.
Scene overview
Scene | Description | Use cases | Differences from VOD |
| The default scene, which supports all control features and requires no explicit configuration. | Standard VOD, online courses, and media libraries. | — |
| A live stream has no fixed duration, so the player automatically disables timeline operations. | Live events, sports, and e-commerce live streams. | Disables progress scrubbing, fast-forward, and playback speed controls; hides the |
| Disables vertical gestures to prevent conflicts with list scrolling. | Feeds and short video lists. | Disables vertical gestures for volume and brightness; other behaviors are the same as for |
| Prevents users from skipping forward to ensure they watch the content in sequence. | Exam proctoring and mandatory training courses. | Disables progress scrubbing, fast-forward, and playback speed controls; hides the |
| Provides a clean player surface. The developer must implement all controls. | Background playback and fully customized UIs. | Hides all control components and disables all gestures; only the |
Configuration
Specify the SceneType by using the sceneType() method of AliPlayerModel.Builder. Since VOD is the default scene, you only need to specify a SceneType for other scenarios.
LIVE scene:
// Build the player model and set the scene type to LIVE.
AliPlayerModel playerModel = new AliPlayerModel.Builder()
.videoSource(videoSource)
.videoTitle("Live Stream")
.sceneType(SceneType.LIVE)
.build();
// Bind the model to the player view.
controller.configure(playerModel);
playerView.attach(controller);SceneType and slot interaction
Slot visibility
The Slot System automatically controls component visibility based on the SceneType:
Slot | VOD | LIVE | VIDEO_LIST | RESTRICTED | MINIMAL |
playerSurface | ✓ | ✓ | ✓ | ✓ | ✓ |
playState | ✓ | ✓ | ✓ | ✓ | ✓ |
overlays | ✓ | ✓ | ✓ | ✓ | ✓ |
coverImage | ✓ | ✗ | ✓ | ✗ | ✗ |
seekThumbnail | ✓ | ✗ | ✓ | ✗ | ✗ |
playControl | ✓ | ✓ | ✓ | ✓ | ✗ |
topBar | ✓ | ✓ | ✓ | ✓ | ✗ |
bottomBar | ✓ | ✓ | ✓ | ✓ | ✗ |
settingMenu | ✓ | ✓ | ✓ | ✓ | ✗ |
gestureControl | ✓ | ✓ | ✓ | ✓ | ✗ |
Gesture behavior differences
Gesture | VOD | LIVE | VIDEO_LIST | RESTRICTED | MINIMAL |
Single tap (show/hide control bar) | ✓ | ✓ | ✓ | ✓ | ✗ |
Double-tap (play/pause) | ✓ | ✓ | ✓ | ✓ | ✗ |
Long-press (2x playback speed) | ✓ | ✗ | ✓ | ✗ | ✗ |
Horizontal drag (seek) | ✓ | ✗ | ✓ | ✗ | ✗ |
Left vertical drag (brightness) | ✓ | ✓ | ✗ | ✓ | ✗ |
Right vertical drag (volume) | ✓ | ✓ | ✗ | ✓ | ✗ |
Best practices
The scene type is set upon creation: The
SceneTypeis specified when anAliPlayerModelis created and cannot be dynamically switched during playback. To switch scenes, you must create a newAliPlayerModeland rebind it.Use the list scene for scrollable containers: When embedding the player in a scrollable container like a
RecyclerView, always use theVIDEO_LISTscene to prevent conflicts with vertical scroll gestures.Implement controls for the MINIMAL scene: When you select the
MINIMALscene, you must implement all playback controls by using custom slots.Advanced customization: If a
SceneType's preset behavior does not meet your needs, use theSlot Systemto further customize component visibility and layout. For more information, see Slot System.
FAQ
Differences between VOD and VIDEO_LIST
The main difference is how they handle vertical gestures. VIDEO_LIST disables vertical gestures for adjusting volume and brightness to avoid conflicting with the parent container's scrolling gestures. Other features are identical to VOD.
Custom controls in the MINIMAL scene
You can overlay a custom control UI by using custom slots:
AliPlayerModel playerModel = new AliPlayerModel.Builder()
.videoSource(videoSource)
.sceneType(SceneType.MINIMAL)
.build();
AliPlayerController controller = new AliPlayerController(this);
controller.configure(playerModel);
SlotManager slotManager = playerView.getSlotManager();
slotManager.register(SlotType.BOTTOM_BAR, parent -> new MyCustomControlSlot(parent.getContext()));
playerView.attach(controller);