You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Access to the metadata of an MP3 file is currently limited to source, title, url, artist, album, date, genre. Why not just return the metadata object so users can access any metadata attribute they want? There are a lot of more progressive metadata tags available (see https://podcastnamespace.org/), including, as one other issue suggests, the incorporation of chapters, but also some potentially ground breaking abilities to rework the ability to detect how much of an mp3 file has been listened to, for things like podcasts (see https://rad.npr.org/). These would require a much more open-ended approach to accessing metadata. As it stands right now, the implementation in the track player requires you to spread the object keys of PlaybackMetadataReceived, e.g.
Describe the ideal solution
Would be happy to implement and PR, but I'm not an expert with native apps and modifying node modules, but essentially it'd be going into something like going into Metadata.swift (and wherever else is required in the track-player library) and, rather than:
static func update(for player: AudioPlayer, with metadata: [String: Any]) {
if let title = metadata["title"] as? String {
ret.append(MediaItemProperty.title(title))
}
if let artist = metadata["artist"] as? String {
ret.append(MediaItemProperty.artist(artist))
}
}
or providing some method in the library to request a specific metadata property from the client side, , e.g. TrackPlayer.requestMetadataItem('chapters')
How I can Help
Let me know which files would need to be modified in order to make this happen. Have tried modifying the places where this metadata shows up in my react-native-track-player node_modules folder:
Utils/Metadata.swift
model/Track.swift
model/TrackAudioItem.kt
but I can't get it to compile with my modifications. Are there other files? Or is the implementation I'm trying wrong?
Also, not sure what build commands need to be run in order to incorporate changes to a node module either...e.g. npx react-native run-ios --reset-cache? Or are there other steps that need to be run to essentially recompile and process the changes made to a node module in order to test? Thanks for your help!
Can you assist by working on this feature and creating a Pull Request? Yes! Happy to (With help)
The text was updated successfully, but these errors were encountered:
@jspizziri Please reopen 🙏 Here's another usecase: Adswizz inserts metadata related to image ads, so they can be displayed in sync with an audio stream. Example:
{
"metadata-list": [
{
"start": "0",
"metadata": "adswizzContext=aQd9MSFsQjFefAA6NzL4MTcddTxaMDIyYTc%3D adw_ad=true durationMilliseconds=11331 adId=151460 insertionType=preroll"
},
{
"start": "11331",
"metadata": "title=\"Tears Run Dry by Abraham Alexander now playing\""
}
]
}
Generally speaking it makes a lot of sense to be more open about unforeseen metadata use cases.
@mrazzari All feature requests that aren't actively being worked on by either the core team or a community member remain closed until someone volunteers to contribute. This prevents noise in the issue tracker. If you want to work on it I'm happy to repopen.
What is the need and use case of this feature?
Access to the metadata of an MP3 file is currently limited to
source, title, url, artist, album, date, genre
. Why not just return the metadata object so users can access any metadata attribute they want? There are a lot of more progressive metadata tags available (see https://podcastnamespace.org/), including, as one other issue suggests, the incorporation of chapters, but also some potentially ground breaking abilities to rework the ability to detect how much of an mp3 file has been listened to, for things like podcasts (see https://rad.npr.org/). These would require a much more open-ended approach to accessing metadata. As it stands right now, the implementation in the track player requires you to spread the object keys ofPlaybackMetadataReceived
, e.g.Describe the ideal solution
Would be happy to implement and PR, but I'm not an expert with native apps and modifying node modules, but essentially it'd be going into something like going into Metadata.swift (and wherever else is required in the track-player library) and, rather than:
saying:
or providing some method in the library to request a specific metadata property from the client side, , e.g.
TrackPlayer.requestMetadataItem('chapters')
How I can Help
Let me know which files would need to be modified in order to make this happen. Have tried modifying the places where this metadata shows up in my
react-native-track-player
node_modules folder:Utils/Metadata.swift
model/Track.swift
model/TrackAudioItem.kt
but I can't get it to compile with my modifications. Are there other files? Or is the implementation I'm trying wrong?
Also, not sure what build commands need to be run in order to incorporate changes to a node module either...e.g.
npx react-native run-ios --reset-cache
? Or are there other steps that need to be run to essentially recompile and process the changes made to a node module in order to test? Thanks for your help!Can you assist by working on this feature and creating a Pull Request? Yes! Happy to (With help)
The text was updated successfully, but these errors were encountered: