Closed dcvz closed 3 years ago
The seekTo method still does not work on android. Is there any fix?
@t-tornado how did you use? Which version do you use? For me is working fine...
version 1.4.7
Has it been resolved in the new V2? @ithustle
It 1.2.7 worked fine for me. Try 2.0.0-rc15
or 2.0.0-rc16
@dcvz can you pls bring
playWhenReady: false
back to.add
method isios/RNTrackPlayer/RNTrackPlayer.swift
because the autoplay issue seems back after changing to indices from ids
seems the issue is still there:( playback gets started for me on iOS without hitting play
I've published a new pre-release rc17
. Here's a what's new:
I think we're down to the last bugs before being ready for an official v2.0.0
! Please try this in your apps and report any issues you find!
We'll keep an eye on this thread for more issues and try to fix them up. We appreciate any testing and reporting!
If no issues arise, we'll prepare to release the official
v2.0.0
soon 🚀Thanks @dcvz!
I stumbled across one other issue and meant to generate a simple repro case, but it's still on my todo list. The issue was a warning that I was trying to interact with an unmounted component, and I think the issue was that in this useEffect block we're not returning a callback to set
savedHandler.current
back to undefined.Sorry this is a bit vague - I'll have a crack at a simple repro case this evening.
Did you get a chance to take a further look @simonwhitaker and reproduce in an example project? It could potentially be the use of useRef.
what about the issue multiple people are having with playing/streaming audio on iOS? I created an issue with a reproduction a couple of days ago: https://github.com/DoubleSymmetry/react-native-track-player/issues/1198
We'll keep an eye on this thread for more issues and try to fix them up. We appreciate any testing and reporting!
If no issues arise, we'll prepare to release the official
v2.0.0
soon 🚀Thanks @dcvz! I stumbled across one other issue and meant to generate a simple repro case, but it's still on my todo list. The issue was a warning that I was trying to interact with an unmounted component, and I think the issue was that in this useEffect block we're not returning a callback to set
savedHandler.current
back to undefined. Sorry this is a bit vague - I'll have a crack at a simple repro case this evening.Did you get a chance to take a further look @simonwhitaker and reproduce in an example project? It could potentially be the use of useRef.
I'm afraid not, sorry. I did spin up a simple demo project but I couldn't reproduce the issue.
@dcvz how to do the shuffle functianality
what about the issue multiple people are having with playing/streaming audio on iOS? I created an issue with a reproduction a couple of days ago: https://github.com/DoubleSymmetry/react-native-track-player/issues/1198
@BjoernRave ogg vorbis support is a known issue and something we want to fix after the v2 release.
@dcvz how to do the shuffle functianality
this is not in v2 - we plan to add this once v2 is out! for now the only way would be to manage your own queue.
I've published a new pre-release
rc17
. Here's a what's new:
- revamped module for Windows by @tritao
- fix bug when trying to add track at position 0 (by @austinried)
- fix issue where track would auto start when adding to queue
I think we're down to the last bugs before being ready for an official
v2.0.0
! Please try this in your apps and report any issues you find!
I've made a small follow up pre-release rc18
fixing an issue where the playback-track-changed
event would send null
for some properties in iOS and undefined
elsewhere. (reported by @ithustle )
@dcvz and @Guichaguri I think that
buffer
is not working on Android when streaming type ishls
... Could you, please, confirm that?
@dcvz , could you confirm that? on both android and iOS...
very excited for this update, thanks everybody for the contributions! is it possible to access the buffered data on device somehow? Don't think the current version allows for this, thought maybe V2 will allow for that?
@dcvz, .getTrack()
cause crash if none song is playing.
.getCurrentTrack()
return 0 if none song is playing. I think is bad because if a song is playing and if it is the first track of the queue the currentTrack
position it will be 0 too. Remembering that zero it’s like false
.
Hi everyone, I'm very excited about this update. Thanks for all good work here. 👍 Before you release the new version I would like to show you the Issue I found HERE. This is happens in the latest version(v2.0.0-rc18) and also in the previous version(v1.2.7). I created a repository to reproduce the issue.
Thanks for the reports @ithustle and @edgargrs. We'll take a look soon :)
Edit: my mistake.
Thanks everyone for the reports! Officially v2 is now out!
We've also gone through and mass cleaned the issues log in an effort to give us a better chance of maintaining this library and fixing new issues. If there's any issues with v2 please report them :)
We'll focus on stabilising any new issues + queue manipulations like shuffle and reordering.
@dcvz THanks man you certainly came from nowhere to save this project i will certainly try to update some of the android side stuff.
Great news, @dcvz. However, I double checked on documentation but I've no see shuffle
functions. Is there a plan to implement this one?
@ithustle this was not part of v2, now that the release is out we'll be able to focus on more additions for queue management
This new version is not working, at all.
Once I loaded the app, I immediately get a red screen and the app fully crashes: "Argument 1 (NSNumber) of TrackPlayerModule.add must not be null"
Then iOS crashes: "Thread 6: Fatal error: Index out of range"
Any idea?
@DennisdeWitNL are you migrating from a previous v2-rc? Or from 1.2.7?
@dcvz From 1.2.7. But even the documentation for version 2.0.0 doesn't work. I have no clue what to do, other than staying on 1.2.7 for now. :-)
@DennisdeWitNL all methods that modify the queue were changed to be index based instead of based ok track ids.
Perhaps a migration guide will need to be written.
@ithustle the last 2 things regarding getCurrentTrack() -- have been fixed. Could you give them a try?
@dcvz But is it a problem with my code, or is it broken out of the box already? Because even when I delete all functions that have to do with TrackPlayer, I still get this immediate crash. I assume there is a big bug that makes this module completely broken@v2.
I tried it out of the box - still not working. This is an issue with the module, not with my code.
@DennisdeWitNL taking a look now. So you made an entirely new project. Added v2 and it's crashing? With what error!"?
@ithustle the last 2 things regarding getCurrentTrack() -- have been fixed. Could you give them a try?
I'll update now to v2 and give to you a feedback
@dcvz "Argument 1 (NSNumber) of TrackPlayerModule.add must not be null" is the screen that pops up.
Then iOS crashes: "Thread 6: Fatal error: Index out of range" - it is in the updateMetadataForTrack public function. Xcode sends me to the react-native-track-player pod >> RNTrackPlayer >> let track = player.items[trackIndex.intValue] as! Track
(line 513)
All I can think of, is I might have missed the update function somewhere and it is still firing.
How should I update the metadata properly in v2? I am currently using:
TrackPlayer.updateMetadataForTrack("stream", {
I guess the problem is in “stream”. So how should I fix that? I can send you a ZIP-file or so if you need it. (Won’t publicly put it on Github.)
@dcvz I checked the log. Does this help you?
Compatibility Header/react_native_track_player-Swift.h:194:9: error: 'react_native_track_player/react_native_track_player.h' file not found
^
error: could not build Objective-C module 'react_native_track_player'
@ithustle the last 2 things regarding getCurrentTrack() -- have been fixed. Could you give them a try?
Yep, its fixed.
For android return null
For iOS return undefined
@dcvz It took me a few hours to figure out I was editing the wrong xcworkspace file. OMG, I am so dumb! :-))
However, the module crashes when I am updating the metadata with the artwork. How do I get a local artwork to work?
const trackId = await TrackPlayer.getCurrentTrack();
TrackPlayer.updateMetadataForTrack(trackId, {
title: Artist,
artist: Title,
artwork: require('./Logo.jpg')
Makes the module crashing in Model MediaURL on line 32
} else {
let url = object as! String
It worked on 1.2.7, so I guess something has changed. Could you tell me the correct way to display a local artwork? Thanks! (other than that, everything seems to work!, great work!)
@DennisdeWitNL, try to get relative path of artwork, like file:/// ...
or the url
@ithustle How would that work? file:///Logo.png? I guess that won’t work. And I don’t want to install even more third party plugins to find a dynamic relative path.
I am trying to avoid URL for artwork, because that would mean the server could be offline. And if the server is offline, the app would fully crash. I am using a static image anyway (the logo of the app as the artwork), so why not keep it locally? :)
Edit: using file:// for loading a static image is not the correct way to do it, according to React Native. It should be the require-method, not file://. It worked fine at 1.2.7, so I still think something has changed.
You're right @DennisdeWitNL -- I've fixed this now in https://github.com/DoubleSymmetry/react-native-track-player/pull/1223 which will go out with v2.0.1
later today!
@dcvz Is there also a way to solve the problem with the NowPlayingInfoProperty in the newest Xcode? On line 34, it says @available(iOS 10.3, *)
. According to Xcode, Enum cases with associated values cannot be marked potentially unavailable.
Same goes for line 119. There is says @available(iOS 11.0, *)
.
When I change it to iOS 10, the problem is solved.
@dcvz The module is broken in Android. Double Can Not Be Cast To String. Any idea's?
Java.lang.Double cannot be cast to Java.lang.String getString ReadableNativeArray.Java on line 102.
@DennisdeWitNL your problem description doesn't have a lot of info. Is it a certain method that's failing?
Could you please try to run the example app and see if that fails for you?
@dcvz I have no idea what happened. I deleted the app, ran the app again in the simulator and the problem went away. Will report again when I see this problem again.
@dcvz An other app I recently updated to 2.0.1 and uploaded to Google Play Store, shows a similar crash. On 4000 users, the app crashes 66 times a day. I never saw this error in 1.2.7, so maybe you have an idea? What relevant code should I post in order for you to fix this?
java.lang.NullPointerException:
at com.facebook.react.bridge.ReadableNativeArray.getDouble (ReadableNativeArray.java:92)
at com.facebook.react.bridge.JavaMethodWrapper$4.extractArgument (JavaMethodWrapper.java:64)
at com.facebook.react.bridge.JavaMethodWrapper$4.extractArgument (JavaMethodWrapper.java:60)
at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:356)
at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:151)
at com.facebook.react.bridge.queue.NativeRunnable.run (Native Method)
at android.os.Handler.handleCallback (Handler.java:938)
at android.os.Handler.dispatchMessage (Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27)
at android.os.Looper.loop (Looper.java:246)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:226)
at java.lang.Thread.run (Thread.java:923)
Note: the trackID’s are still a string in my code, not a number like 1,2,3 and such. Would that be the problem?
@DennisdeWitNL twice already you've posted about issues that were not bugs in the library. This crash seems like you're using an invalid parameter type.
I'll be locking this thread now. If there's a concrete bug in the library please create a new issue. If you need help with debugging you should instead try through our discord community.
v2.0.0
Changes
playback-metadata-received
event to be notified of metadata changes on streams #1175 (rc-15)playback-about-to-end
event to provide a chance for loading next track data. - (See https://github.com/react-native-kit/react-native-track-player/issues/818#issuecomment-569370326)~To update run
yarn add react-native-track-player@next
. Breaking changes are outlined below:Migrating to RN 0.60
We've migrated to AndroidX, please follow migration instructions provided by the ReactNative team.
Exports Updated
PR: https://github.com/react-native-kit/react-native-track-player/pull/654 has changed the default export to only include methods on the player.
State
,Capability
,PitchAlgorithm
,TrackType
andEvent
are now exported as enums.Progress Hook Renamed
The hook
useTrackPlayerProgress()
has been fixed and renamed:useProgress()
. The return has also been modified:bufferedPosition
is nowbuffered
.