doc/KEEP_LAST_FRAME_EN.md
KeepLastFrameVideo is a demo-level player for validating the behavior of keeping the last rendered frame after natural playback completion. It does not change the base player's default completion state and does not affect other player pages globally.
Main page entry: Keep last frame
Main classes:
app/src/main/java/com/example/gsyvideoplayer/KeepLastFrameDemoActivity.javaapp/src/main/java/com/example/gsyvideoplayer/video/KeepLastFrameVideo.javaapp/src/main/res/layout/activity_keep_last_frame_demo.xmlkeepLastFrameVideo.setKeepLastFrameWhenComplete(true);
Disable it to restore the default completion state:
keepLastFrameVideo.setKeepLastFrameWhenComplete(false);
The demo uses isLastAutoCompleteRetainedSurface() to check whether the render view was actually retained for the latest natural completion.
When the flag is enabled, KeepLastFrameVideo#onAutoCompletion() does not call the base default completion release flow. It:
CURRENT_STATE_AUTO_COMPLETE.onAutoComplete.onCompletion(), replay, and page destroy still use the normal release flow to avoid long-lived resources.
./gradlew :app:assembleDebug
adb install -r app/build/outputs/apk/debug/app-debug.apk
adb shell am start -n com.example.gsyvideoplayer/.MainActivity
Manual checks:
Keep last frame.FATAL EXCEPTION, IllegalStateException, or Surface-related crash.