fix(player): "No internet connection" copy and resume the recording where it stopped - #64
Merged
Merged
Conversation
A playback failure that media3 files under one of its connectivity codes, with no HTTP status and no DNS sinkhole behind it, used to reach the viewer as the raw engine text. It now shows the localized "No internet connection"; the engine code still goes to logcat. The failure stays transient, so the live player keeps retrying and Retry keeps working. The demo's playback-failed dialog shows the SDK's own copy alone instead of pairing it with the processing/deleted/token hint.
The live player's recovery loop rebuilds the player after a playback failure, and the rebuilt player started the recording from 00:00, so a network drop sent the viewer back to the beginning. The surface now reads the engine's position before the rebuild and playLiveUrl takes an optional start position that is applied once the engine is prepared; a stored resume position cannot override it. Only the recording is restored - the live edge and the live-to-recording hand-off keep starting where they did.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the device has no connectivity, the player showed the raw engine text (
Couldn't play video / ERROR_CODE_IO_NETWORK_CONNECTION_FAILED: Source error). Per the Slack discussion (Bogdan: "No internet connection sounds good"), a failure that media3 files under one of its connectivity codes - with no HTTP status and no DNS sinkhole behind it - now shows the localized "No internet connection" (31 locales, next to the existing "Video is not available"). The engine code still goes to logcat. Nothing changes in the recovery logic: the failure stays transient, the live player keeps retrying andRetrykeeps working; a 403 and a DNS-level geo block still win and stay terminal.The demo's "Playback failed" dialog shows the SDK's own copy alone instead of pairing it with the "may still be processing / deleted / token" hint, which only makes sense for raw engine errors.
Second commit, same tester round: after the network came back, the live player's recovery rebuilt the player and the recording of an ended stream restarted from 00:00. The surface now reads the engine's position before the rebuild and
playLiveUrltakes an optionalstartPositionMs(trailing, defaulted) applied once the engine is prepared; a stored resume position cannot override it. Only the recording is restored - the live edge and the live-to-recording hand-off start where they did before.Type of Change
Affected Areas
Testing
./gradlew testDebugUnitTest --no-daemon --stacktrace-:player127 tests green (6 new inPlaybackFailureInfoTest, 1 inBunnyLiveStreamPlayerViewModelTest, 5 inLiveStreamResumePositionTest)./gradlew :app:assembleDebug --no-daemonEmulator (API 36): VOD playback with the network cut mid-stream shows "Couldn't play video / No internet connection" and the demo dialog without the hint; after the network returns, Retry resumes from the saved position. Live player on an ended stream's recording: same copy, automatic recovery after the network returns, and playback resumes at the position the viewer was at (position held across 8 offline rebuilds, first segments fetched after reconnect are mid-recording, plays to the end without a loop); logcat keeps
playback failure http=null sinkhole=null ERROR_CODE_IO_NETWORK_CONNECTION_FAILED.SDK User Impact
PlayerStateListener.onPlayerErrornow receives "No internet connection" (localized) for connectivity failures instead of"ERROR_CODE_IO_NETWORK_CONNECTION_FAILED: Source error"; the developer-facing text is in logcat.BunnyStreamPlayer.playLiveUrlgains a trailing optionalstartPositionMsparameter (additive, source-compatible). No other public API change.AI Assistance
Checklist