_type: issue

title: fix stremio external subtitle loading regression

description: After adding late subtitle forwarding for native playback, Stremio external subtitle loading is failing. Investigate the injected bridge and native subtitle forwarding path, then adjust behavior so Stremio can still load external subtitles while native playback receives late candidates.

status: closed

issue_type: bug

assignee: dirtydishes

created_by: dirtydishes

close_reason: Hardened subtitle bridge network observers so non-text Stremio subtitle loads are not touched, and made parser traversal deterministic for metadata preservation.


title: Accept Stremio subtitle download URLs

description: Runtime logs show Stremio external subtitle tracks using subs5.strem.io /en/download URLs. The subtitle bridge and Swift parser currently reject those URLs because they do not have a subtitle file extension and are not on an OpenSubtitles host, so native playback receives zero external subtitle candidates.

close_reason: Accepted Stremio subtitle download URLs in the bridge, parser, resolver, and regression tests.


title: Filter false OpenSubtitles subtitle candidates

description: Dreamio is treating addon artwork and OpenSubtitles addon endpoints as external subtitle candidates, which causes the native player UI to show only embedded subtitles. Tighten subtitle URL detection in the web bridge and Swift parser, and add regression coverage for the logged false positives.

close_reason: Fixed by tightening OpenSubtitles subtitle URL filtering in the web bridge and Swift parser, plus adding regression coverage for logged artwork and addon endpoint false positives.


title: Fix OpenSubtitles manifest-style subtitle URLs

description: OpenSubtitles subtitle candidates discovered from Stremio are being resolved as manifest.json_N URLs, producing 404s and leaving only embedded subtitles visible. Preserve and resolve real subtitle URLs so external subtitle tracks can attach in the native player.

close_reason: Fixed by rejecting OpenSubtitles manifest.json_N identifiers as playable subtitle URLs, promoting file_id values to API download URLs, and adding parser coverage for the live log shape.


title: Capture OpenSubtitles candidates from Stremio app-state messages

description: OpenSubtitlesV3 appears loaded in Stremio before native playback launches, but Dreamio forwards zero external subtitle candidates. The likely failure is not native-player timing; it is that the injected WebKit bridge does not extract Stremio's loaded subtitle metadata/state into URL candidates before opening VLC.

close_reason: fixed


title: OpenSubtitles tracks missing from native captions menu

description: OpenSubtitles subtitle candidates can be discovered or resolved inconsistently, and external VLC subtitle slaves may not become visible quickly enough to show as selectable native caption tracks. Harden discovery, resolution, attachment, diagnostics, tests, and turn documentation for the native captions path.

close_reason: Hardened OpenSubtitles candidate discovery, nested payload resolution, VLC external subtitle visibility selection, diagnostics, tests, and turn documentation.


title: fix stremio external subtitle handoff to vlc

close_reason: Implemented stream-keyed subtitle buffering, OpenSubtitles parser/resolver hardening, VLC refresh behavior, and focused validation.


title: add native player audio track selection

description: Add audio track discovery and selection to the native VLC-backed player so multi-language files can be filtered from the player controls.

issue_type: feature

close_reason: Implemented native audio track discovery and selection with a far-left audio menu in the VLC-backed player.


title: Capture browser text tracks for OpenSubtitles V3

description: OpenSubtitles V3 subtitles can be attached to the Stremio web player as HTML track/textTrack entries rather than appearing in the initial stream candidate. Extend the web bridge to inspect track elements and textTracks so external subtitles can be forwarded to native playback.

close_reason: Captured OpenSubtitles V3 subtitle URLs from browser track elements and textTracks so they can be forwarded to native playback.


title: Reapply VLC embedded subtitle selection after track discovery

description: Device logs show VLC eventually exposes and selects the embedded English SDH subtitle track, but subtitles still do not render. Investigate and harden the VLC selection timing so embedded tracks are selected after discovery is stable.

close_reason: Re-applied the auto-selected VLC subtitle track after stream discovery and playback state changes to harden rendering timing.


title: Auto-select embedded VLC subtitle tracks

description: VLC discovers embedded MKV subtitle tracks after playback starts, but Dreamio leaves subtitles disabled when no external candidates were provided. Add automatic selection for the first selectable VLC subtitle track while preserving manual caption choices.

close_reason: Auto-select the first discovered VLC subtitle track when playback is still disabled, while preserving manual caption choices.


title: Discover Stremio external subtitle payloads

description: Extend and instrument the injected web subtitle discovery path so Stremio/OpenSubtitles addon responses can be captured when native playback only sees embedded VLC subtitle tracks.

close_reason: Added subtitle-shaped fetch/XHR inspection diagnostics and validated the build.


title: Stabilize captions menu refresh

description: Stop rebuilding the captions UIMenu on every playback progress refresh so embedded subtitle actions can remain stable long enough to fire, while keeping DEBUG logs for menu state and selection.

close_reason: Stopped rebuilding the captions menu on every progress refresh and validated the build.


title: Resolve OpenSubtitles API subtitle URLs before VLC attachment

description: OpenSubtitles V3 can surface API/download endpoints that are not subtitle files themselves. Dreamio should resolve those endpoints to playable subtitle file URLs before handing them to VLC so Stremio does not show failed subtitle loads after native playback opens.

close_reason: Resolved OpenSubtitles V3 API-style subtitle download URLs to direct subtitle files before VLC attachment; added parser/resolver coverage and simulator build validation.


title: forward late opensubtitles subtitles to native player

description: Native playback only receives subtitle candidates discovered before the stream candidate is posted. OpenSubtitles V3 candidates can arrive later through addon/network responses, so the active native player needs an append path for newly discovered external subtitles.

close_reason: Implemented late subtitle forwarding into active native playback, added VLC append path and parser tests.


title: Native player controls captions and close flow

description: Add and validate VLC-backed native playback transport controls, subtitle track controls, external subtitle discovery, and Stremio Web close cleanup after native playback dismisses.

close_reason: Implemented and validated native player controls, subtitle handling refinements, and close-flow cleanup.


title: Fix native player controls tap-to-show

description: Native player controls can be hidden by tapping, but subsequent taps on the player do not bring them back. Investigate the overlay gesture handling and restore reliable tap-to-show/tap-to-hide behavior.

close_reason: Closed


title: Fix MobileVLCKit linker dependency

description: Dreamio fails to link because the MobileVLCKit framework is not found. Investigate how the dependency is configured and update the repository so the framework is available to Xcode builds.

close_reason: Fixed MobileVLCKit linker failures by preparing the XCFramework slice before app linking and preserving the integration through pod install.


title: Guard native playback when MobileVLCKit is unavailable

description: Dreamio can currently present its native player from raw xcodeproj builds where MobileVLCKit is not linked, which leads to the fallback backend message instead of an actionable setup path. Add a runtime/build availability check, document the CocoaPods workspace requirement, and validate the fallback remains buildable.

close_reason: Added native backend availability guard, installed CocoaPods, generated workspace metadata, documented setup, and validated available checks.


title: Fix URL redaction crash on percent-encoded paths

description:
## Why
Dreamio can crash while logging WebKit navigation and playback URLs because URLRedactor writes raw replacement text back into URLComponents.percentEncodedPath.

## What needs to be done
- Update URL redaction to avoid assigning invalid characters to percentEncodedPath
- Preserve token/path redaction behavior for diagnostics
- Add a regression test covering percent-encoded path input similar to the Stremio crash logs

## Acceptance criteria
- Redacting a URL with percent-encoded path segments does not crash
- Diagnostics still remove query strings/fragments and redact token-like path segments
- Tests cover the regression


title: Resolve final media URLs before native playback

description: Dreamio native playback can pass addon resolver URLs into VLC instead of the final direct media URL. Resolve known Stremio addon stream responses before presenting the native player, preserve needed headers, and make startup failure recoverable.

close_reason: Resolved native playback stream URLs before opening VLC, added resolver selection tests, and documented validation limits.


title: Fix native playback build blockers

description: Correct Swift string escaping for the injected stream bridge and allow the VLC backend source to compile before MobileVLCKit is installed by guarding the import with canImport.

close_reason: Fixed Swift raw string escaping and guarded MobileVLCKit import for builds before pod install.


title: Add native playback for direct debrid streams

description: Implement a WKWebView JavaScript bridge that detects direct-file debrid media URLs and routes unsupported containers to a native player backend, initially MobileVLCKit, while preserving normal Stremio Web playback for compatible streams.

close_reason: Implemented native direct-stream bridge, classification, MobileVLCKit backend wiring, CocoaPods workflow docs, and turn documentation. Full iOS build is blocked locally by missing CocoaPods and iPhoneOS SDK.


title: Fix iOS bundle identifier install failure

description: Xcode built Dreamio.app without a valid CFBundleIdentifier, causing device install to fail with CoreDeviceError 3000/3002. Investigate project bundle settings, fix the source configuration, validate the app bundle Info.plist, and document the change.

close_reason: Added bundle metadata to Info.plist and validated processed app bundle identifier.


title: Build WKWebView MVP shell

description: Create the first Dreamio MVP implementation: a minimal iOS WKWebView wrapper around hosted Stremio Web, with configuration, launch behavior, diagnostics, and documentation for real-device viability testing.

acceptance_criteria: App project exists; WKWebView loads hosted Stremio Web; external/new-window navigation is handled; basic diagnostics and manual test documentation exist; quality gates are run or documented.

close_reason: Implemented the MVP WKWebView iOS shell, added run and validation documentation, and recorded current validation limits.


title: Show OpenSubtitles languages in caption tracks

description: Preserve external subtitle metadata after VLC attaches OpenSubtitles tracks so the captions menu shows useful language labels instead of generic VLC track names.

close_reason: Fixed by preserving OpenSubtitles subtitle display metadata through VLC external track attachment and adding display-name tests.


title: Throttle VLC subtitle reapply during buffering

description: VLC subtitle auto-selection currently reapplies the same subtitle track on every buffering state notification, producing noisy logs and unnecessary repeated player writes. Limit state-driven reapply to meaningful selection recovery or state transitions while preserving delayed retries after initial auto-selection.

close_reason: Limited VLC auto-subtitle reapply to real selection recovery while keeping bounded delayed startup confirmations.


title: Add captions selection proof logging

description: Add DEBUG-only logs around the native captions menu and VLC subtitle selection path so subtitle tap actions prove whether the UI fires and whether VLC accepts the selected embedded track index.

issue_type: task

close_reason: Added DEBUG-only logs for captions menu actions and VLC subtitle selection results.


title: Add native subtitle pipeline proof logging

description: Add DEBUG-only logs across the web bridge, native player, subtitle resolution, and VLC attachment points so the next Xcode run can identify where external subtitles disappear without changing playback behavior.

close_reason: Added DEBUG-only subtitle pipeline proof logging and documented validation.


title: Make caption selection states clearer

description: The native player caption menu should behave like a simple single-choice menu with None and loaded caption tracks, making the current caption state visually obvious.

close_reason: Implemented captions as a single-choice menu with None and selected loaded tracks, updated tests and turn documentation.


title: Streamline native player controls

description: Make the native playback controls take up less screen space while preserving play, seek, jump, captions, and close actions.

close_reason: Streamlined native player controls into a compact bottom overlay and validated the simulator build.


title: Add native player controls and captions

description: Implement a fuller VLC-backed native playback surface with transport controls, caption controls, external subtitle discovery, and a clean close flow back to Stremio episode selection.

close_reason: Implemented native VLC player controls, caption controls, subtitle candidate discovery, and close-flow cleanup.


title: Enable WebView inspection and playback diagnostics

description: Add development-only WKWebView inspection and token-safe playback diagnostics so Dreamio can debug hosted Stremio media failures without changing app navigation, login, or playback behavior.

close_reason: Implemented debug-only WKWebView inspection, token-safe playback diagnostics, navigation logging, validation build, and turn documentation.


title: Track HTML diff rendering tooling as dev dependency

description: Move the HTML diff rendering package into devDependencies and ignore installed Node modules so the repo tracks reproducible tooling without vendoring dependencies.

close_reason: Moved @pierre/diffs to devDependencies and ignored node_modules.