Releases: MissingCore/react-native-metadata-retriever
Releases · MissingCore/react-native-metadata-retriever
v0.7.1
⚡ Changes
- Add fallback to
PrimaryDirectoryPath
&StorageVolumesDirectoryPaths
to be"/storage/emulated/0"
&["/storage/emulated/0"]
respectively. - Mark
MusicDirectoryPath
as deprecated mainly due to not specifying a fallback (ie: it may benull
).- Will be removed in
v1.0.0
.
- Will be removed in
🛠️ Fixes
- Attempt to fix
stacktrace: com.facebook.react.common.JavascriptException: Error: Exception in HostObject::get for prop 'MetadataRetriever': java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.io.File.getAbsolutePath()' on a null object reference
that occurs on some devices.- We don't have a device to replicate this issue so we're kind of going in blind.
- Fallback to using
MediaMetadataRetriever
if bitrate isn't found or if the value isn't "correct".- Bitrate isn't present in
Format
for.flac
files and I've seen variable bitrate for.mp3
returned as64000
, which is incorrect. - The reason for these issues may be related to this issue comment.
- Bitrate isn't present in
v0.6.1
⚡ Changes
- Add fallback to
PrimaryDirectoryPath
&StorageVolumesDirectoryPaths
to be"/storage/emulated/0"
&["/storage/emulated/0"]
respectively. - Mark
MusicDirectoryPath
as deprecated mainly due to not specifying a fallback (ie: it may benull
).- Will be removed in
v1.0.0
.
- Will be removed in
🛠️ Fixes
- Attempt to fix
stacktrace: com.facebook.react.common.JavascriptException: Error: Exception in HostObject::get for prop 'MetadataRetriever': java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.io.File.getAbsolutePath()' on a null object reference
that occurs on some devices.- We don't have a device to replicate this issue so we're kind of going in blind.
- Fallback to using
MediaMetadataRetriever
if bitrate isn't found or if the value isn't "correct".- Bitrate isn't present in
Format
for.flac
files and I've seen variable bitrate for.mp3
returned as64000
, which is incorrect. - The reason for these issues may be related to this issue comment.
- Bitrate isn't present in
v0.7.0
Note
Use v0.6.0
if you don't want the previous targetSdkVersion
or compileSdkVersion
to change.
⚡ Changes
- Bumped AndroidX media3 to
1.5.0
from1.4.1
.- Requires setting
compileSdkVersion=35
.
- Requires setting
Other
- Validate compatibility with React Native 0.76.
- A patch file was required to get the example working due to monorepo behaviors.
v0.6.0
Note
This will be followed by v0.7.0
which will update AndroidX media3 to 1.5.0
, which requires setting the compiled SDK version to 35.
⚡ Changes
- Set max cap of size of base64 image returned from
getArtwork()
to5MB
(this means capping the image found to3.75MB
due to converting a byte array to a base64 string increasing the size by 33-37%).- This should further reduce the risk of
OutOfMemoryError
and will catch extreme cases such as trying to convert massive byte arrays (ie: >50MB) to a base64 string.
- This should further reduce the risk of
🛠️ Fixes
- Workaround with supporting other metadata fields in
.flac
files by utilizingMediaMetadataRetriever
.- Someone noticed that track numbers were missing with
.flac
files. Upon further investigation, we've also seen that thediscNumber
value was also missing. This was not the case when usingMediaMetadataRetriever
. - Will like to implement a better fix in the future.
- Someone noticed that track numbers were missing with
Other
EXPO_UNSTABLE_CORE_AUTOLINKING=1
(mentioned inv0.3.0
) is no longer needed in the.env
file for the Expo example withreact-native@0.75.4
.- Narrowed down to this causing crashing in the production app and the development version showing a white screen.
v0.5.0
⚡ Changes
- Switched to
String.toIntOrNull()
to preventNumberFormatException
caused by incorrect metadata structure. getArtwork
only attempts to read the 1st "Other" picture type (instead of overriding previous values if they existed).- Updated how we rejected promises.
- I wonder if the cause of the
message
field of the error received in React beingnull
is due to the use of the followingpromise.reject
format:promise.reject(code: String, throwable: Throwable?)
- I wonder if the cause of the
🛠️ Fixes
- Fixed
No suitable media source factory found for content type: 2
error due to missing modules to support theHLS
stream.- Added modules for
DASH
,SmoothStreaming
, andRTSP
as well.
- Added modules for
v0.4.0
v0.3.0
⚡ Changes
- No longer return
Unknown ExecutionException
&Metadata Retrieval Error
messages with promise rejection for unknown errors (ie: now default to the message in the error object). - Add support for React Native 0.75.
- For the Expo example to work (as I've encountered
ERROR: autolinkLibrariesFromCommand: process cmd /c npx @react-native-community/cli config exited with error code: 1
), you needEXPO_UNSTABLE_CORE_AUTOLINKING=1
in your.env.local
file. Not sure if this is needed in a production app.
- For the Expo example to work (as I've encountered
🛠️ Fixes
- Issue where an app using this package crashes in Android 7 to 10. This was due to the
StorageVolume.getDirectory()
being introduced in Android 11.
📚 Documentation
- Document
PrimaryDirectoryPath
inREADME.md
.