Skip to content

feat: add openAsset() API for loading bundled media files#196

Merged
kdroidFilter merged 2 commits intomasterfrom
feat/open-asset-api
Apr 11, 2026
Merged

feat: add openAsset() API for loading bundled media files#196
kdroidFilter merged 2 commits intomasterfrom
feat/open-asset-api

Conversation

@kdroidFilter
Copy link
Copy Markdown
Owner

@kdroidFilter kdroidFilter commented Apr 11, 2026

Summary

Closes #96

  • Add openAsset(fileName) to VideoPlayerState interface for playing media directly from app-bundled assets without file copying
  • Android: uses the asset:/// URI scheme natively supported by ExoPlayer (zero-copy playback from APK)
  • iOS: resolves the file from the app bundle via NSBundle.mainBundle.pathForResource()
  • Other platforms: throws UnsupportedOperationException (can be extended later)

Usage

playerState.openAsset("video.mp4")
playerState.openAsset("videos/intro.mp4")

Test plan

  • Android: place a video in assets/, call openAsset("video.mp4"), verify playback
  • iOS: add a video to the app bundle, call openAsset("video.mp4"), verify playback
  • Verify calling openAsset() on unsupported platforms throws UnsupportedOperationException
  • ktlint passes

Add openAsset(fileName) to play media directly from app-bundled assets
without copying files. Supported on Android (asset:/// URI scheme) and
iOS (NSBundle resolution). Throws UnsupportedOperationException on other
platforms.
@kdroidFilter kdroidFilter merged commit 3eeb27f into master Apr 11, 2026
10 checks passed
@kdroidFilter kdroidFilter deleted the feat/open-asset-api branch April 11, 2026 21:17
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.

Support loading local videos in the assets directory of Android

1 participant