Closed CaptainDario closed 4 months ago
https://github.com/wang-bin/fvp/blob/v0.20.2/lib/src/video_player_mdk.dart#L362 It's how video_player reads files in assets folder
So there is no way to read from assets using an uri likeassets://audios/my_audio.wav
? I need to copy your function _assetUri
?
yes, copy that function. 'assets:' is a standard protocol on android. for other platforms, flutter assets are are regular files
Is there a problem with making the function _assetUri
public?
Seems like it is quite important.
no problem. i even considered moving it to player.dart and make it public
That would be awesome!
Try master branch. player.setAsset('assets/audios/my_fancy_track.wav')
will play the audio. player.setAsset('assets/audios/my_fancy_track.wav', type: mdk.MediaType.audio)
will load an external audio track while playing a video set by player.media
or player.setAsset(asset)
Thank you this works perfectly!
available in the latest release
I am trying to play some audio files that are included in my assets folder. But I cannot seem to figure out how to do that. I can play an audio file from the filesystem using this code
But trying to play from assets using something like
does not work.
Is this currently not supported?