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-trackplayer@next. Breaking changes are outlined below:
We've migrated to AndroidX, please follow migration instructions provided by the ReactNative team.
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 and Event are now exported as enums.
import TrackPlayer, { State, Capability, TrackType } from '...'
The hook useTrackPlayerProgress() has been fixed and renamed: useProgress(). The return has also been modified: bufferedPosition is now buffered.
@returns { position, duration, ~buffered~ }
Hi,
Does ProgressComponent does not exist anymore in v2.0.0-rc10 ?
Noup. You must use useProgress() on a functional component
@Guichaguri , @dcvz .. TrackPlayer.STATE_PLAYING return undefined on v2.0.0-rc12 on IOS ...
@Guichaguri , @dcvz ..
TrackPlayer.STATE_PLAYINGreturnundefinedon v2.0.0-rc12 on IOS ...
Its like all the constants are undefined.
Thanks @ithustle and @fcaride for reporting them, I'll look into them :)
@dcvz Thanks to you for this amazing library!
@dcvz hi i am getting following error when use with react-native 0.60.3 on pod install i am getting following error
``Detected React Native module pods for RNGestureHandler and react-native-track-player
Analyzing dependencies
Fetching podspec forRNGestureHandlerfrom../node_modules/react-native-gesture-handler
Fetching podspec forReactfrom../node_modules/react-native/
Fetching podspec forReact-Corefrom../node_modules/react-native/React
Fetching podspec forReact-DevSupportfrom../node_modules/react-native/React
Fetching podspec forReact-RCTActionSheetfrom../node_modules/react-native/Libraries/ActionSheetIOS
Fetching podspec forReact-RCTAnimationfrom../node_modules/react-native/Libraries/NativeAnimation
Fetching podspec forReact-RCTBlobfrom../node_modules/react-native/Libraries/Blob
Fetching podspec forReact-RCTImagefrom../node_modules/react-native/Libraries/Image
Fetching podspec forReact-RCTLinkingfrom../node_modules/react-native/Libraries/LinkingIOS
Fetching podspec forReact-RCTNetworkfrom../node_modules/react-native/Libraries/Network
Fetching podspec forReact-RCTSettingsfrom../node_modules/react-native/Libraries/Settings
Fetching podspec forReact-RCTTextfrom../node_modules/react-native/Libraries/Text
Fetching podspec forReact-RCTVibrationfrom../node_modules/react-native/Libraries/Vibration
Fetching podspec forReact-RCTWebSocketfrom../node_modules/react-native/Libraries/WebSocket
Fetching podspec forReact-cxxreactfrom../node_modules/react-native/ReactCommon/cxxreact
Fetching podspec forReact-fishhookfrom../node_modules/react-native/Libraries/fishhook
Fetching podspec forReact-jsifrom../node_modules/react-native/ReactCommon/jsi
Fetching podspec forReact-jsiexecutorfrom../node_modules/react-native/ReactCommon/jsiexecutor
Fetching podspec forReact-jsinspectorfrom../node_modules/react-native/ReactCommon/jsinspector
Fetching podspec forreact-native-track-playerfrom../node_modules/react-native-track-player
Fetching podspec foryogafrom../node_modules/react-native/ReactCommon/yoga`
Downloading dependencies
Using DoubleConversion (1.1.6)
Using Folly (2018.10.22.00)
Using RNGestureHandler (1.3.0)
Using React (0.60.3)
Using React-Core (0.60.3)
Using React-DevSupport (0.60.3)
Using React-RCTActionSheet (0.60.3)
Using React-RCTAnimation (0.60.3)
Using React-RCTBlob (0.60.3)
Using React-RCTImage (0.60.3)
Using React-RCTLinking (0.60.3)
Using React-RCTNetwork (0.60.3)
Using React-RCTSettings (0.60.3)
Using React-RCTText (0.60.3)
Using React-RCTVibration (0.60.3)
Using React-RCTWebSocket (0.60.3)
Using React-cxxreact (0.60.3)
Using React-fishhook (0.60.3)
Using React-jsi (0.60.3)
Using React-jsiexecutor (0.60.3)
Using React-jsinspector (0.60.3)
Using boost-for-react-native (1.63.0)
Using glog (0.3.5)
Installing react-native-track-player 2.0.0-rc12 (was 1.2.0)
Using yoga (0.60.3.React)
[!] The following Swift pods cannot yet be integrated as static libraries:
The Swift pod react-native-track-player depends upon React-Core, React-DevSupport, React-RCTActionSheet, React-RCTAnimation, React-RCTBlob, React-RCTImage, React-RCTLinking, React-RCTNetwork, React-RCTSettings, React-RCTText, React-RCTVibration, React-RCTWebSocket, Folly, React-cxxreact, React-jsiexecutor, yoga, React-fishhook, DoubleConversion, glog, React-jsinspector, and React-jsi, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies.
``
Kindly help on that also.
When i do you may setuse_modular_headers!globally in your Podfile, or specify:modular_headers => true` i am getting errors while building project.
Got this error when used use_modular_headers!
Import of module 'glog.glog.log_severity' appears within namespace 'google'
In file included from ios/Pods/Folly/folly/lang/Assume.cpp:19:10
@waqas19921 use_module-headers is known to not work with RN 0.60 -- there's a couple of issues on that repo. Incuding this one: https://github.com/facebook/react-native/issues/25349
@ithustle @fcaride -- constants are now exported differently since this PR landed: https://github.com/react-native-kit/react-native-track-player/pull/654
I've updated the notes on this thread though to include this information.
Well done, @dcvz . I will try this.
Btw, is it a normal behavior putting a track playing on Android? (RNTP 1.2.0)

Is there a possibility to use track player only for playing music?. As maintaining queue in JavaScript gives more flexibility than queue in Track player. If yes, then How to manage changes in notification bar or Lock screen?
@dcvz, I don't know how but useProgress it doesn't working. I'm able to use useTrackPlayerProgress instead and their properties ... RNTP 2.0.0-rc13. Playing songs it get to me position: 0, bufferedPosition: 0 and duration: 0
UPDATE
Reinstalled and everything back to normal

Is it posible that this version takes more time to load the songs? Im getting like 3 seconds more (before it took me 3 seconds and now it take me 6)
playback-metadata-received is not a supported event type for RNTrackPlayer. Supported events are: playback-queue-ended, playback-state, playback-error, playback-track-changed, remote-stop, remote-pause, remote-play, remote-duck, remote-next, remote-seek, remote-previous, remote-jump-forward, remote-jump-backward, remote-like, remote-dislike, remote-bookmark
On playback-track-changed, data.nextTrack is jumping track position. If played more than 2 songs, on second song playing will show third track information.
async _statusTrackChanged(data) {
const currentTrack = data.nextTrack;
if (currentTrack !== null) {
this.setState({ playing: await TrackPlayer.getTrack(currentTrack) });
}
}
Do I need to add some frameworks to the pod project to get this build in iOS. I get a lot of errors during build about "use of undeclared type":
Click to expand
Showing All Messages
CompileSwift normal x86_64 <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Capabilities.swift (in target: react-native-track-player)
cd <omitted>/ios/Pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Capabilities.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/MediaURL.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/PitchAlgorithms.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/SessionCategories.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Track.swift -emit-module-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Capabilities\~partial.swiftmodule -emit-module-doc-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Capabilities\~partial.swiftdoc -serialize-diagnostics-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Capabilities.dia -emit-dependencies-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Capabilities.d -emit-reference-dependencies-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Capabilities.swiftdeps -target x86_64-apple-ios10.0-simulator -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk -I <omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player -F <omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player -enable-testing -g -import-underlying-module -module-cache-path <omitted>/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4.2 -enforce-exclusivity=checked -Onone -D DEBUG -D COCOAPODS -serialize-debugging-options -Xcc -working-directory -Xcc <omitted>/ios/Pods -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=<omitted>/ios/Pods/Headers/Public/react_native_track_player/react-native-track-player.modulemap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/swift-overrides.hmap -Xcc -iquote -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-generated-files.hmap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-own-target-headers.hmap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/all-product-headers.yaml -Xcc -iquote -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-project-headers.hmap -Xcc -I<omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player/include -Xcc -I<omitted>/ios/Pods/Headers/Private -Xcc -I<omitted>/ios/Pods/Headers/Private/react-native-track-player -Xcc -I<omitted>/ios/Pods/Headers/Public -Xcc -I<omitted>/ios/Pods/Headers/Public/DoubleConversion -Xcc -I<omitted>/ios/Pods/Headers/Public/React-Core -Xcc -I<omitted>/ios/Pods/Headers/Public/React-DevSupport -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTActionSheet -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTAnimation -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTBlob -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTImage -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTLinking -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTNetwork -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTSettings -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTText -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTVibration -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTWebSocket -Xcc -I<omitted>/ios/Pods/Headers/Public/React-cxxreact -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsi -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsiexecutor -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsinspector -Xcc -I<omitted>/ios/Pods/Headers/Public/glog -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources-normal/x86_64 -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources/x86_64 -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG=1 -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -module-name react_native_track_player -o <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Capabilities.o -index-store-path <omitted>/Index/DataStore -index-system-modules
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Capabilities.swift:17:65: error: use of undeclared type 'RemoteCommand'
bookmarkOptions: [String: Any]?) -> RemoteCommand {
^~~~~~~~~~~~~
CompileSwift normal x86_64 <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/MediaURL.swift (in target: react-native-track-player)
cd <omitted>/ios/Pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Capabilities.swift -primary-file <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/MediaURL.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/PitchAlgorithms.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/SessionCategories.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Track.swift -emit-module-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/MediaURL\~partial.swiftmodule -emit-module-doc-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/MediaURL\~partial.swiftdoc -serialize-diagnostics-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/MediaURL.dia -emit-dependencies-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/MediaURL.d -emit-reference-dependencies-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/MediaURL.swiftdeps -target x86_64-apple-ios10.0-simulator -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk -I <omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player -F <omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player -enable-testing -g -import-underlying-module -module-cache-path <omitted>/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4.2 -enforce-exclusivity=checked -Onone -D DEBUG -D COCOAPODS -serialize-debugging-options -Xcc -working-directory -Xcc <omitted>/ios/Pods -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=<omitted>/ios/Pods/Headers/Public/react_native_track_player/react-native-track-player.modulemap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/swift-overrides.hmap -Xcc -iquote -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-generated-files.hmap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-own-target-headers.hmap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/all-product-headers.yaml -Xcc -iquote -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-project-headers.hmap -Xcc -I<omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player/include -Xcc -I<omitted>/ios/Pods/Headers/Private -Xcc -I<omitted>/ios/Pods/Headers/Private/react-native-track-player -Xcc -I<omitted>/ios/Pods/Headers/Public -Xcc -I<omitted>/ios/Pods/Headers/Public/DoubleConversion -Xcc -I<omitted>/ios/Pods/Headers/Public/React-Core -Xcc -I<omitted>/ios/Pods/Headers/Public/React-DevSupport -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTActionSheet -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTAnimation -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTBlob -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTImage -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTLinking -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTNetwork -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTSettings -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTText -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTVibration -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTWebSocket -Xcc -I<omitted>/ios/Pods/Headers/Public/React-cxxreact -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsi -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsiexecutor -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsinspector -Xcc -I<omitted>/ios/Pods/Headers/Public/glog -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources-normal/x86_64 -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources/x86_64 -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG=1 -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -module-name react_native_track_player -o <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/MediaURL.o -index-store-path <omitted>/Index/DataStore -index-system-modules
CompileSwift normal x86_64 <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift (in target: react-native-track-player)
cd <omitted>/ios/Pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Capabilities.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/MediaURL.swift -primary-file <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/PitchAlgorithms.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/SessionCategories.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Track.swift -emit-module-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Metadata\~partial.swiftmodule -emit-module-doc-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Metadata\~partial.swiftdoc -serialize-diagnostics-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Metadata.dia -emit-dependencies-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Metadata.d -emit-reference-dependencies-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Metadata.swiftdeps -target x86_64-apple-ios10.0-simulator -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk -I <omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player -F <omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player -enable-testing -g -import-underlying-module -module-cache-path <omitted>/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4.2 -enforce-exclusivity=checked -Onone -D DEBUG -D COCOAPODS -serialize-debugging-options -Xcc -working-directory -Xcc <omitted>/ios/Pods -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=<omitted>/ios/Pods/Headers/Public/react_native_track_player/react-native-track-player.modulemap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/swift-overrides.hmap -Xcc -iquote -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-generated-files.hmap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-own-target-headers.hmap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/all-product-headers.yaml -Xcc -iquote -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-project-headers.hmap -Xcc -I<omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player/include -Xcc -I<omitted>/ios/Pods/Headers/Private -Xcc -I<omitted>/ios/Pods/Headers/Private/react-native-track-player -Xcc -I<omitted>/ios/Pods/Headers/Public -Xcc -I<omitted>/ios/Pods/Headers/Public/DoubleConversion -Xcc -I<omitted>/ios/Pods/Headers/Public/React-Core -Xcc -I<omitted>/ios/Pods/Headers/Public/React-DevSupport -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTActionSheet -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTAnimation -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTBlob -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTImage -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTLinking -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTNetwork -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTSettings -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTText -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTVibration -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTWebSocket -Xcc -I<omitted>/ios/Pods/Headers/Public/React-cxxreact -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsi -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsiexecutor -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsinspector -Xcc -I<omitted>/ios/Pods/Headers/Public/glog -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources-normal/x86_64 -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources/x86_64 -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG=1 -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -module-name react_native_track_player -o <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Metadata.o -index-store-path <omitted>/Index/DataStore -index-system-modules
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift:15:36: error: use of undeclared type 'AudioPlayer'
static func update(for player: AudioPlayer, with metadata: [String: Any]) {
^~~~~~~~~~~
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift:17:19: error: use of undeclared type 'NowPlayingInfoKeyValue'
var ret: [NowPlayingInfoKeyValue] = []
^~~~~~~~~~~~~~~~~~~~~~
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift:20:24: error: use of unresolved identifier 'MediaItemProperty'
ret.append(MediaItemProperty.title(title))
^~~~~~~~~~~~~~~~~
MediaPlayer.MPMediaItemPropertyGenre:1:12: note: did you mean 'MPMediaItemPropertyGenre'?
public let MPMediaItemPropertyGenre: String
^
MediaPlayer.MPMediaItemPropertyTitle:1:12: note: did you mean 'MPMediaItemPropertyTitle'?
public let MPMediaItemPropertyTitle: String
^
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift:24:24: error: use of unresolved identifier 'MediaItemProperty'
ret.append(MediaItemProperty.artist(artist))
^~~~~~~~~~~~~~~~~
MediaPlayer.MPMediaItemPropertyGenre:1:12: note: did you mean 'MPMediaItemPropertyGenre'?
public let MPMediaItemPropertyGenre: String
^
MediaPlayer.MPMediaItemPropertyTitle:1:12: note: did you mean 'MPMediaItemPropertyTitle'?
public let MPMediaItemPropertyTitle: String
^
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift:28:24: error: use of unresolved identifier 'MediaItemProperty'
ret.append(MediaItemProperty.albumTitle(album))
^~~~~~~~~~~~~~~~~
MediaPlayer.MPMediaItemPropertyGenre:1:12: note: did you mean 'MPMediaItemPropertyGenre'?
public let MPMediaItemPropertyGenre: String
^
MediaPlayer.MPMediaItemPropertyTitle:1:12: note: did you mean 'MPMediaItemPropertyTitle'?
public let MPMediaItemPropertyTitle: String
^
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift:32:24: error: use of unresolved identifier 'MediaItemProperty'
ret.append(MediaItemProperty.duration(duration))
^~~~~~~~~~~~~~~~~
MediaPlayer.MPMediaItemPropertyGenre:1:12: note: did you mean 'MPMediaItemPropertyGenre'?
public let MPMediaItemPropertyGenre: String
^
MediaPlayer.MPMediaItemPropertyTitle:1:12: note: did you mean 'MPMediaItemPropertyTitle'?
public let MPMediaItemPropertyTitle: String
^
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift:36:24: error: use of unresolved identifier 'NowPlayingInfoProperty'
ret.append(NowPlayingInfoProperty.elapsedPlaybackTime(elapsedTime))
^~~~~~~~~~~~~~~~~~~~~~
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift:47:68: error: use of unresolved identifier 'MediaItemProperty'
player?.nowPlayingInfoController.set(keyValue: MediaItemProperty.artwork(artwork))
^~~~~~~~~~~~~~~~~
MediaPlayer.MPMediaItemPropertyGenre:1:12: note: did you mean 'MPMediaItemPropertyGenre'?
public let MPMediaItemPropertyGenre: String
^
MediaPlayer.MPMediaItemPropertyTitle:1:12: note: did you mean 'MPMediaItemPropertyTitle'?
public let MPMediaItemPropertyTitle: String
^
CompileSwift normal x86_64 <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/PitchAlgorithms.swift (in target: react-native-track-player)
cd <omitted>/ios/Pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Capabilities.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/MediaURL.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift -primary-file <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/PitchAlgorithms.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/SessionCategories.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Track.swift -emit-module-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/PitchAlgorithms\~partial.swiftmodule -emit-module-doc-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/PitchAlgorithms\~partial.swiftdoc -serialize-diagnostics-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/PitchAlgorithms.dia -emit-dependencies-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/PitchAlgorithms.d -emit-reference-dependencies-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/PitchAlgorithms.swiftdeps -target x86_64-apple-ios10.0-simulator -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk -I <omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player -F <omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player -enable-testing -g -import-underlying-module -module-cache-path <omitted>/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4.2 -enforce-exclusivity=checked -Onone -D DEBUG -D COCOAPODS -serialize-debugging-options -Xcc -working-directory -Xcc <omitted>/ios/Pods -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=<omitted>/ios/Pods/Headers/Public/react_native_track_player/react-native-track-player.modulemap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/swift-overrides.hmap -Xcc -iquote -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-generated-files.hmap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-own-target-headers.hmap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/all-product-headers.yaml -Xcc -iquote -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-project-headers.hmap -Xcc -I<omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player/include -Xcc -I<omitted>/ios/Pods/Headers/Private -Xcc -I<omitted>/ios/Pods/Headers/Private/react-native-track-player -Xcc -I<omitted>/ios/Pods/Headers/Public -Xcc -I<omitted>/ios/Pods/Headers/Public/DoubleConversion -Xcc -I<omitted>/ios/Pods/Headers/Public/React-Core -Xcc -I<omitted>/ios/Pods/Headers/Public/React-DevSupport -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTActionSheet -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTAnimation -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTBlob -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTImage -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTLinking -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTNetwork -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTSettings -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTText -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTVibration -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTWebSocket -Xcc -I<omitted>/ios/Pods/Headers/Public/React-cxxreact -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsi -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsiexecutor -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsinspector -Xcc -I<omitted>/ios/Pods/Headers/Public/glog -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources-normal/x86_64 -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources/x86_64 -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG=1 -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -module-name react_native_track_player -o <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/PitchAlgorithms.o -index-store-path <omitted>/Index/DataStore -index-system-modules
CompileSwift normal x86_64 <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift (in target: react-native-track-player)
cd <omitted>/ios/Pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Capabilities.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/MediaURL.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/PitchAlgorithms.swift -primary-file <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/SessionCategories.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Track.swift -emit-module-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/RNTrackPlayer\~partial.swiftmodule -emit-module-doc-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/RNTrackPlayer\~partial.swiftdoc -serialize-diagnostics-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/RNTrackPlayer.dia -emit-dependencies-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/RNTrackPlayer.d -emit-reference-dependencies-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/RNTrackPlayer.swiftdeps -target x86_64-apple-ios10.0-simulator -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk -I <omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player -F <omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player -enable-testing -g -import-underlying-module -module-cache-path <omitted>/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4.2 -enforce-exclusivity=checked -Onone -D DEBUG -D COCOAPODS -serialize-debugging-options -Xcc -working-directory -Xcc <omitted>/ios/Pods -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=<omitted>/ios/Pods/Headers/Public/react_native_track_player/react-native-track-player.modulemap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/swift-overrides.hmap -Xcc -iquote -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-generated-files.hmap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-own-target-headers.hmap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/all-product-headers.yaml -Xcc -iquote -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-project-headers.hmap -Xcc -I<omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player/include -Xcc -I<omitted>/ios/Pods/Headers/Private -Xcc -I<omitted>/ios/Pods/Headers/Private/react-native-track-player -Xcc -I<omitted>/ios/Pods/Headers/Public -Xcc -I<omitted>/ios/Pods/Headers/Public/DoubleConversion -Xcc -I<omitted>/ios/Pods/Headers/Public/React-Core -Xcc -I<omitted>/ios/Pods/Headers/Public/React-DevSupport -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTActionSheet -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTAnimation -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTBlob -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTImage -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTLinking -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTNetwork -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTSettings -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTText -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTVibration -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTWebSocket -Xcc -I<omitted>/ios/Pods/Headers/Public/React-cxxreact -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsi -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsiexecutor -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsinspector -Xcc -I<omitted>/ios/Pods/Headers/Public/glog -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources-normal/x86_64 -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources/x86_64 -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG=1 -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -module-name react_native_track_player -o <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/RNTrackPlayer.o -index-store-path <omitted>/Index/DataStore -index-system-modules
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift:19:30: error: use of undeclared type 'QueuedAudioPlayer'
private lazy var player: QueuedAudioPlayer = {
^~~~~~~~~~~~~~~~~
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift:40:27: error: use of unresolved identifier 'AVPlayerWrapperState'; did you mean 'AVPlayerLooperStatus'?
"STATE_NONE": AVPlayerWrapperState.idle.rawValue,
^~~~~~~~~~~~~~~~~~~~
AVPlayerLooperStatus
AVFoundation.AVPlayerLooperStatus:2:18: note: 'AVPlayerLooperStatus' declared here
public typealias AVPlayerLooperStatus = AVPlayerLooper.Status
^
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift:41:28: error: use of unresolved identifier 'AVPlayerWrapperState'; did you mean 'AVPlayerLooperStatus'?
"STATE_READY": AVPlayerWrapperState.ready.rawValue,
^~~~~~~~~~~~~~~~~~~~
AVPlayerLooperStatus
AVFoundation.AVPlayerLooperStatus:2:18: note: 'AVPlayerLooperStatus' declared here
public typealias AVPlayerLooperStatus = AVPlayerLooper.Status
^
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift:42:30: error: use of unresolved identifier 'AVPlayerWrapperState'; did you mean 'AVPlayerLooperStatus'?
"STATE_PLAYING": AVPlayerWrapperState.playing.rawValue,
^~~~~~~~~~~~~~~~~~~~
AVPlayerLooperStatus
AVFoundation.AVPlayerLooperStatus:2:18: note: 'AVPlayerLooperStatus' declared here
public typealias AVPlayerLooperStatus = AVPlayerLooper.Status
^
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift:43:29: error: use of unresolved identifier 'AVPlayerWrapperState'; did you mean 'AVPlayerLooperStatus'?
"STATE_PAUSED": AVPlayerWrapperState.paused.rawValue,
^~~~~~~~~~~~~~~~~~~~
AVPlayerLooperStatus
AVFoundation.AVPlayerLooperStatus:2:18: note: 'AVPlayerLooperStatus' declared here
public typealias AVPlayerLooperStatus = AVPlayerLooper.Status
^
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift:44:30: error: use of unresolved identifier 'AVPlayerWrapperState'; did you mean 'AVPlayerLooperStatus'?
"STATE_STOPPED": AVPlayerWrapperState.idle.rawValue,
^~~~~~~~~~~~~~~~~~~~
AVPlayerLooperStatus
AVFoundation.AVPlayerLooperStatus:2:18: note: 'AVPlayerLooperStatus' declared here
public typealias AVPlayerLooperStatus = AVPlayerLooper.Status
^
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift:45:32: error: use of unresolved identifier 'AVPlayerWrapperState'; did you mean 'AVPlayerLooperStatus'?
"STATE_BUFFERING": AVPlayerWrapperState.loading.rawValue,
^~~~~~~~~~~~~~~~~~~~
AVPlayerLooperStatus
AVFoundation.AVPlayerLooperStatus:2:18: note: 'AVPlayerLooperStatus' declared here
public typealias AVPlayerLooperStatus = AVPlayerLooper.Status
^
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift:47:48: error: use of unresolved identifier 'PlaybackEndedReason'
"TRACK_PLAYBACK_ENDED_REASON_END": PlaybackEndedReason.playedUntilEnd.rawValue,
^~~~~~~~~~~~~~~~~~~
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift:48:51: error: use of unresolved identifier 'PlaybackEndedReason'
"TRACK_PLAYBACK_ENDED_REASON_JUMPED": PlaybackEndedReason.jumpedToIndex.rawValue,
^~~~~~~~~~~~~~~~~~~
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift:49:49: error: use of unresolved identifier 'PlaybackEndedReason'
"TRACK_PLAYBACK_ENDED_REASON_NEXT": PlaybackEndedReason.skippedToNext.rawValue,
^~~~~~~~~~~~~~~~~~~
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift:50:53: error: use of unresolved identifier 'PlaybackEndedReason'
"TRACK_PLAYBACK_ENDED_REASON_PREVIOUS": PlaybackEndedReason.skippedToPrevious.rawValue,
^~~~~~~~~~~~~~~~~~~
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift:51:52: error: use of unresolved identifier 'PlaybackEndedReason'
"TRACK_PLAYBACK_ENDED_REASON_STOPPED": PlaybackEndedReason.playerStopped.rawValue,
^~~~~~~~~~~~~~~~~~~
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Capabilities.swift:17:65: error: use of undeclared type 'RemoteCommand'
bookmarkOptions: [String: Any]?) -> RemoteCommand {
^~~~~~~~~~~~~
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift:386:61: error: contextual type 'Any' cannot be used with dictionary literal
sendEvent(withName: "playback-track-changed", body: [
^
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift:401:65: error: contextual type 'Any' cannot be used with dictionary literal
sendEvent(withName: "playback-track-changed", body: [
^
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift:417:65: error: contextual type 'Any' cannot be used with dictionary literal
sendEvent(withName: "playback-track-changed", body: [
^
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift:15:36: error: use of undeclared type 'AudioPlayer'
static func update(for player: AudioPlayer, with metadata: [String: Any]) {
^~~~~~~~~~~
CompileSwift normal x86_64 <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/SessionCategories.swift (in target: react-native-track-player)
cd <omitted>/ios/Pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Capabilities.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/MediaURL.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/PitchAlgorithms.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift -primary-file <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/SessionCategories.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Track.swift -emit-module-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/SessionCategories\~partial.swiftmodule -emit-module-doc-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/SessionCategories\~partial.swiftdoc -serialize-diagnostics-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/SessionCategories.dia -emit-dependencies-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/SessionCategories.d -emit-reference-dependencies-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/SessionCategories.swiftdeps -target x86_64-apple-ios10.0-simulator -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk -I <omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player -F <omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player -enable-testing -g -import-underlying-module -module-cache-path <omitted>/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4.2 -enforce-exclusivity=checked -Onone -D DEBUG -D COCOAPODS -serialize-debugging-options -Xcc -working-directory -Xcc <omitted>/ios/Pods -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=<omitted>/ios/Pods/Headers/Public/react_native_track_player/react-native-track-player.modulemap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/swift-overrides.hmap -Xcc -iquote -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-generated-files.hmap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-own-target-headers.hmap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/all-product-headers.yaml -Xcc -iquote -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-project-headers.hmap -Xcc -I<omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player/include -Xcc -I<omitted>/ios/Pods/Headers/Private -Xcc -I<omitted>/ios/Pods/Headers/Private/react-native-track-player -Xcc -I<omitted>/ios/Pods/Headers/Public -Xcc -I<omitted>/ios/Pods/Headers/Public/DoubleConversion -Xcc -I<omitted>/ios/Pods/Headers/Public/React-Core -Xcc -I<omitted>/ios/Pods/Headers/Public/React-DevSupport -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTActionSheet -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTAnimation -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTBlob -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTImage -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTLinking -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTNetwork -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTSettings -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTText -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTVibration -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTWebSocket -Xcc -I<omitted>/ios/Pods/Headers/Public/React-cxxreact -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsi -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsiexecutor -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsinspector -Xcc -I<omitted>/ios/Pods/Headers/Public/glog -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources-normal/x86_64 -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources/x86_64 -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG=1 -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -module-name react_native_track_player -o <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/SessionCategories.o -index-store-path <omitted>/Index/DataStore -index-system-modules
CompileSwift normal x86_64 <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Track.swift (in target: react-native-track-player)
cd <omitted>/ios/Pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Capabilities.swift <omitted>node_modules/react-native-track-player/ios/RNTrackPlayer/Models/MediaURL.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Utils/Metadata.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/PitchAlgorithms.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/RNTrackPlayer.swift <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/SessionCategories.swift -primary-file <omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Track.swift -emit-module-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Track\~partial.swiftmodule -emit-module-doc-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Track\~partial.swiftdoc -serialize-diagnostics-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Track.dia -emit-dependencies-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Track.d -emit-reference-dependencies-path <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Track.swiftdeps -target x86_64-apple-ios10.0-simulator -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk -I <omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player -F <omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player -enable-testing -g -import-underlying-module -module-cache-path <omitted>/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4.2 -enforce-exclusivity=checked -Onone -D DEBUG -D COCOAPODS -serialize-debugging-options -Xcc -working-directory -Xcc <omitted>/ios/Pods -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=<omitted>/ios/Pods/Headers/Public/react_native_track_player/react-native-track-player.modulemap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/swift-overrides.hmap -Xcc -iquote -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-generated-files.hmap -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-own-target-headers.hmap -Xcc -I<omitted>Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/all-product-headers.yaml -Xcc -iquote -Xcc <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/react-native-track-player-project-headers.hmap -Xcc -I<omitted>/Build/Products/Debug-iphonesimulator/react-native-track-player/include -Xcc -I<omitted>/ios/Pods/Headers/Private -Xcc -I<omitted>/ios/Pods/Headers/Private/react-native-track-player -Xcc -I<omitted>/ios/Pods/Headers/Public -Xcc -I<omitted>/ios/Pods/Headers/Public/DoubleConversion -Xcc -I<omitted>/ios/Pods/Headers/Public/React-Core -Xcc -I<omitted>/ios/Pods/Headers/Public/React-DevSupport -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTActionSheet -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTAnimation -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTBlob -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTImage -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTLinking -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTNetwork -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTSettings -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTText -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTVibration -Xcc -I<omitted>/ios/Pods/Headers/Public/React-RCTWebSocket -Xcc -I<omitted>/ios/Pods/Headers/Public/React-cxxreact -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsi -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsiexecutor -Xcc -I<omitted>/ios/Pods/Headers/Public/React-jsinspector -Xcc -I<omitted>/ios/Pods/Headers/Public/glog -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources-normal/x86_64 -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources/x86_64 -Xcc -I<omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG=1 -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -module-name react_native_track_player -o <omitted>/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-track-player.build/Objects-normal/x86_64/Track.o -index-store-path <omitted>/Index/DataStore -index-system-modules
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Track.swift:97:29: error: use of undeclared type 'SourceType'
func getSourceType() -> SourceType {
^~~~~~~~~~
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Track.swift:13:24: error: use of undeclared type 'AudioItem'
class Track: NSObject, AudioItem, TimePitching, AssetOptionsProviding {
^~~~~~~~~
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Track.swift:13:35: error: use of undeclared type 'TimePitching'
class Track: NSObject, AudioItem, TimePitching, AssetOptionsProviding {
^~~~~~~~~~~~
<omitted>/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/Track.swift:13:49: error: use of undeclared type 'AssetOptionsProviding'
class Track: NSObject, AudioItem, TimePitching, AssetOptionsProviding {
^~~~~~~~~~~~~~~~~~~~~
playback-metadata-receivedis not a supported event type for RNTrackPlayer. Supported events are:playback-queue-ended,playback-state,playback-error,playback-track-changed,remote-stop,remote-pause,remote-play,remote-duck,remote-next,remote-seek,remote-previous,remote-jump-forward,remote-jump-backward,remote-like,remote-dislike,remote-bookmark
playback-metadata-received is currently listed in the docs, but according to this and looking into the code it's only defined in JAVA code. Is there any way currently to get an event when HLS streams start playing a new segment?
My app is getting really slow after one minute using this version, its like when i press play it freezes the main thread. I cant interact with the app until it finish loading the song. Any ideaS?
@dcvz I found a weird behavior with useProgress. When I update the TrackPlayer position with await TrackPlayer.seekTo(position), the hook useProgress only returns the new progress when the TrackPlayer State is playing. In other words if I pause the audio and then seek this hook doesn't update the new progress until I play the audio again.
I believe this is because of this line in the hooks file. We only update on Play or Buffering. I assume this is done because there shouldn't we doing the interval while Pausing. Can we also call that getProgress update call whenever TrackPlayer.seekTo is called?
Another problem with the useProgress hook is it returns 0's for everything after adding a Track and not playing it. So if we just want to load up the track(s) we won't get progress/duration/bufferProgress until we play.
I suggest we call getProgress() in the userProgress hook right before calling useEffect here to first initially get the values
@dcvz After playing around with rc13 some more it seems there are some fundamental issues with getPosition and getDuration on iOS. I'll try and put together a small repro so you can examine what's going on but essentially two huge problems are:
getDuration is not consistent. After setting up the TrackPlayer and calling await TrackPlayer.add(tracks) calling await TrackPlayer.getDuration() after might return 0 or might return the true duration. All we know is that it's wrong when its 0 so the hack right now is to setup an interval and wait until it starts returning a non-zero value. So for this API and for the useProgress hook to work properly we need fix whatever race condition exists here and always return a non-zero duration after we've added tracks. Maybe there is another function we need to await for but there exists some obvious race condition here.
getPosition also is not consistent. After setting up the TrackPlayer and calling await TrackPlayer.add(tracks) and await TrackPlayer.seekTo(newPosition) calling await TrackPlayer.getPosition() may return 0 or may return newPosition. Again there has to be some race condition getting in the way here. I've checked that I'm only calling seekTo in one spot and awaiting that to finish. This one usually never returns the newPosition until the podcasts has started playing even if we do the hack I wrote about here to run TrackPlayer.play(); await TrackPlayer.seekTo(newPosition); TrackPlayer.pause()
Really not sure what's going on here. In the meantime I need to revert back to the v1.x.x for my own app, but after I get that back to working I'll try to put together a small repro to illustrate these bugs.
If you're absolutely not noticing these race conditions then I think the project that we're testing the library in must be getting around the race conditions however I can guarantee they exist in this project and we're going to need to solve them to move forward with the v2
Not to muddy the waters and seem ungrateful for all the wonderful work being done, but can we please get an update on how the release is going and what is and isn't being worked on if anything? I've spent the last week trying to get RC13 up and running to no avail, because the useProgress() hook is broken and returns 0 as @CaptainRedBeard described, along with a handful of other issues.
The last publish to npm was done 6 months ago, has there been any progress since then and if so can it please be put into a new RC?
There's no up-to-date v2.0.0 documentation available anywhere (please do direct me to it if I'm wrong), could we get something more than the odd comment and/or bullet point in random, scattered issues? It would make sense to me to actively keep the documentation up-to-date in the v2 branch (if that's even what's being used)
Again, I do appreciate this package, it's a great piece of work and I'd love to keep using it, however, it seems it's been abandoned or neglected, so could we please get an update?
Also, sorry if this isn't the perfect spot to post this or if there's an answer to my questions in some other random issue, I just couldn't find anything else.
The last publish to npm was done 6 months ago, has there been any progress since then and if so can it please be put into a new RC?
Yes, we'll eventually publish a new version, there are quite a few bug fixes and new features that we've been working on in the last few weeks (you can see the progress in the v2 branch).
There's no up-to-date v2.0.0 documentation available anywhere (please do direct me to it if I'm wrong), could we get something more than the odd comment and/or bullet point in random, scattered issues? It would make sense to me to actively keep the documentation up-to-date in the v2 branch (if that's even what's being used)
There is in the docs folder in the v2 branch. It's not fully updated yet, but most of the new features are already there.
Again, I do appreciate this package, it's a great piece of work and I'd love to keep using it, however, it seems it's been abandoned or neglected, so could we please get an update?
We've been discussing a bit of that on #703
When i seek to some position , progress position gets 0 and then after some renders it gives the actual position
@Guichaguri can we get a new RC maybe published for V2 ? 馃
A contribution:
When I use a Slidercomponent to update progress bar, on onValueChangeproperty if I put TrackPlayer.seekTo(value), the state is updated shaking the component because is re-render.
Maybe you should look out this issue.
@ithustle I came to open an issue for that. Thank you pointing that out. The all Component is re-rendering after calling TrackPlayer.seekTo(value).
@Guichaguri is it possible to tell when are we having the repeat and shuffle options ? I would like to become a contributor.
background controls is not running [ios], someone can help me?
background controls not working and "Ability to use player as a single track player - without the queue functionality" highly requested.
background controls not working and "Ability to use player as a single track player - without the queue functionality" highly requested.
Background controls work only on android
Did you guys, @fernando-pascoal and @frenkie, activated Background feature on Xcode? It works for me both android and IOS
Yes I enabled Background mode and background processing
Hum.. weird. Try to reinstall (remove and add again). But make sure you are using 2.0.0-rc13 version
useProgress is not work and not found in library and show error ...
{"line":56,"column":58,"sourceURL":"http://localhost:8081/src/components/core/media/bottom_player.bundle?platform=ios&dev=true&minify=false&modulesOnly=true&runModule=false&shallow=true"}
For remote controls (notifications, control bar) to work on iOS and Android, be sure to use the new Capability enum added in v2 and not the old SHOUT_CASE capabilities from v1.
Example (works on my device)
./react/screens/Player.js
await TrackPlayer.updateOptions({
capabilities: [
Capability.Play,
Capability.Pause,
Capability.Stop,
Capability.SkipToNext,
Capability.SkipToPrevious
]
});
./service.js
import TrackPlayer, { Event } from "react-native-track-player";
module.exports = async function playerService() {
TrackPlayer.addEventListener(Event.RemotePlay, () => TrackPlayer.play());
TrackPlayer.addEventListener(Event.RemotePause, () => TrackPlayer.pause());
TrackPlayer.addEventListener(Event.RemoteStop, () => TrackPlayer.destroy());
TrackPlayer.addEventListener(Event.RemoteNext, () => TrackPlayer.skipToNext());
TrackPlayer.addEventListener(Event.RemotePrevious, () => TrackPlayer.skipToPrevious());
};
./index.js
import { AppRegistry } from "react-native";
import TrackPlayer from "react-native-track-player";
import App from "./App";
AppRegistry.registerComponent("my-app", () => App);
TrackPlayer.registerPlaybackService(() => require("./service"));
@ithustle, @cwilby tried now reinstalling and with the new Enum but still not working.
I figured out now: It works when I refresh the App twice, but after calling stop() or reset() it does not work again.
Could be a lifecycle issue, I think if you call TrackPlayer.destroy you have to call TrackPlayer.setup and TrackPlayer.updateOptions.
I think I'm running into the same thing, will add more if it happens again.
Even if i don't call stop(), reset() or destory() I have to refresh twice to make background mode work.
@Guichaguri and @dcvz , why progress.position doesn't work when app goes in background mode?
Another thing ... is it supposed Capability.SeekTo make to appears seek component on Media Controls?
Why reset() change playback-track-changed on Android?
Hi
I can't get the notifications to appear on ios 13.3 using iPhone 8 simulator. I have followed the complete guide but it is still not working.
"react-native-track-player": "^2.0.0-rc13"
"react-native": "0.62.2",
Below is my code to setup the player and play the track
async componentDidMount() {
await TrackPlayer.setupPlayer().then(() => {
// The player is ready to be used
});
await TrackPlayer.updateOptions({
capabilities: [
Capability.Play,
Capability.Pause,
Capability.Stop,
Capability.SkipToNext,
Capability.SkipToPrevious,
],
});
var track = {
id: '123456', // Must be a string, required
url: 'https://audione-media.storage.googleapis.com/1586767768179_mp3', // Load media from the network
title: 'Avaritia',
artist: 'deadmau5',
album: 'while(1<2)',
genre: 'Progressive House, Electro House',
date: '2014-05-20T07:00:00+00:00', // RFC 3339
artwork: 'http://example.com/avaritia.png', // Load artwork from the network
};
TrackPlayer.add(track).then(async function () {
// The tracks were added
// State is one of STATE_NONE, STATE_PLAYING, STATE_PAUSED, STATE_STOPPED, STATE_BUFFERING
let state = await TrackPlayer.getState();
console.log(state);
let trackId = await TrackPlayer.getCurrentTrack();
console.log(trackId);
// let trackObject = await TrackPlayer.getTrack(trackId);
// Position, buffered position and duration return values in seconds
let position = await TrackPlayer.getPosition();
let buffered = await TrackPlayer.getBufferedPosition();
let duration = await TrackPlayer.getDuration();
// TrackPlayer.play();
});
}
I have been going round and round in circles for almost two weeks.
Please some help would be really appreciated.
@vjhameed , try use a real device (iPhone). On simulator doesn鈥檛 appear
Sent with GitHawk
Hi! On version rc-13 controls in IOS lock screen disappear after TrackPlayer.skip(trackId). :(
Hi! For some reason that I unknow, await TrackPlayer.setupPlayer({}) is returning null. And documentation page is not showing
And documentation page is not showing
@Guichaguri is working on moving the documentation to a new domain.
@Guichaguri is working on moving the documentation to a new domain.
Cool. await TrackPlayer.setupPlayer({}) is not working... play is not working
Hi! On version rc-13 controls in IOS lock screen disappear after TrackPlayer.skip(trackId). :(
Guys, it is known bug or need to create issue to more details?
I think this has been resolved on the v2 branch, but has not been included in a v2 release yet.
I set only Capability.Play and Capability.Pause into updateOptions but on ios is enabled prev and next buttons and any not work on IOS. Android works beautiful.
To solve this i modify node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/SwiftAudio/Classes/AudioPlayer.swift:
if(item is RemoteCommandable){
enableRemoteCommands(forItem: item)
}
but not works, i need publish app at end of the month
but not works, i need publish app at end of the month
Oh bro, I very understand you. Big problem in is this package one of best. No one alternatives.
v2 is still a work in progress. The iOS lock screen controls issues should be resolved in v1.2.3. Can you try that?
I was using 1.2.3, I Just updated here to v2, needed some modifications (goods ones) and all appears to be working well ...
Someone working here on v2? Are the docs going to be updated?
v2 is still a work in progress. The iOS lock screen controls issues should be resolved in
v1.2.3. Can you try that?
Thanks, v1.2.3 works like a charm!
To update run
yarn add react-native-trackplayer@next. Breaking changes are outlined below:
I believe there is a typo here. It should be yarn add react-native-track-player@next. There is one missing - between track and player.
I was using 1.2.3, I Just updated here to v2, needed some modifications (goods ones) and all appears to be working well ...
Someone working here on v2? Are the docs going to be updated?
To answer your qustion, yes. I switched from v1.2 to v2 yesterday. Some issues that I was previously facing in v1 got solved significantly easy. The changes in the api are pretty good and resposive. Love this library! especially with Hooks!
@curiousdustin @cwilby
The only issue I am facing with v2 right now is the even after enabling capabilities in my musicplayer.js file, the notification controls still dont perform any actions when pressed. stop, pause, next etc, nothing is working from notifications. I have added the all the required Event listeners in the service.js file. Am i missing something? here is the code.
Edit: I downgraded to v2.0.0-rc12 and the notification buttons seems to work sometimes. I believe they will stop working if you reload the app without pausing the music first.
To be clear, the songs streams and plays perfectly fine when i use the controls in the player.js file. Its only the notifications buttons. They wont even give any response. the buttons just arent getting pressed.
This is my service.js file.
```import TrackPlayer, {Event} from 'react-native-track-player';
import {Platform} from 'react-native';
import React from 'react';
module.exports = async function() {
TrackPlayer.addEventListener(
Event.RemotePlay,
async () => await TrackPlayer.play(),
);
TrackPlayer.addEventListener(
Event.RemotePause,
async () => await TrackPlayer.pause(),
);
TrackPlayer.addEventListener(
Event.RemoteStop,
async () => await TrackPlayer.pause().then(() => TrackPlayer.destroy()),
);
TrackPlayer.addEventListener(
Event.RemoteNext,
async () => await TrackPlayer.skipToNext(),
);
TrackPlayer.addEventListener(Event.RemoteJumpForward, async ({position}) => {
console.log('remote-jump-forward');
if (position + 10 < (await TrackPlayer.getDuration())) {
await TrackPlayer.seekTo(position + 10);
} else {
await TrackPlayer.seekTo(0);
}
});
TrackPlayer.addEventListener(Event.RemoteJumpBackward, async ({position}) => {
console.log('remote-jump-backward');
if (position > 10) {
await TrackPlayer.seekTo(position - 10);
} else {
await TrackPlayer.seekTo(0);
}
});
TrackPlayer.addEventListener(Event.RemotePrevious, async () => {
const time = await TrackPlayer.getPosition();
if (time <= 3) {
await TrackPlayer.skipToPrevious();
} else {
await TrackPlayer.seekTo(0);
}
});
TrackPlayer.addEventListener(Event.RemoteSeek, async ({position}) =>
await TrackPlayer.seekTo(position),
);
if (Platform.OS !== 'ios') {
// this event type is not supported on iOS
TrackPlayer.addEventListener(Event.RemoteDuck,async ({ducking}) => {
await TrackPlayer.setVolume(ducking ? 0.5 : 1);
});
}
};
this is a snippet of my **player.js** file.
useEffect(() => {
setup();
}, []);
const setup = async () => {
TrackPlayer.setupPlayer()
.then(async () => {
await TrackPlayer.add({
// url: 'https://sampleswap.org/mp3/artist/5101/Peppy--The-Firing-Squad_YMXB-160.mp3',
url: (await storage()
.ref('Songs/01 - Luck Aazma - www.downloadming.com.mp3')
.getDownloadURL()).toString(),
artwork:
'https://cdn6.f-cdn.com/contestentries/1341746/29180739/5b14c65f43c08_thumb900.jpg',
});
})
.then(console.log('track added.'));
await TrackPlayer.updateOptions({
stopWithApp:false,
jumpInterval:10,
capabilities: [
Capability.Stop,
Capability.Pause,
Capability.Play,
Capability.SeekTo,
Capability.SkipToNext,
Capability.SkipToPrevious
],
compactCapabilities: [
Capability.Stop,
Capability.Pause,
Capability.Play,
]
});
};
... more player UI and control stuff here...
```
I'm trying this version, only one issue so far:
TrackPlayer.remove(); was causing a crash before and it was fixed in the official release, however it is still causing a crash in v2.0
Hi, I am using "react-native-track-player": "^2.0.0-rc13" and I have the following error when using the useProgress hook :

I didn't have this problem a week ago. Can you bring some light on this ?
Hi, I am using
"react-native-track-player": "^2.0.0-rc13"and I have the following error when using theuseProgresshook :
I didn't have this problem a week ago. Can you bring some light on this ?
same here
Is it still needed to install react-native-swift and link it with deprecated react-native link? Does this mean that I cannot use this module if I have other modules requiring Swift 5.0?
EDIT: Tried with manually adding dummy.swift and project is working on emulator
The App crash when try to play that hls stream: https://23742406-channel-hls.ums.ustream.tv/playlist/directhls/channel/23742406/playlist.m3u8?sgn=0bb40779753db5b2e005ce78c261ba67cb554368
sometimes works only development mode
how i update from v1.2.3 to v.2.0.0? im using npm add react-native-trackplayer@next but doesnt work
People facing issues try fixing to exact version in package.json:
"react-native-track-player": "2.0.0-rc13",
Following issues got fixed:
Wish this library had better momentum, seems very powerful. Hope the authors/maintainers will release new stable version of v2 soon.
Any news about v2 release?
@curiousdustin , the v2 seems to be more stable vs 1.2.7 on android,
I think publish a new release of V2 and continue to contribute on this one is a good idea
Most helpful comment
Any news about v2 release?