-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
This is currently possible, at least on android, but very hard to use.
You need to start your url with asset:///flutter_assets/, so e.g. for "assets/demo.mp4", it would look like this:
MediaItem(
url: 'asset:///flutter_assets/assets/demo.mp4',
mimeType: 'video/mp4',
metadata: MediaMetadata(title: 'Asset file'),
),Instead, we should implement something similar to video_player:
- add a way to signal that this is an asset file, e.g. add a
UrlTypein the MediaItem pigeon. - on the native side, use something like (untested):
// Android val path = FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(mediaItem.url) val exoMediaItemUrl = "asset:///" + path;
// iOS let assetKey = registrar?.lookupKey(forAsset: mediaItem.url) let path = Bundle.main.path(forResource: assetKey, ofType: nil)!
Metadata
Metadata
Assignees
Labels
No labels