Skip to content

fix(player): "No internet connection" copy and resume the recording where it stopped - #64

Merged
bogdan-at-bunny merged 2 commits into
mainfrom
fix/no-internet-message
Sep 10, 2026
Merged

fix(player): "No internet connection" copy and resume the recording where it stopped#64
bogdan-at-bunny merged 2 commits into
mainfrom
fix/no-internet-message

Conversation

@damwilin

@damwilin damwilin commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

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 and Retry keeps 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 playLiveUrl takes an optional startPositionMs (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

  • Bug fix
  • Feature
  • Documentation
  • Refactor or cleanup
  • CI/build/release
  • Breaking change

Affected Areas

  • API module
  • Player module
  • Camera recording/upload module
  • Android TV module
  • Demo app
  • Documentation
  • Build or publishing

Testing

  • ./gradlew testDebugUnitTest --no-daemon --stacktrace - :player 127 tests green (6 new in PlaybackFailureInfoTest, 1 in BunnyLiveStreamPlayerViewModelTest, 5 in LiveStreamResumePositionTest)
  • ./gradlew :app:assembleDebug --no-daemon
  • Manual playback/upload/recording test
  • Not run, reason:

Emulator (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.onPlayerError now 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.playLiveUrl gains a trailing optional startPositionMs parameter (additive, source-compatible). No other public API change.

AI Assistance

  • No substantial AI assistance was used.
  • AI helped with this PR; I reviewed and understand the final changes.

Checklist

  • The PR is focused on one clear change.
  • Public API or behavior changes are documented.
  • Tests or manual verification are included where appropriate.
  • No secrets, access keys, or private data are included.

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.
@damwilin damwilin changed the title fix(player): say "No internet connection" when the device is offline fix(player): "No internet connection" copy and resume the recording where it stopped Sep 9, 2026
@bogdan-at-bunny
bogdan-at-bunny merged commit 512e7cb into main Sep 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants