-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[expo-av] allow playing media files from apk res folder (expo#8936)
# Why ref expo#8888 -- expo-av currently does not support playing media files from an android apk's `res/raw` folder, which is where the RN packager embeds required assets by default. # How RN's asset source resolver sets the `uri` for assets embedded in `res` to simply the resource name with no scheme. Therefore, if the url provided to expo-av has no scheme, we can assume it comes from RN's asset source resolver and is a resource name. ([We do the same thing in expo-file-system.](https://github.com/expo/expo/blob/1b61af26782c89da45ba559e60ebb2a38b6e80b3/packages/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.java#L312-L314)) # Test Plan Tested using the repo provided in expo#8888 and confirmed that with expo-updates disabled, after this change, the audio file played as expected both with ExoPlayer and with `androidImplementation: 'MediaPlayer'`.
- Loading branch information
Showing
3 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters