Skip to content

Releases: MissingCore/react-native-metadata-retriever

v0.7.1

10 Dec 23:20
Compare
Choose a tag to compare

⚡ 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 be null).
    • Will be removed in v1.0.0.

🛠️ 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 as 64000, which is incorrect.
    • The reason for these issues may be related to this issue comment.

v0.6.1

10 Dec 22:59
Compare
Choose a tag to compare

⚡ 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 be null).
    • Will be removed in v1.0.0.

🛠️ 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 as 64000, which is incorrect.
    • The reason for these issues may be related to this issue comment.

v0.7.0

08 Dec 01:50
Compare
Choose a tag to compare

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 from 1.4.1.
    • Requires setting compileSdkVersion=35.

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

07 Dec 20:54
Compare
Choose a tag to compare

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() to 5MB (this means capping the image found to 3.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.

🛠️ Fixes

  • Workaround with supporting other metadata fields in .flac files by utilizing MediaMetadataRetriever.
    • Someone noticed that track numbers were missing with .flac files. Upon further investigation, we've also seen that the discNumber value was also missing. This was not the case when using MediaMetadataRetriever.
    • Will like to implement a better fix in the future.

Other

  • EXPO_UNSTABLE_CORE_AUTOLINKING=1 (mentioned in v0.3.0) is no longer needed in the .env file for the Expo example with react-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

21 Sep 20:53
Compare
Choose a tag to compare

⚡ Changes

  • Switched to String.toIntOrNull() to prevent NumberFormatException 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 being null is due to the use of the following promise.reject format: promise.reject(code: String, throwable: Throwable?)

🛠️ Fixes

  • Fixed No suitable media source factory found for content type: 2 error due to missing modules to support the HLS stream.
    • Added modules for DASH, SmoothStreaming, and RTSP as well.

v0.4.0

08 Sep 20:31
Compare
Choose a tag to compare

⚡ Changes

  • Bumped AndroidX media3 to 1.4.1 from 1.3.1.

🛠️ Fixes

  • Ensure the "year" field returns a year.
  • Reduce risk of OutOfMemoryError due to trying to convert a large byte array representing an image into a base64 string.

v0.3.0

01 Sep 04:04
Compare
Choose a tag to compare

⚡ 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 need EXPO_UNSTABLE_CORE_AUTOLINKING=1 in your .env.local file. Not sure if this is needed in a production app.

🛠️ 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 in README.md.

v0.2.2

06 Aug 04:22
Compare
Choose a tag to compare

Added

  • New exported PrimaryDirectoryPath variable containing path to primary storage volume on device.

v0.2.1

26 Jul 21:24
Compare
Choose a tag to compare

Added

  • New custom year metadata field that returns: recordingYear -> releaseYear -> year parsed from MediaMetadataRetriever's DATE field.
    • This is due to an incomplete Vorbis DATE comment not being parsed correctly.
  • New album metadata preset.

v0.2.0

26 Jul 04:09
Compare
Choose a tag to compare

Changed

  • Changed package id to com.cyanchill.missingcore.metadataretriever from com.missingcore.metadataretriever (ie: to a domain we control).