The player displays a paint preview that has been previously recorded. Currently, the player is only fully implemented for Android. However, there are a few platform-independent base classes (
BitmapRequest ) than can be used to extend the playback support for other platforms.
PlayerCompositorDelegate uses the StartCompositorService API. Alternatively, playback support for other platforms can be provided by using
StartCompositorService directly for more flexibility.
The remainder of this doc describes the Android-specific implementation.
As mentioned in the main
README , a paint preview can have multiple frames in a nested structure. Consequently, the player is desinged in a nested structure as well, to facilitate the display of mulitple nested frames.
android/java/src/.../player/: This directory contains per-player classes. In another word, these classes are aware that the player might have multiple frames and are not involved in the logic for displaying a single frame.
android/java/src/.../player/frame: This directory contains per-frame classes. These are responsible for displaying a single frame.
PlayerManager: Entry point for using the player. When created it initializes the compositor and populates a hierarchy of player frames based on the paint preview.
PlayerCompositorDelegateImpl: Communicates with the paint preview compositor. It requests bitmaps from the comopsitor and provides them to palyer frames.
PlayerFrameMediator: Handles the business logic for a single frame in the player, i.e. maintaining a viewport, updating its sub-frame visibilities, requesting bitmaps from the compositor delegate, etc.
PlayerFrameView: The View that displays a single frame.