├── .eslintrc.js ├── .github ├── CODEOWNERS ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ └── feature_request.md └── workflows │ ├── docs-deploy.yml │ ├── nightly.yml │ ├── platform-validation-skip.yml │ ├── platform-validation.yml │ ├── stale-bot.yml │ └── test-docs-deploy.yml ├── .gitignore ├── .husky └── prepare-commit-msg ├── .node-version ├── .npmignore ├── .prettierrc.js ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── android ├── build.gradle ├── proguard-rules.txt └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── doublesymmetry │ │ └── trackplayer │ │ ├── TrackPlayer.kt │ │ ├── extensions │ │ ├── AudioPlayerStateExt.kt │ │ ├── EnumExtensions.kt │ │ └── NumberExt.kt │ │ ├── model │ │ ├── NowPlayingMetadata.kt │ │ ├── State.kt │ │ ├── Track.kt │ │ ├── TrackAudioItem.kt │ │ └── TrackMetadata.kt │ │ ├── module │ │ ├── MusicEvents.kt │ │ └── MusicModule.kt │ │ ├── service │ │ └── MusicService.kt │ │ └── utils │ │ └── BundleUtils.kt │ └── res │ ├── drawable-hdpi │ ├── forward.png │ └── rewind.png │ ├── drawable-mdpi │ ├── forward.png │ └── rewind.png │ ├── drawable-xhdpi │ ├── forward.png │ └── rewind.png │ ├── drawable-xxhdpi │ ├── forward.png │ └── rewind.png │ └── drawable-xxxhdpi │ ├── forward.png │ └── rewind.png ├── docs ├── .gitignore ├── README.md ├── babel.config.js ├── docs │ ├── api │ │ ├── _category_.json │ │ ├── constants │ │ │ ├── _category_.json │ │ │ ├── app-killed-playback-behavior.md │ │ │ ├── capability.md │ │ │ ├── ios-category-mode.md │ │ │ ├── ios-category-options.md │ │ │ ├── ios-category.md │ │ │ ├── pitch-algorithm.md │ │ │ ├── rating.md │ │ │ ├── repeat-mode.md │ │ │ └── state.md │ │ ├── events.md │ │ ├── functions │ │ │ ├── _category_.json │ │ │ ├── lifecycle.md │ │ │ ├── player.md │ │ │ └── queue.md │ │ ├── hooks.md │ │ └── objects │ │ │ ├── _category_.json │ │ │ ├── android-options.md │ │ │ ├── feedback.md │ │ │ ├── metadata-options.md │ │ │ ├── player-options.md │ │ │ ├── resource.md │ │ │ └── track.md │ ├── basics │ │ ├── _category_.json │ │ ├── background-mode.md │ │ ├── getting-started.md │ │ ├── installation.mdx │ │ ├── platform-support.md │ │ └── playback-service.md │ ├── core-team.md │ ├── guides │ │ ├── _category_.json │ │ ├── amazon-fire-support.md │ │ ├── multitrack-progress.md │ │ ├── offline-playback.md │ │ ├── saving-progress.md │ │ └── sleeptimers.md │ ├── intro.md │ ├── sponsors.md │ ├── troubleshooting.md │ ├── v2-migration.md │ ├── v3-migration.md │ └── v3.1.0-migration.md ├── docusaurus.config.js ├── package.json ├── sidebars.js ├── src │ ├── components │ │ └── HomepageFeatures │ │ │ ├── index.tsx │ │ │ └── styles.module.css │ ├── css │ │ └── custom.css │ └── pages │ │ ├── index.module.css │ │ └── index.tsx ├── static │ ├── .nojekyll │ ├── CNAME │ ├── example │ │ ├── Longing.jpeg │ │ ├── Longing.mp3 │ │ ├── Lullaby (Demo).jpeg │ │ ├── Lullaby (Demo).mp3 │ │ ├── Rhythm City (Demo).jpeg │ │ ├── Rhythm City (Demo).mp3 │ │ ├── Soul Searching.jpeg │ │ ├── Soul Searching.mp3 │ │ ├── hls │ │ │ └── whip │ │ │ │ ├── file0.m4a │ │ │ │ ├── file1.m4a │ │ │ │ ├── file10.m4a │ │ │ │ ├── file11.m4a │ │ │ │ ├── file12.m4a │ │ │ │ ├── file13.m4a │ │ │ │ ├── file14.m4a │ │ │ │ ├── file15.m4a │ │ │ │ ├── file16.m4a │ │ │ │ ├── file17.m4a │ │ │ │ ├── file18.m4a │ │ │ │ ├── file19.m4a │ │ │ │ ├── file2.m4a │ │ │ │ ├── file20.m4a │ │ │ │ ├── file21.m4a │ │ │ │ ├── file22.m4a │ │ │ │ ├── file23.m4a │ │ │ │ ├── file3.m4a │ │ │ │ ├── file4.m4a │ │ │ │ ├── file5.m4a │ │ │ │ ├── file6.m4a │ │ │ │ ├── file7.m4a │ │ │ │ ├── file8.m4a │ │ │ │ ├── file9.m4a │ │ │ │ ├── playlist.m3u8 │ │ │ │ ├── whip.jpeg │ │ │ │ └── whip.mp3 │ │ └── smooth-jazz-24-7.jpeg │ └── img │ │ ├── debugging │ │ ├── debug-ios-rntp.png │ │ └── debug-ios-swift-audio-ex.png │ │ ├── logo-old.svg │ │ ├── logo.png │ │ ├── logo.svg │ │ ├── optimized-logo.svg │ │ ├── undraw_audio_player.svg │ │ ├── undraw_building_blocks.svg │ │ ├── undraw_devices.svg │ │ ├── undraw_docusaurus_mountain.svg │ │ ├── undraw_docusaurus_react.svg │ │ ├── undraw_docusaurus_tree.svg │ │ └── undraw_playlist.svg ├── tsconfig.json ├── versioned_docs │ ├── version-2.1 │ │ ├── api │ │ │ ├── _category_.json │ │ │ ├── constants │ │ │ │ ├── _category_.json │ │ │ │ ├── capability.md │ │ │ │ ├── pitch-algorithm.md │ │ │ │ ├── rating.md │ │ │ │ ├── repeat-mode.md │ │ │ │ └── state.md │ │ │ ├── events.md │ │ │ ├── functions │ │ │ │ ├── _category_.json │ │ │ │ ├── lifecycle.md │ │ │ │ ├── player.md │ │ │ │ └── queue.md │ │ │ ├── hooks.md │ │ │ └── objects │ │ │ │ ├── _category_.json │ │ │ │ ├── feedback.md │ │ │ │ ├── resource.md │ │ │ │ └── track.md │ │ ├── basics │ │ │ ├── _category_.json │ │ │ ├── background-mode.md │ │ │ ├── build-preferences.md │ │ │ ├── getting-started.md │ │ │ ├── installation.mdx │ │ │ ├── platform-support.md │ │ │ └── playback-service.md │ │ ├── core-team.md │ │ ├── guides │ │ │ ├── _category_.json │ │ │ ├── amazon-fire-support.md │ │ │ └── offline-playback.md │ │ ├── intro.md │ │ ├── sponsors.md │ │ ├── troubleshooting.md │ │ └── v2-migration.md │ ├── version-3.1 │ │ ├── api │ │ │ ├── _category_.json │ │ │ ├── constants │ │ │ │ ├── _category_.json │ │ │ │ ├── capability.md │ │ │ │ ├── ios-category-mode.md │ │ │ │ ├── ios-category-options.md │ │ │ │ ├── ios-category.md │ │ │ │ ├── pitch-algorithm.md │ │ │ │ ├── rating.md │ │ │ │ ├── repeat-mode.md │ │ │ │ └── state.md │ │ │ ├── events.md │ │ │ ├── functions │ │ │ │ ├── _category_.json │ │ │ │ ├── lifecycle.md │ │ │ │ ├── player.md │ │ │ │ └── queue.md │ │ │ ├── hooks.md │ │ │ └── objects │ │ │ │ ├── _category_.json │ │ │ │ ├── feedback.md │ │ │ │ ├── resource.md │ │ │ │ └── track.md │ │ ├── basics │ │ │ ├── _category_.json │ │ │ ├── background-mode.md │ │ │ ├── getting-started.md │ │ │ ├── installation.mdx │ │ │ ├── platform-support.md │ │ │ └── playback-service.md │ │ ├── core-team.md │ │ ├── guides │ │ │ ├── _category_.json │ │ │ ├── amazon-fire-support.md │ │ │ ├── multitrack-progress.md │ │ │ ├── offline-playback.md │ │ │ ├── saving-progress.md │ │ │ └── sleeptimers.md │ │ ├── intro.md │ │ ├── sponsors.md │ │ ├── troubleshooting.md │ │ ├── v2-migration.md │ │ └── v3-migration.md │ └── version-3.2 │ │ ├── api │ │ ├── _category_.json │ │ ├── constants │ │ │ ├── _category_.json │ │ │ ├── app-killed-playback-behavior.md │ │ │ ├── capability.md │ │ │ ├── ios-category-mode.md │ │ │ ├── ios-category-options.md │ │ │ ├── ios-category.md │ │ │ ├── pitch-algorithm.md │ │ │ ├── rating.md │ │ │ ├── repeat-mode.md │ │ │ └── state.md │ │ ├── events.md │ │ ├── functions │ │ │ ├── _category_.json │ │ │ ├── lifecycle.md │ │ │ ├── player.md │ │ │ └── queue.md │ │ ├── hooks.md │ │ └── objects │ │ │ ├── _category_.json │ │ │ ├── android-options.md │ │ │ ├── feedback.md │ │ │ ├── metadata-options.md │ │ │ ├── player-options.md │ │ │ ├── resource.md │ │ │ └── track.md │ │ ├── basics │ │ ├── _category_.json │ │ ├── background-mode.md │ │ ├── getting-started.md │ │ ├── installation.mdx │ │ ├── platform-support.md │ │ └── playback-service.md │ │ ├── core-team.md │ │ ├── guides │ │ ├── _category_.json │ │ ├── amazon-fire-support.md │ │ ├── multitrack-progress.md │ │ ├── offline-playback.md │ │ ├── saving-progress.md │ │ └── sleeptimers.md │ │ ├── intro.md │ │ ├── sponsors.md │ │ ├── troubleshooting.md │ │ ├── v2-migration.md │ │ ├── v3-migration.md │ │ └── v3.1.0-migration.md ├── versioned_sidebars │ ├── version-2.1-sidebars.json │ ├── version-3.1-sidebars.json │ └── version-3.2-sidebars.json ├── versions.json └── yarn.lock ├── example ├── .buckconfig ├── .bundle │ └── config ├── .eslintrc.js ├── .gitignore ├── .prettierrc.js ├── .ruby-version ├── .watchmanconfig ├── Gemfile ├── Gemfile.lock ├── README.md ├── __tests__ │ └── App-test.tsx ├── android │ ├── app │ │ ├── _BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MainApplication.java │ │ │ │ └── newarchitecture │ │ │ │ ├── MainApplicationReactNativeHost.java │ │ │ │ ├── components │ │ │ │ └── MainComponentsRegistry.java │ │ │ │ └── modules │ │ │ │ └── MainApplicationTurboModuleManagerDelegate.java │ │ │ ├── jni │ │ │ ├── Android.mk │ │ │ ├── MainApplicationModuleProvider.cpp │ │ │ ├── MainApplicationModuleProvider.h │ │ │ ├── MainApplicationTurboModuleManagerDelegate.cpp │ │ │ ├── MainApplicationTurboModuleManagerDelegate.h │ │ │ ├── MainComponentsRegistry.cpp │ │ │ ├── MainComponentsRegistry.h │ │ │ └── OnLoad.cpp │ │ │ └── res │ │ │ ├── drawable-anydpi-v26 │ │ │ └── ic_launcher_background.xml │ │ │ ├── drawable │ │ │ └── rn_edit_text_material.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi-v26 │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi-v26 │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi-v26 │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi-v26 │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi-v26 │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── icon-background.svg ├── icon.svg ├── index.js ├── ios │ ├── Podfile │ ├── dummy.swift │ ├── example-Bridging-Header.h │ ├── example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── example.xcscheme │ ├── example.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── example │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── 100.png │ │ │ │ ├── 1024.png │ │ │ │ ├── 114.png │ │ │ │ ├── 120.png │ │ │ │ ├── 128.png │ │ │ │ ├── 144.png │ │ │ │ ├── 152.png │ │ │ │ ├── 16.png │ │ │ │ ├── 167.png │ │ │ │ ├── 172.png │ │ │ │ ├── 180.png │ │ │ │ ├── 196.png │ │ │ │ ├── 20.png │ │ │ │ ├── 216.png │ │ │ │ ├── 256.png │ │ │ │ ├── 29.png │ │ │ │ ├── 32.png │ │ │ │ ├── 40.png │ │ │ │ ├── 48.png │ │ │ │ ├── 50.png │ │ │ │ ├── 512.png │ │ │ │ ├── 55.png │ │ │ │ ├── 57.png │ │ │ │ ├── 58.png │ │ │ │ ├── 60.png │ │ │ │ ├── 64.png │ │ │ │ ├── 72.png │ │ │ │ ├── 76.png │ │ │ │ ├── 80.png │ │ │ │ ├── 87.png │ │ │ │ ├── 88.png │ │ │ │ ├── Contents.json │ │ │ │ ├── ios-marketing-1024@1x.png │ │ │ │ ├── ipad-20@1x.png │ │ │ │ ├── ipad-20@2x.png │ │ │ │ ├── ipad-29@1x.png │ │ │ │ ├── ipad-29@2x.png │ │ │ │ ├── ipad-40@1x.png │ │ │ │ ├── ipad-40@2x.png │ │ │ │ ├── ipad-76@1x.png │ │ │ │ ├── ipad-76@2x.png │ │ │ │ ├── ipad-83.5@2x.png │ │ │ │ ├── iphone-20@2x.png │ │ │ │ ├── iphone-20@3x.png │ │ │ │ ├── iphone-29@2x.png │ │ │ │ ├── iphone-29@3x.png │ │ │ │ ├── iphone-40@2x.png │ │ │ │ ├── iphone-40@3x.png │ │ │ │ ├── iphone-60@2x.png │ │ │ │ └── iphone-60@3x.png │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── main.m │ └── exampleTests │ │ ├── Info.plist │ │ └── exampleTests.m ├── metro.config.js ├── msbuild.binlog ├── package.json ├── src │ ├── App.tsx │ ├── assets │ │ ├── data │ │ │ └── playlist.json │ │ └── resources │ │ │ ├── artwork.jpg │ │ │ └── pure.m4a │ ├── components │ │ ├── Button.tsx │ │ ├── PlayPauseButton.tsx │ │ ├── PlayerControls.tsx │ │ ├── Progress.tsx │ │ ├── TrackInfo.tsx │ │ └── index.ts │ ├── hooks │ │ ├── index.ts │ │ ├── useCurrentTrack.ts │ │ ├── useDebouncedValue.ts │ │ └── useOnTogglePlayback.ts │ └── services │ │ ├── PlaybackService.ts │ │ ├── QueueInitialTracksService.ts │ │ ├── SetupService.ts │ │ └── index.ts ├── tsconfig.json ├── windows │ ├── .gitignore │ ├── ExperimentalFeatures.props │ ├── NuGet.Config │ ├── example.sln │ └── example │ │ ├── .gitignore │ │ ├── App.cpp │ │ ├── App.h │ │ ├── App.idl │ │ ├── App.xaml │ │ ├── Assets │ │ ├── LockScreenLogo.scale-200.png │ │ ├── SplashScreen.scale-200.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ │ ├── StoreLogo.png │ │ └── Wide310x150Logo.scale-200.png │ │ ├── AutolinkedNativeModules.g.cpp │ │ ├── AutolinkedNativeModules.g.h │ │ ├── AutolinkedNativeModules.g.props │ │ ├── AutolinkedNativeModules.g.targets │ │ ├── MainPage.cpp │ │ ├── MainPage.h │ │ ├── MainPage.idl │ │ ├── MainPage.xaml │ │ ├── Package.appxmanifest │ │ ├── PropertySheet.props │ │ ├── ReactPackageProvider.cpp │ │ ├── ReactPackageProvider.h │ │ ├── example.vcxproj │ │ ├── example.vcxproj.filters │ │ ├── example_TemporaryKey.pfx │ │ ├── packages.config │ │ ├── pch.cpp │ │ └── pch.h └── yarn.lock ├── ios ├── RNTrackPlayer.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── RNTrackPlayer │ ├── Models │ ├── Capabilities.swift │ ├── MediaURL.swift │ ├── PitchAlgorithms.swift │ ├── SessionCategories.swift │ ├── State.swift │ └── Track.swift │ ├── RNTrackPlayer.swift │ ├── RNTrackPlayerBridge.h │ ├── RNTrackPlayerBridge.m │ ├── Support │ └── RNTrackPlayer-Bridging-Header.h │ ├── Utils │ └── Metadata.swift │ └── Vendor │ └── SwiftAudio │ └── Classes │ ├── RepeatMode.swift │ └── Utils │ └── DispatchQueueType.swift ├── package.json ├── react-native-track-player.podspec ├── src ├── hooks.ts ├── index.ts ├── interfaces.ts └── trackPlayer.ts ├── tsconfig.json ├── windows ├── .gitignore ├── README.md ├── RNTrackPlayer │ ├── Logic │ │ ├── Events.h │ │ ├── MediaManager.cpp │ │ ├── MediaManager.h │ │ ├── Metadata.cpp │ │ ├── Metadata.h │ │ ├── Track.cpp │ │ ├── Track.h │ │ ├── Utils.cpp │ │ └── Utils.h │ ├── Players │ │ ├── CastPlayback.cpp │ │ ├── CastPlayback.h │ │ ├── LocalPlayback.cpp │ │ ├── LocalPlayback.h │ │ ├── Playback.cpp │ │ └── Playback.h │ ├── PropertySheet.props │ ├── RNTrackPlayer.cpp │ ├── RNTrackPlayer.def │ ├── RNTrackPlayer.h │ ├── RNTrackPlayer.vcxproj │ ├── RNTrackPlayer.vcxproj.filters │ ├── ReactPackageProvider.cpp │ ├── ReactPackageProvider.h │ ├── ReactPackageProvider.idl │ ├── packages.config │ ├── pch.cpp │ └── pch.h ├── RNTrackPlayer62.sln └── RNTrackPlayer63.sln └── yarn.lock /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: '@typescript-eslint/parser', // Specifies the ESLint parser 3 | extends: [ 4 | 'eslint:recommended', 5 | 'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin 6 | 'plugin:react-hooks/recommended', 7 | ], 8 | parserOptions: { 9 | ecmaVersion: 2017, // Allows for the parsing of modern ECMAScript features 10 | sourceType: 'module', // Allows for the use of imports 11 | }, 12 | rules: { 13 | // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @dcvz 2 | /android/ @mpivchev 3 | /docs/ @jspizziri 4 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: DoubleSymmetry 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Report a bug or crash 4 | title: '' 5 | labels: Bug 6 | assignees: '' 7 | --- 8 | 9 | **Describe the Bug** 10 | A clear and concise description of what the bug is. 11 | 12 | **Steps To Reproduce** 13 | How can someone else reproduce this bug? 14 | 15 | **Code To Reproduce** 16 | Please provide a simple code example that allows others to replicate the bug. 17 | 18 | **Replicable on Example App?** 19 | Can you replicate this bug in the [React Native Track Player Example App](https://github.com/doublesymmetry/react-native-track-player/tree/main/example)? 20 | 21 | **Environment Info:** 22 | Paste the results of `npx react-native info` 23 | Paste the exact `react-native-track-player` version you are using 24 | Real device? Or simulator? 25 | What OS are you running? 26 | 27 | **How I can Help** 28 | What can you do to help resolve this? 29 | Have you investigated the underlying JS or Swift/Android code causing this bug? 30 | Can you create a Pull Request with a fix? 31 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Discord Community 4 | url: https://discordapp.com/invite/ya2XDCR 5 | about: We're open to answer questions here. 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest a feature for this project 4 | title: '[Feature Request] ' 5 | labels: "Feature Request" 6 | assignees: '' 7 | 8 | --- 9 | 10 | **What is the need and use case of this feature?** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the ideal solution** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | 22 | **How I can Help** 23 | What can you do to help get this feature into production? 24 | Can you assist by working on this feature and creating a Pull Request? 25 | 26 | -------------------------------------------------------------------------------- /.github/workflows/docs-deploy.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | paths: 6 | - '.github/workflows/deploy.yml' 7 | - 'docs/**' 8 | 9 | jobs: 10 | deploy: 11 | runs-on: ubuntu-latest 12 | concurrency: 13 | group: ${{ github.workflow }}-${{ github.ref }} 14 | defaults: 15 | run: 16 | working-directory: docs 17 | steps: 18 | - uses: actions/checkout@v2 19 | - uses: actions/setup-node@v3 20 | with: 21 | node-version: 16.x 22 | cache: yarn 23 | 24 | - name: Install dependencies 25 | run: yarn install --frozen-lockfile 26 | - name: Build website 27 | run: yarn build 28 | 29 | # Popular action to deploy to GitHub Pages: 30 | # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus 31 | - name: Deploy to GitHub Pages 32 | uses: peaceiris/actions-gh-pages@v3 33 | with: 34 | github_token: ${{ secrets.GITHUB_TOKEN }} 35 | # Build output to publish to the `gh-pages` branch: 36 | publish_dir: ./docs/build 37 | # The following lines assign commit authorship to the official 38 | # GH-Actions bot for deploys to `gh-pages` branch: 39 | # https://github.com/actions/checkout/issues/13#issuecomment-724415212 40 | # The GH actions bot is used by default if you didn't specify the two fields. 41 | # You can swap them out with your own user credentials. 42 | user_name: github-actions[bot] 43 | user_email: 41898282+github-actions[bot]@users.noreply.github.com 44 | -------------------------------------------------------------------------------- /.github/workflows/nightly.yml: -------------------------------------------------------------------------------- 1 | name: nightly 2 | on: 3 | workflow_dispatch: 4 | schedule: 5 | # run job at 00:00:00 UTC 6 | - cron: '0 0 * * *' 7 | 8 | jobs: 9 | nightly_build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout Repo 13 | uses: actions/checkout@v2 14 | - name: Setup Node 15 | uses: actions/setup-node@v2 16 | with: 17 | node-version: 16.x 18 | - name: Install dependencies 19 | run: yarn install --frozen-lockfile 20 | - name: Build Library 21 | run: yarn build 22 | - name: Extract Version 23 | run: echo "LIB_VERSION=$(yarn info . version | head -2 | tail -1)" >> $GITHUB_ENV 24 | - name: Set Nightly Version 25 | run: yarn version --no-git-tag-version --no-commit-hooks --new-version ${{ env.LIB_VERSION }}-${{ github.sha }} 26 | - uses: JS-DevTools/npm-publish@v1 27 | with: 28 | token: ${{ secrets.NPM_TOKEN }} 29 | tag: nightly 30 | -------------------------------------------------------------------------------- /.github/workflows/platform-validation-skip.yml: -------------------------------------------------------------------------------- 1 | # this validation workflow bypasses the standard platform-validation.yml 2 | # if only documentation has been modified. 3 | name: platform-validation 4 | on: 5 | push: 6 | branches: 7 | - main 8 | paths: 9 | - 'docs/**' 10 | pull_request: 11 | branches: 12 | - main 13 | paths: 14 | - 'docs/**' 15 | 16 | concurrency: 17 | group: ${{ github.workflow }}-${{ github.ref }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | build-android: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - run: 'echo "No build required"' 25 | build-ios: 26 | runs-on: ubuntu-latest 27 | steps: 28 | - run: 'echo "No build required"' 29 | check-typescript: 30 | runs-on: ubuntu-latest 31 | steps: 32 | - run: 'echo "No build required"' 33 | -------------------------------------------------------------------------------- /.github/workflows/stale-bot.yml: -------------------------------------------------------------------------------- 1 | name: Mark stale issues and pull requests 2 | on: 3 | schedule: 4 | - cron: "30 1 * * *" 5 | jobs: 6 | stale: 7 | runs-on: ubuntu-latest 8 | permissions: 9 | issues: write 10 | pull-requests: write 11 | steps: 12 | - uses: actions/stale@v5 13 | with: 14 | repo-token: ${{ secrets.GITHUB_TOKEN }} 15 | days-before-stale: 90 16 | stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.' 17 | stale-pr-message: 'This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.' 18 | close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.' 19 | close-pr-message: 'This PR was closed because it has been stalled for 7 days with no activity.' 20 | -------------------------------------------------------------------------------- /.github/workflows/test-docs-deploy.yml: -------------------------------------------------------------------------------- 1 | on: 2 | pull_request: 3 | branches: 4 | - main 5 | paths: 6 | - '.github/workflows/deploy.yml' 7 | - 'docs/**' 8 | # Review gh actions docs if you want to further define triggers, paths, etc 9 | # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on 10 | 11 | jobs: 12 | test-deploy: 13 | runs-on: ubuntu-latest 14 | concurrency: 15 | group: ${{ github.workflow }}-${{ github.ref }} 16 | defaults: 17 | run: 18 | working-directory: docs 19 | steps: 20 | - uses: actions/checkout@v2 21 | - uses: actions/setup-node@v3 22 | with: 23 | node-version: 16.x 24 | cache: yarn 25 | 26 | - name: Install dependencies 27 | run: yarn install --frozen-lockfile 28 | - name: Test build website 29 | run: yarn build 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # General 2 | 3 | .DS_Store 4 | node_modules/ 5 | build/ 6 | lib/ 7 | DerivedData/ 8 | package-lock.json 9 | .idea/ 10 | 11 | # Android 12 | 13 | android/.gradle/ 14 | android/.idea/ 15 | android/build/ 16 | android/gradle/ 17 | android/captures/ 18 | android/local.properties 19 | android/*.iml 20 | android/gradlew 21 | android/gradlew.bat 22 | 23 | # Windows 24 | 25 | windows/.vs/ 26 | windows/ARM/ 27 | windows/RNTrackPlayer/bin/ 28 | windows/RNTrackPlayer/obj/ 29 | windows/RNTrackPlayer/project.lock.json 30 | 31 | # iOS 32 | 33 | ## Various settings 34 | *.pbxuser 35 | !default.pbxuser 36 | *.mode1v3 37 | !default.mode1v3 38 | *.mode2v3 39 | !default.mode2v3 40 | *.perspectivev3 41 | !default.perspectivev3 42 | xcuserdata/ 43 | 44 | ## Other 45 | *.moved-aside 46 | *.xccheckout 47 | *.xcscmblueprint 48 | 49 | ## Obj-C/Swift specific 50 | *.hmap 51 | *.ipa 52 | *.dSYM.zip 53 | *.dSYM 54 | example/ios/Pods 55 | /ios/RNTrackPlayer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist 56 | ios/Pods 57 | ios/RNTrackPlayer.xcworkspace 58 | Podfile.lock 59 | -------------------------------------------------------------------------------- /.husky/prepare-commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | exec < /dev/tty && npx cz --hook || true 5 | -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | 16 2 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Excluded from NPM 2 | 3 | example/ 4 | docs/ 5 | _Pods.xcodeproj 6 | 7 | # General 8 | 9 | .DS_Store 10 | node_modules/ 11 | build/ 12 | DerivedData/ 13 | package-lock.json 14 | yarn.lock 15 | .idea/ 16 | 17 | # Android 18 | 19 | android/.gradle/ 20 | android/.idea/ 21 | android/build/ 22 | android/gradle/ 23 | android/captures/ 24 | android/local.properties 25 | gradle.properties 26 | android/*.iml 27 | android/gradlew 28 | android/gradlew.bat 29 | 30 | # Windows 31 | 32 | windows/.vs/ 33 | windows/ARM/ 34 | windows/RNTrackPlayer/bin/ 35 | windows/RNTrackPlayer/obj/ 36 | windows/RNTrackPlayer/project.lock.json 37 | 38 | # iOS 39 | 40 | ## Various settings 41 | *.pbxuser 42 | !default.pbxuser 43 | *.mode1v3 44 | !default.mode1v3 45 | *.mode2v3 46 | !default.mode2v3 47 | *.perspectivev3 48 | !default.perspectivev3 49 | xcuserdata/ 50 | 51 | ## Other 52 | *.moved-aside 53 | *.xccheckout 54 | *.xcscmblueprint 55 | 56 | ## Obj-C/Swift specific 57 | *.hmap 58 | *.ipa 59 | *.dSYM.zip 60 | *.dSYM 61 | example/ios/Pods 62 | /ios/RNTrackPlayer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist 63 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | singleQuote: true, 3 | }; 4 | -------------------------------------------------------------------------------- /android/proguard-rules.txt: -------------------------------------------------------------------------------- 1 | 2 | # Ignore "not found" errors for libraries 3 | -dontwarn com.google.android.exoplayer2.** 4 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /android/src/main/java/com/doublesymmetry/trackplayer/TrackPlayer.kt: -------------------------------------------------------------------------------- 1 | package com.doublesymmetry.trackplayer 2 | 3 | import com.doublesymmetry.trackplayer.module.MusicModule 4 | import com.facebook.react.ReactPackage 5 | import com.facebook.react.bridge.NativeModule 6 | import com.facebook.react.bridge.ReactApplicationContext 7 | import com.facebook.react.uimanager.ViewManager 8 | 9 | /** 10 | * TrackPlayer 11 | * https://github.com/react-native-kit/react-native-track-player 12 | * @author Milen Pivchev @mpivchev 13 | */ 14 | class TrackPlayer : ReactPackage { 15 | override fun createNativeModules(reactContext: ReactApplicationContext): List { 16 | return listOf(MusicModule(reactContext)) 17 | } 18 | 19 | override fun createViewManagers(reactContext: ReactApplicationContext): List> { 20 | return emptyList() 21 | } 22 | } -------------------------------------------------------------------------------- /android/src/main/java/com/doublesymmetry/trackplayer/extensions/AudioPlayerStateExt.kt: -------------------------------------------------------------------------------- 1 | package com.doublesymmetry.trackplayer.extensions 2 | 3 | import com.doublesymmetry.kotlinaudio.models.AudioPlayerState 4 | import com.doublesymmetry.trackplayer.model.State 5 | 6 | val AudioPlayerState.asLibState: State 7 | get() { 8 | return when(this) { 9 | AudioPlayerState.LOADING -> State.Connecting 10 | AudioPlayerState.READY -> State.Ready 11 | AudioPlayerState.BUFFERING -> State.Buffering 12 | AudioPlayerState.PAUSED -> State.Paused 13 | AudioPlayerState.PLAYING -> State.Playing 14 | AudioPlayerState.IDLE -> State.Idle 15 | AudioPlayerState.ENDED -> State.Stopped 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /android/src/main/java/com/doublesymmetry/trackplayer/extensions/EnumExtensions.kt: -------------------------------------------------------------------------------- 1 | package com.doublesymmetry.trackplayer.extensions 2 | 3 | inline fun , V> ((T) -> V).find(value: V): T? { 4 | return enumValues().firstOrNull { this(it) == value } 5 | } -------------------------------------------------------------------------------- /android/src/main/java/com/doublesymmetry/trackplayer/extensions/NumberExt.kt: -------------------------------------------------------------------------------- 1 | package com.doublesymmetry.trackplayer.extensions 2 | 3 | class NumberExt { 4 | companion object { 5 | fun Number.toSeconds(): Double { 6 | return this.toDouble() / 1000 7 | } 8 | 9 | fun Number.toMilliseconds(): Long { 10 | return (this.toDouble() * 1000).toLong() 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /android/src/main/java/com/doublesymmetry/trackplayer/model/NowPlayingMetadata.kt: -------------------------------------------------------------------------------- 1 | package com.doublesymmetry.trackplayer.model 2 | 3 | import android.content.Context 4 | import android.os.Bundle 5 | 6 | class NowPlayingMetadata(context: Context, bundle: Bundle?, ratingType: Int) : TrackMetadata() { 7 | var elapsedTime = 0.0 8 | override fun setMetadata(context: Context, bundle: Bundle?, ratingType: Int) { 9 | super.setMetadata(context, bundle, ratingType) 10 | elapsedTime = bundle!!.getDouble("elapsedTime", 0.0) 11 | } 12 | 13 | init { 14 | setMetadata(context, bundle, ratingType) 15 | } 16 | } -------------------------------------------------------------------------------- /android/src/main/java/com/doublesymmetry/trackplayer/model/State.kt: -------------------------------------------------------------------------------- 1 | package com.doublesymmetry.trackplayer.model 2 | 3 | enum class State(val state: String) { 4 | Idle("idle"), 5 | Ready("ready"), 6 | Playing("playing"), 7 | Paused("paused"), 8 | Stopped("stopped"), 9 | Buffering("buffering"), 10 | Connecting("connecting"), 11 | } -------------------------------------------------------------------------------- /android/src/main/java/com/doublesymmetry/trackplayer/model/TrackAudioItem.kt: -------------------------------------------------------------------------------- 1 | package com.doublesymmetry.trackplayer.model 2 | 3 | import com.doublesymmetry.kotlinaudio.models.AudioItem 4 | import com.doublesymmetry.kotlinaudio.models.AudioItemOptions 5 | import com.doublesymmetry.kotlinaudio.models.MediaType 6 | 7 | data class TrackAudioItem( 8 | val track: Track, 9 | override val type: MediaType, 10 | override var audioUrl: String, 11 | override var artist: String? = null, 12 | override var title: String? = null, 13 | override var albumTitle: String? = null, 14 | override val artwork: String? = null, 15 | override val duration: Long = -1, 16 | override val options: AudioItemOptions? = null 17 | ): AudioItem -------------------------------------------------------------------------------- /android/src/main/java/com/doublesymmetry/trackplayer/model/TrackMetadata.kt: -------------------------------------------------------------------------------- 1 | package com.doublesymmetry.trackplayer.model 2 | 3 | import android.content.Context 4 | import android.net.Uri 5 | import android.os.Bundle 6 | import android.support.v4.media.RatingCompat 7 | import com.doublesymmetry.trackplayer.extensions.NumberExt.Companion.toMilliseconds 8 | import com.doublesymmetry.trackplayer.utils.BundleUtils 9 | 10 | abstract class TrackMetadata { 11 | var artwork: Uri? = null 12 | var title: String? = null 13 | var artist: String? = null 14 | var album: String? = null 15 | var date: String? = null 16 | var genre: String? = null 17 | var duration: Long = 0 18 | var rating: RatingCompat? = null 19 | open fun setMetadata(context: Context, bundle: Bundle?, ratingType: Int) { 20 | artwork = BundleUtils.getUri(context, bundle, "artwork") 21 | title = bundle!!.getString("title") 22 | artist = bundle.getString("artist") 23 | album = bundle.getString("album") 24 | date = bundle.getString("date") 25 | genre = bundle.getString("genre") 26 | duration = (bundle.getDouble("duration", 0.0)).toMilliseconds() 27 | rating = BundleUtils.getRating(bundle, "rating", ratingType) 28 | } 29 | } -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/android/src/main/res/drawable-hdpi/forward.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/rewind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/android/src/main/res/drawable-hdpi/rewind.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/android/src/main/res/drawable-mdpi/forward.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/rewind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/android/src/main/res/drawable-mdpi/rewind.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/android/src/main/res/drawable-xhdpi/forward.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/rewind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/android/src/main/res/drawable-xhdpi/rewind.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/android/src/main/res/drawable-xxhdpi/forward.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/rewind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/android/src/main/res/drawable-xxhdpi/rewind.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/android/src/main/res/drawable-xxxhdpi/forward.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/rewind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/android/src/main/res/drawable-xxxhdpi/rewind.png -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Website 2 | 3 | This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. 4 | 5 | ### Installation 6 | 7 | ``` 8 | $ yarn 9 | ``` 10 | 11 | ### Local Development 12 | 13 | ``` 14 | $ yarn start 15 | ``` 16 | 17 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. 18 | 19 | ### Build 20 | 21 | ``` 22 | $ yarn build 23 | ``` 24 | 25 | This command generates static content into the `build` directory and can be served using any static contents hosting service. 26 | 27 | ### Deployment 28 | 29 | Using SSH: 30 | 31 | ``` 32 | $ USE_SSH=true yarn deploy 33 | ``` 34 | 35 | Not using SSH: 36 | 37 | ``` 38 | $ GIT_USER= yarn deploy 39 | ``` 40 | 41 | If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. 42 | -------------------------------------------------------------------------------- /docs/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /docs/docs/api/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "API Reference", 3 | "position": 3 4 | } 5 | -------------------------------------------------------------------------------- /docs/docs/api/constants/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Constants", 3 | "position": 4 4 | } 5 | -------------------------------------------------------------------------------- /docs/docs/api/constants/app-killed-playback-behavior.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 6 3 | --- 4 | 5 | # App Killed Playback Behavior (android-only) 6 | 7 | ```ts 8 | import { AppKilledPlaybackBehavior } from 'react-native-track-player'; 9 | ``` 10 | 11 | ## `ContinuePlayback` (default) 12 | 13 | This option will continue playing audio in the background when the app is 14 | removed from recents. The notification remains. This is the default. 15 | 16 | ## `PausePlayback` 17 | 18 | This option will pause playing audio in the background when the app is removed 19 | from recents. The notification remains and can be used to resume playback. 20 | 21 | ## `StopPlaybackAndRemoveNotification` 22 | 23 | This option will stop playing audio in the background when the app is removed 24 | from recents. The notification is removed and can't be used to resume playback. 25 | Users would need to open the app again to start playing audio. 26 | -------------------------------------------------------------------------------- /docs/docs/api/constants/capability.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Capability 6 | 7 | All Capability types are made available through the named export `Capability`: 8 | 9 | ```ts 10 | import { Capability } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Play` | Capability indicating the ability to play | 16 | | `PlayFromId` | Capability indicating the ability to play from a track id (Required for Android Auto) | 17 | | `PlayFromSearch` | Capability indicating the ability to play from a text/voice search (Required for Android Auto) | 18 | | `Pause` | Capability indicating the ability to pause | 19 | | `Stop` | Capability indicating the ability to stop | 20 | | `SeekTo` | Capability indicating the ability to seek to a position in the timeline | 21 | | `Skip` | Capability indicating the ability to skip to any song in the queue | 22 | | `SkipToNext` | Capability indicating the ability to skip to the next track | 23 | | `SkipToPrevious` | Capability indicating the ability to skip to the previous track | 24 | | `SetRating` | Capability indicating the ability to set the rating value based on the rating type | 25 | | `JumpForward` | Capability indicating the ability to jump forward by the amount of seconds specified in the options | 26 | | `JumpBackward` | Capability indicating the ability to jump backward by the amount of seconds specified in the options | 27 | | `Like` | (ios-only) Capability indicating the ability to like from control center | 28 | | `Dislike` | (ios-only) Capability indicating the ability to dislike from control center | 29 | | `Bookmark` | (ios-only) Capability indicating the ability to bookmark from control center | 30 | -------------------------------------------------------------------------------- /docs/docs/api/constants/ios-category.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 6 3 | --- 4 | 5 | # iOS Category (ios-only) 6 | 7 | All iOS Category types are made available through the named export `IOSCategory`: 8 | 9 | ```ts 10 | import { IOSCategory } from 'react-native-track-player'; 11 | ``` 12 | 13 | ## `Playback` 14 | 15 | The category for playing recorded music or other sounds that are central to the 16 | successful use of your app. 17 | 18 | [See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/category/1616509-playback) 19 | 20 | 21 | ## `PlayAndRecord` 22 | 23 | The category for recording (input) and playback (output) of audio, such as for a 24 | Voice over Internet Protocol (VoIP) app. 25 | 26 | [See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/category/1616568-playandrecord) 27 | 28 | ## `MultiRoute` 29 | 30 | The category for routing distinct streams of audio data to different output 31 | devices at the same time. 32 | 33 | [See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/category/1616484-multiroute) 34 | 35 | ## `Ambient` 36 | 37 | The category for an app in which sound playback is nonprimary — that is, your 38 | app also works with the sound turned off. 39 | 40 | [See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/category/1616560-ambient) 41 | 42 | ## `SoloAmbient` 43 | 44 | The default audio session category. 45 | 46 | [See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/category/1616488-soloambient) 47 | 48 | ## `Record` 49 | 50 | The category for recording audio while also silencing playback audio. 51 | 52 | [See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/category/1616451-record) 53 | -------------------------------------------------------------------------------- /docs/docs/api/constants/pitch-algorithm.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 5 3 | --- 4 | 5 | # Pitch Algorithm (ios-only) 6 | 7 | All PitchAlgorithm types are made available through the named export `PitchAlgorithm`: 8 | 9 | ```ts 10 | import { PitchAlgorithm } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Linear` | An algorithm suitable for general use. | 16 | | `Music` | An algorithm suitable for music. | 17 | | `Voice` | An algorithm suitable for voice. | 18 | -------------------------------------------------------------------------------- /docs/docs/api/constants/rating.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | --- 4 | 5 | # Rating 6 | 7 | All RatingType types are made available through the named export `RatingType`: 8 | 9 | ```ts 10 | import { RatingType } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Heart` | Rating type indicating "with heart" or "without heart", its value is a `boolean`. | 16 | | `ThumbsUpDown` | Rating type indicating "thumbs up" or "thumbs down", its value is a `boolean`. | 17 | | `ThreeStars` | Rating type indicating 0 to 3 stars, its value is a `number` of stars. | 18 | | `FourStars` | Rating type indicating 0 to 4 stars, its value is a `number` of stars. | 19 | | `FiveStars` | Rating type indicating 0 to 5 stars, its value is a `number` of stars. | 20 | | `Percentage` | Rating type indicating percentage, its value is a `number`. | 21 | -------------------------------------------------------------------------------- /docs/docs/api/constants/repeat-mode.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 4 3 | --- 4 | 5 | # Repeat Mode 6 | 7 | All RepeatMode types are made available through the named export `RepeatMode`: 8 | 9 | ```ts 10 | import { RepeatMode } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Off` | Doesn't repeat. | 16 | | `Track` | Loops the current track. | 17 | | `Queue` | Repeats the whole queue. | 18 | -------------------------------------------------------------------------------- /docs/docs/api/constants/state.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # State 6 | 7 | All State types are made available through the named export `State`: 8 | 9 | ```ts 10 | import { State } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `None` | State indicating that no media is currently loaded | 16 | | `Ready` | State indicating that the player is ready to start playing | 17 | | `Playing` | State indicating that the player is currently playing | 18 | | `Paused` | State indicating that the player is currently paused | 19 | | `Stopped` | State indicating that the player is currently stopped | 20 | | `Buffering` | State indicating that the player is currently buffering (in "play" state) | 21 | | `Connecting` | State indicating that the player is currently buffering (in "pause" state) | 22 | -------------------------------------------------------------------------------- /docs/docs/api/functions/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Functions", 3 | "position": 1 4 | } 5 | -------------------------------------------------------------------------------- /docs/docs/api/objects/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Objects", 3 | "position": 5 4 | } 5 | -------------------------------------------------------------------------------- /docs/docs/api/objects/android-options.md: -------------------------------------------------------------------------------- 1 | # AndroidOptions 2 | 3 | Options available for the android player. All options are optional. 4 | 5 | | Param | Type | Default | Description | 6 | |-------|-------|---------|-------------| 7 | | `appKilledPlaybackBehavior` | [`AppKilledPlaybackBehavior`](../constants/app-killed-playback-behavior.md) | [`ContinuePlayback`](../constants/app-killed-playback-behavior#continueplayback-default.md) | Define how the audio playback should behave after removing the app from recents (killing it). | 8 | -------------------------------------------------------------------------------- /docs/docs/api/objects/feedback.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Feedback 6 | 7 | Controls the rendering of the control center item. 8 | 9 | | Param | Type | Description | 10 | | -------------- | --------------------------- | ------------ | 11 | | isActive | `boolean` | Marks wether the option should be marked as active or "done" | 12 | | title | `boolean` | The title to give the action (relevant for iOS) | 13 | -------------------------------------------------------------------------------- /docs/docs/api/objects/resource.md: -------------------------------------------------------------------------------- 1 | # Resource 2 | 3 | Resource objects are the result of `require`/`import` for files. 4 | 5 | For more information about Resource Objects, read the [Images](https://reactnative.dev/docs/images) section of the React Native documentation 6 | -------------------------------------------------------------------------------- /docs/docs/basics/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "The Basics", 3 | "position": 2 4 | } 5 | -------------------------------------------------------------------------------- /docs/docs/core-team.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 12 3 | --- 4 | 5 | # Core Team ✨ 6 | 7 | 8 | 9 | 16 | 23 | 30 | 31 |
10 | 11 | 12 |
David Chavez 13 |
14 |
15 |
17 | 18 | 19 |
Milen Pivchev 20 |
21 |
22 |
24 | 25 | 26 |
Jacob Spizziri 27 |
28 |
29 |
32 | 33 | ## Special Thanks ✨ 34 | 35 | 36 | 43 | 50 | 51 |
37 | 38 | 39 |
Guilherme Chaguri 40 |
41 |
42 |
44 | 45 | 46 |
Dustin Bahr 47 |
48 |
49 |
52 | -------------------------------------------------------------------------------- /docs/docs/guides/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Guides", 3 | "position": 4 4 | } 5 | -------------------------------------------------------------------------------- /docs/docs/guides/offline-playback.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # Offline Playback 6 | 7 | There are two general use-cases for offline playback: 8 | 9 | 1. An "Offline Only" case where all the audio is bundled with your App itself. 10 | 2. A "Hybrid Offline/Network" case where some of the time you're playing from a 11 | network and sometime you're playing offline. 12 | 13 | Both of these can be achieved by with this project. The only practical 14 | difference between the two is in the 2nd you'll need another package to 15 | download your audio while your App is running instead of loading into the App's 16 | source at build time. 17 | 18 | After that, you simply send a `Track` object to the player with a **local file 19 | path** to your audio. 20 | 21 | ## Offline Only 22 | 23 | This case is simple, just stick your audio files in your repository with your 24 | source code and use the file paths to them when adding Tracks. 25 | 26 | :warning: Please take into consideration that this approach will increase 27 | the size of your App based on how much audio you want the user to be able to 28 | play. If you're doing anything substantial, it's recommended that you use 29 | the [Hybrid Offline/Network](#hybrid-offline-network) approach. 30 | 31 | ## Hybrid Offline/Network 32 | 33 | To do this you'll first need to install a package like: 34 | 35 | - [react-native-fs](https://github.com/itinance/react-native-fs/) 36 | - [rn-fetch-blob](https://github.com/joltup/rn-fetch-blob) 37 | - [expo-file-system](https://www.npmjs.com/package/expo-file-system) 38 | 39 | The typical approach is to then create a download button in your app, which, 40 | once clicked, uses one of the above packages to download your audio to a local 41 | file. Then voila! Simply play the local file after download. 42 | -------------------------------------------------------------------------------- /docs/docs/guides/saving-progress.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Saving Progress 6 | 7 | A common use-case is to store the users progress on a particular `Track` 8 | somewhere so that when they leave and come back, they can pick up right where 9 | they left off. To do this you need to listen for progress updates and then 10 | store the progress somewhere. There are two high level ways of getting this 11 | done. 12 | 13 | ## Naive Approach 14 | 15 | One approach could be to use the progress events/updates that the `useProgress` 16 | hook provides. This isn't a very good idea and here's why: 17 | 18 | Users can listen to audio both "in-App" and "Remotely". In-App would be defined 19 | as playback while the user has the app opened on screen. However, whenever 20 | audio is being played in the background/remotely. For example: playback on the 21 | lockscreen, carplay, etc. In these situations **the UI is not mounted**, meaning 22 | the `useProgress` hook, or really any event listeners that are registered 23 | inside of your App UI tree (anything called as a result of 24 | `AppRegistry.registerComponent(appName, () => App);` in your `index.js` file) 25 | **WILL NOT EXECUTE**. 26 | 27 | In a nutshell, if you do this, you're progress **will not** update when the user 28 | is playing back in Remote contexts and therefore your app will seem buggy. 29 | 30 | ## Recommended Approach 31 | 32 | The correct way to handle this is to track progress in the 33 | [Playback Service](../basics/playback-service.md), based on the 34 | `Event.PlaybackProgressUpdated` event. These events fire all the time, including 35 | when your app is playing back remotely. 36 | -------------------------------------------------------------------------------- /docs/docs/guides/sleeptimers.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | --- 4 | 5 | # Sleeptimers 6 | 7 | This guide has very similar principles and implementation to 8 | [Saving Progress](./saving-progress.md). First please read through that guide 9 | to understand the concept of "remote" playback and why coupling playback events 10 | to the UI is a bad idea. 11 | 12 | Once you've understood that concept, this concept is nearly identical. You would 13 | leverage the same `Event.PlaybackProgressUpdated` event in this scenario too. 14 | 15 | Here's how you would use an event to implement a sleep timer: 16 | 17 | 1. The user configures a sleep timer in the UI. 18 | 2. Persist the time they configure in a store as a timestamp. 19 | 3. Each time the progress event fires you check your persisted sleep timer timestamp. 20 | - IF `sleeptime !== null && sleeptime <= now` THEN pause. 21 | -------------------------------------------------------------------------------- /docs/docs/sponsors.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 11 3 | --- 4 | 5 | # Sponsors ❤️ 6 | 7 | Thanks to our backers and sponsors for their generous support! 8 | 9 | ## Backers 10 | 11 | Support us with a monthly donation and help us continue our activities. [[Become a backer](https://github.com/sponsors/doublesymmetry)] 12 | 13 | 14 | 15 | 16 | 17 | ## Sponsors 18 | 19 | Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://github.com/sponsors/doublesymmetry)] 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/docs/v3.1.0-migration.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 7 3 | --- 4 | 5 | # Migrating from v3.1.0 to v3.2.0 6 | 7 | ### `stoppingAppPausesPlayback` is deprecated 8 | 9 | ```diff 10 | await TrackPlayer.updateOptions({ 11 | + android: { 12 | + appKilledPlaybackBehavior: AppKilledPlaybackBehavior.ContinuePlayback 13 | + }, 14 | // This flag is now deprecated. Please use the above to define playback mode. 15 | - stoppingAppPausesPlayback: true, 16 | } 17 | ``` -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docs", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "docusaurus": "docusaurus", 7 | "start": "docusaurus start", 8 | "build": "docusaurus build", 9 | "swizzle": "docusaurus swizzle", 10 | "deploy": "docusaurus deploy", 11 | "clear": "docusaurus clear", 12 | "serve": "docusaurus serve", 13 | "write-translations": "docusaurus write-translations", 14 | "write-heading-ids": "docusaurus write-heading-ids", 15 | "typecheck": "tsc" 16 | }, 17 | "dependencies": { 18 | "@docusaurus/core": "2.0.0-beta.18", 19 | "@docusaurus/preset-classic": "2.0.0-beta.18", 20 | "@mdx-js/react": "^1.6.22", 21 | "clsx": "^1.1.1", 22 | "prism-react-renderer": "^1.3.1", 23 | "react": "^17.0.2", 24 | "react-dom": "^17.0.2" 25 | }, 26 | "devDependencies": { 27 | "@docusaurus/module-type-aliases": "2.0.0-beta.18", 28 | "@tsconfig/docusaurus": "^1.0.5", 29 | "typescript": "^4.6.3" 30 | }, 31 | "browserslist": { 32 | "production": [ 33 | ">0.5%", 34 | "not dead", 35 | "not op_mini all" 36 | ], 37 | "development": [ 38 | "last 1 chrome version", 39 | "last 1 firefox version", 40 | "last 1 safari version" 41 | ] 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /docs/sidebars.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creating a sidebar enables you to: 3 | - create an ordered group of docs 4 | - render a sidebar for each doc of that group 5 | - provide next/previous navigation 6 | 7 | The sidebars can be generated from the filesystem, or explicitly defined here. 8 | 9 | Create as many sidebars as you want. 10 | */ 11 | 12 | // @ts-check 13 | 14 | /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ 15 | const sidebars = { 16 | // By default, Docusaurus generates a sidebar from the docs folder structure 17 | app: [{type: 'autogenerated', dirName: '.'}], 18 | 19 | // But you can create a sidebar manually 20 | /* 21 | tutorialSidebar: [ 22 | { 23 | type: 'category', 24 | label: 'Tutorial', 25 | items: ['hello'], 26 | }, 27 | ], 28 | */ 29 | }; 30 | 31 | module.exports = sidebars; 32 | -------------------------------------------------------------------------------- /docs/src/components/HomepageFeatures/styles.module.css: -------------------------------------------------------------------------------- 1 | .features { 2 | display: flex; 3 | align-items: center; 4 | padding: 2rem 0; 5 | width: 100%; 6 | } 7 | 8 | .featureSvg { 9 | height: 200px; 10 | width: 200px; 11 | } 12 | -------------------------------------------------------------------------------- /docs/src/pages/index.module.css: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS files with the .module.css suffix will be treated as CSS modules 3 | * and scoped locally. 4 | */ 5 | 6 | .heroBanner { 7 | padding: 4rem 0; 8 | text-align: center; 9 | position: relative; 10 | overflow: hidden; 11 | } 12 | 13 | @media screen and (max-width: 996px) { 14 | .heroBanner { 15 | padding: 2rem; 16 | } 17 | } 18 | 19 | .buttons { 20 | display: flex; 21 | align-items: center; 22 | justify-content: center; 23 | } 24 | -------------------------------------------------------------------------------- /docs/static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/.nojekyll -------------------------------------------------------------------------------- /docs/static/CNAME: -------------------------------------------------------------------------------- 1 | react-native-track-player.js.org 2 | -------------------------------------------------------------------------------- /docs/static/example/Longing.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/Longing.jpeg -------------------------------------------------------------------------------- /docs/static/example/Longing.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/Longing.mp3 -------------------------------------------------------------------------------- /docs/static/example/Lullaby (Demo).jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/Lullaby (Demo).jpeg -------------------------------------------------------------------------------- /docs/static/example/Lullaby (Demo).mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/Lullaby (Demo).mp3 -------------------------------------------------------------------------------- /docs/static/example/Rhythm City (Demo).jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/Rhythm City (Demo).jpeg -------------------------------------------------------------------------------- /docs/static/example/Rhythm City (Demo).mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/Rhythm City (Demo).mp3 -------------------------------------------------------------------------------- /docs/static/example/Soul Searching.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/Soul Searching.jpeg -------------------------------------------------------------------------------- /docs/static/example/Soul Searching.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/Soul Searching.mp3 -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file0.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file0.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file1.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file1.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file10.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file10.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file11.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file11.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file12.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file12.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file13.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file13.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file14.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file14.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file15.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file15.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file16.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file16.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file17.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file17.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file18.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file18.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file19.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file19.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file2.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file2.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file20.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file20.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file21.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file21.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file22.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file22.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file23.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file23.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file3.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file3.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file4.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file4.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file5.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file5.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file6.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file6.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file7.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file7.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file8.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file8.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/file9.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/file9.m4a -------------------------------------------------------------------------------- /docs/static/example/hls/whip/playlist.m3u8: -------------------------------------------------------------------------------- 1 | #EXTM3U 2 | #EXT-X-VERSION:3 3 | #EXT-X-MEDIA-SEQUENCE:0 4 | #EXT-X-ALLOW-CACHE:YES 5 | #EXT-X-TARGETDURATION:8 6 | #EXTINF:7.012433, 7 | file0.m4a 8 | #EXTINF:6.989200, 9 | file1.m4a 10 | #EXTINF:7.012433, 11 | file2.m4a 12 | #EXTINF:6.989200, 13 | file3.m4a 14 | #EXTINF:7.012433, 15 | file4.m4a 16 | #EXTINF:6.989211, 17 | file5.m4a 18 | #EXTINF:7.012433, 19 | file6.m4a 20 | #EXTINF:6.989211, 21 | file7.m4a 22 | #EXTINF:7.012433, 23 | file8.m4a 24 | #EXTINF:6.989211, 25 | file9.m4a 26 | #EXTINF:7.012422, 27 | file10.m4a 28 | #EXTINF:6.989211, 29 | file11.m4a 30 | #EXTINF:7.012422, 31 | file12.m4a 32 | #EXTINF:6.989211, 33 | file13.m4a 34 | #EXTINF:6.989211, 35 | file14.m4a 36 | #EXTINF:7.012433, 37 | file15.m4a 38 | #EXTINF:6.989200, 39 | file16.m4a 40 | #EXTINF:7.012433, 41 | file17.m4a 42 | #EXTINF:6.989200, 43 | file18.m4a 44 | #EXTINF:7.012433, 45 | file19.m4a 46 | #EXTINF:6.989200, 47 | file20.m4a 48 | #EXTINF:7.012433, 49 | file21.m4a 50 | #EXTINF:6.989200, 51 | file22.m4a 52 | #EXTINF:3.300133, 53 | file23.m4a 54 | #EXT-X-ENDLIST 55 | -------------------------------------------------------------------------------- /docs/static/example/hls/whip/whip.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/whip.jpeg -------------------------------------------------------------------------------- /docs/static/example/hls/whip/whip.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/hls/whip/whip.mp3 -------------------------------------------------------------------------------- /docs/static/example/smooth-jazz-24-7.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/example/smooth-jazz-24-7.jpeg -------------------------------------------------------------------------------- /docs/static/img/debugging/debug-ios-rntp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/img/debugging/debug-ios-rntp.png -------------------------------------------------------------------------------- /docs/static/img/debugging/debug-ios-swift-audio-ex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/img/debugging/debug-ios-swift-audio-ex.png -------------------------------------------------------------------------------- /docs/static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/docs/static/img/logo.png -------------------------------------------------------------------------------- /docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // This file is not used in compilation. It is here just for a nice editor experience. 3 | "extends": "@tsconfig/docusaurus/tsconfig.json", 4 | "compilerOptions": { 5 | "baseUrl": "." 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/api/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "API Reference", 3 | "position": 3 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/api/constants/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Constants", 3 | "position": 4 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/api/constants/capability.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Capability 6 | 7 | All Capability types are made available through the named export `Capability`: 8 | 9 | ```ts 10 | import { Capability } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Play` | Capability indicating the ability to play | 16 | | `PlayFromId` | Capability indicating the ability to play from a track id (Required for Android Auto) | 17 | | `PlayFromSearch` | Capability indicating the ability to play from a text/voice search (Required for Android Auto) | 18 | | `Pause` | Capability indicating the ability to pause | 19 | | `Stop` | Capability indicating the ability to stop | 20 | | `SeekTo` | Capability indicating the ability to seek to a position in the timeline | 21 | | `Skip` | Capability indicating the ability to skip to any song in the queue | 22 | | `SkipToNext` | Capability indicating the ability to skip to the next track | 23 | | `SkipToPrevious` | Capability indicating the ability to skip to the previous track | 24 | | `SetRating` | Capability indicating the ability to set the rating value based on the rating type | 25 | | `JumpForward` | Capability indicating the ability to jump forward by the amount of seconds specified in the options | 26 | | `JumpBackward` | Capability indicating the ability to jump backward by the amount of seconds specified in the options | 27 | | `Like` | (ios-only) Capability indicating the ability to like from control center | 28 | | `Dislike` | (ios-only) Capability indicating the ability to dislike from control center | 29 | | `Bookmark` | (ios-only) Capability indicating the ability to bookmark from control center | 30 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/api/constants/pitch-algorithm.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 5 3 | --- 4 | 5 | # Pitch Algorithm (ios-only) 6 | 7 | All PitchAlgorithm types are made available through the named export `PitchAlgorithm`: 8 | 9 | ```ts 10 | import { PitchAlgorithm } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Linear` | An algorithm suitable for general use. | 16 | | `Music` | An algorithm suitable for music. | 17 | | `Voice` | An algorithm suitable for voice. | 18 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/api/constants/rating.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | --- 4 | 5 | # Rating 6 | 7 | All RatingType types are made available through the named export `RatingType`: 8 | 9 | ```ts 10 | import { RatingType } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Heart` | Rating type indicating "with heart" or "without heart", its value is a `boolean`. | 16 | | `ThumbsUpDown` | Rating type indicating "thumbs up" or "thumbs down", its value is a `boolean`. | 17 | | `ThreeStars` | Rating type indicating 0 to 3 stars, its value is a `number` of stars. | 18 | | `FourStars` | Rating type indicating 0 to 4 stars, its value is a `number` of stars. | 19 | | `FiveStars` | Rating type indicating 0 to 5 stars, its value is a `number` of stars. | 20 | | `Percentage` | Rating type indicating percentage, its value is a `number`. | 21 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/api/constants/repeat-mode.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 4 3 | --- 4 | 5 | # Repeat Mode 6 | 7 | All RepeatMode types are made available through the named export `RepeatMode`: 8 | 9 | ```ts 10 | import { RepeatMode } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Off` | Doesn't repeat. | 16 | | `Track` | Loops the current track. | 17 | | `Queue` | Repeats the whole queue. | 18 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/api/constants/state.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # State 6 | 7 | All State types are made available through the named export `State`: 8 | 9 | ```ts 10 | import { State } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `None` | State indicating that no media is currently loaded | 16 | | `Ready` | State indicating that the player is ready to start playing | 17 | | `Playing` | State indicating that the player is currently playing | 18 | | `Paused` | State indicating that the player is currently paused | 19 | | `Stopped` | State indicating that the player is currently stopped | 20 | | `Buffering` | State indicating that the player is currently buffering (in "play" state) | 21 | | `Connecting` | State indicating that the player is currently buffering (in "pause" state) | 22 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/api/functions/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Functions", 3 | "position": 1 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/api/objects/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Objects", 3 | "position": 5 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/api/objects/feedback.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Feedback 6 | 7 | Controls the rendering of the control center item. 8 | 9 | | Param | Type | Description | 10 | | -------------- | --------------------------- | ------------ | 11 | | isActive | `boolean` | Marks wether the option should be marked as active or "done" | 12 | | title | `boolean` | The title to give the action (relevant for iOS) | 13 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/api/objects/resource.md: -------------------------------------------------------------------------------- 1 | # Resource 2 | 3 | Resource objects are the result of `require`/`import` for files. 4 | 5 | For more information about Resource Objects, read the [Images](https://reactnative.dev/docs/images) section of the React Native documentation 6 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/basics/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "The Basics", 3 | "position": 2 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/basics/build-preferences.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 6 3 | --- 4 | 5 | # Build Preferences 6 | 7 | You can optionally configure a few options for how the Track Player module is built in your app. Add a JSON file named `track-player.json` to the root folder of your app (the same folder where `index.android.js` and `node_modules` are stored) and set one or more of the following properties: 8 | 9 | ```json 10 | { 11 | "dash": false, 12 | "hls": false, 13 | "smoothstreaming": false 14 | } 15 | ``` 16 | 17 | ## `dash` (Android) 18 | 19 | Whether it will add support for [DASH](https://en.wikipedia.org/wiki/Dynamic_Adaptive_Streaming_over_HTTP) streams. This option adds an extension for handling DASH streams, which changes the app size. Defaults to `false`. 20 | 21 | ## `hls` (Android) 22 | 23 | Whether it will add support for [Smooth Streaming](https://en.wikipedia.org/wiki/Adaptive_bitrate_streaming#Microsoft_Smooth_Streaming) streams. This option adds an extension for handling SmoothStreaming streams, which changes the app size. Defaults to `false`. 24 | 25 | ## `smoothstreaming` (Android) 26 | 27 | Whether it will add support for SmoothStreaming streams. This option adds an extension for handling SmoothStreaming streams, which changes the app size. 28 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/basics/playback-service.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | --- 4 | 5 | # Playback Service 6 | 7 | The playback service keeps running even when the app is in the background. It will start when the player is set up and will only stop when the player is destroyed. It is a good idea to put any code in there that needs to be directly tied to the player state. For example, if you want to be able to track what is being played for analytics purposes, the playback service would be the place to do so. 8 | 9 | ## Remote Events 10 | 11 | [Remote events](../api/events.md#media-controls) are sent from places outside of our user interface that we can react to. For example if the user presses the pause media control in the IOS lockscreen / Android notification or from their Bluetooth headset, we want to have TrackPlayer pause the audio. 12 | 13 | If you create a listener to a remote event like `remote-pause` in the context of a React component, there is a chance the UI will be unmounted automatically when the app is in the background, causing it to be missed. For this reason it is best to place remote listeners in the playback service, since it will keep running even when the app is in the background. 14 | 15 | ## Example 16 | ```typescript 17 | // This needs to go right after you register the main component of your app 18 | // AppRegistry.registerComponent(...) 19 | TrackPlayer.registerPlaybackService(() => require('./service')); 20 | ``` 21 | 22 | ```javascript 23 | // service.js 24 | module.exports = async function() { 25 | 26 | TrackPlayer.addEventListener('remote-play', () => TrackPlayer.play()); 27 | 28 | TrackPlayer.addEventListener('remote-pause', () => TrackPlayer.pause()); 29 | 30 | TrackPlayer.addEventListener('remote-stop', () => TrackPlayer.destroy()); 31 | 32 | // ... 33 | 34 | }; 35 | ``` 36 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/core-team.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 8 3 | --- 4 | 5 | # Core Team ✨ 6 | 7 | 8 | 9 | 16 | 23 | 30 | 31 |
10 | 11 | 12 |
David Chavez 13 |
14 |
15 |
17 | 18 | 19 |
Milen Pivchev 20 |
21 |
22 |
24 | 25 | 26 |
Jacob Spizziri 27 |
28 |
29 |
32 | 33 | ## Special Thanks ✨ 34 | 35 | 36 | 43 | 50 | 51 |
37 | 38 | 39 |
Guilherme Chaguri 40 |
41 |
42 |
44 | 45 | 46 |
Dustin Bahr 47 |
48 |
49 |
52 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/guides/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Guides", 3 | "position": 4 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/guides/offline-playback.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # Offline Playback 6 | 7 | There are two general use-cases for offline playback: 8 | 9 | 1. An "Offline Only" case where all the audio is bundled with your App itself. 10 | 2. A "Hybrid Offline/Network" case where some of the time you're playing from a 11 | network and sometime you're playing offline. 12 | 13 | Both of these can be achieved by with this project. The only practical 14 | difference between the two is in the 2nd you'll need another package to 15 | download your audio while your App is running instead of loading into the App's 16 | source at build time. 17 | 18 | After that, you simply send a `Track` object to the player with a **local file 19 | path** to your audio. 20 | 21 | ## Offline Only 22 | 23 | This case is simple, just stick your audio files in your repository with your 24 | source code and use the file paths to them when adding Tracks. 25 | 26 | :warning: Please take into consideration that this approach will increase 27 | the size of your App based on how much audio you want the user to be able to 28 | play. If you're doing anything substantial, it's recommended that you use 29 | the [Hybrid Offline/Network](#hybrid-offline-network) approach. 30 | 31 | ## Hybrid Offline/Network 32 | 33 | To do this you'll first need to install a package like: 34 | 35 | - [react-native-fs](https://github.com/itinance/react-native-fs/) 36 | - [rn-fetch-blob](https://github.com/joltup/rn-fetch-blob) 37 | - [expo-file-system](https://www.npmjs.com/package/expo-file-system) 38 | 39 | The typical approach is to then create a download button in your app, which, 40 | once clicked, uses one of the above packages to download your audio to a local 41 | file. Then voila! Simply play the local file after download. 42 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-2.1/sponsors.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 7 3 | --- 4 | 5 | # Sponsors ❤️ 6 | 7 | Thanks to our backers and sponsors for their generous support! 8 | 9 | ## Backers 10 | 11 | Support us with a monthly donation and help us continue our activities. [[Become a backer](https://github.com/sponsors/doublesymmetry)] 12 | 13 | 14 | 15 | 16 | 17 | ## Sponsors 18 | 19 | Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://github.com/sponsors/doublesymmetry)] 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/api/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "API Reference", 3 | "position": 3 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/api/constants/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Constants", 3 | "position": 4 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/api/constants/capability.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Capability 6 | 7 | All Capability types are made available through the named export `Capability`: 8 | 9 | ```ts 10 | import { Capability } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Play` | Capability indicating the ability to play | 16 | | `PlayFromId` | Capability indicating the ability to play from a track id (Required for Android Auto) | 17 | | `PlayFromSearch` | Capability indicating the ability to play from a text/voice search (Required for Android Auto) | 18 | | `Pause` | Capability indicating the ability to pause | 19 | | `Stop` | Capability indicating the ability to stop | 20 | | `SeekTo` | Capability indicating the ability to seek to a position in the timeline | 21 | | `Skip` | Capability indicating the ability to skip to any song in the queue | 22 | | `SkipToNext` | Capability indicating the ability to skip to the next track | 23 | | `SkipToPrevious` | Capability indicating the ability to skip to the previous track | 24 | | `SetRating` | Capability indicating the ability to set the rating value based on the rating type | 25 | | `JumpForward` | Capability indicating the ability to jump forward by the amount of seconds specified in the options | 26 | | `JumpBackward` | Capability indicating the ability to jump backward by the amount of seconds specified in the options | 27 | | `Like` | (ios-only) Capability indicating the ability to like from control center | 28 | | `Dislike` | (ios-only) Capability indicating the ability to dislike from control center | 29 | | `Bookmark` | (ios-only) Capability indicating the ability to bookmark from control center | 30 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/api/constants/pitch-algorithm.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 5 3 | --- 4 | 5 | # Pitch Algorithm (ios-only) 6 | 7 | All PitchAlgorithm types are made available through the named export `PitchAlgorithm`: 8 | 9 | ```ts 10 | import { PitchAlgorithm } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Linear` | An algorithm suitable for general use. | 16 | | `Music` | An algorithm suitable for music. | 17 | | `Voice` | An algorithm suitable for voice. | 18 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/api/constants/rating.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | --- 4 | 5 | # Rating 6 | 7 | All RatingType types are made available through the named export `RatingType`: 8 | 9 | ```ts 10 | import { RatingType } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Heart` | Rating type indicating "with heart" or "without heart", its value is a `boolean`. | 16 | | `ThumbsUpDown` | Rating type indicating "thumbs up" or "thumbs down", its value is a `boolean`. | 17 | | `ThreeStars` | Rating type indicating 0 to 3 stars, its value is a `number` of stars. | 18 | | `FourStars` | Rating type indicating 0 to 4 stars, its value is a `number` of stars. | 19 | | `FiveStars` | Rating type indicating 0 to 5 stars, its value is a `number` of stars. | 20 | | `Percentage` | Rating type indicating percentage, its value is a `number`. | 21 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/api/constants/repeat-mode.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 4 3 | --- 4 | 5 | # Repeat Mode 6 | 7 | All RepeatMode types are made available through the named export `RepeatMode`: 8 | 9 | ```ts 10 | import { RepeatMode } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Off` | Doesn't repeat. | 16 | | `Track` | Loops the current track. | 17 | | `Queue` | Repeats the whole queue. | 18 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/api/constants/state.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # State 6 | 7 | All State types are made available through the named export `State`: 8 | 9 | ```ts 10 | import { State } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `None` | State indicating that no media is currently loaded | 16 | | `Ready` | State indicating that the player is ready to start playing | 17 | | `Playing` | State indicating that the player is currently playing | 18 | | `Paused` | State indicating that the player is currently paused | 19 | | `Stopped` | State indicating that the player is currently stopped | 20 | | `Buffering` | State indicating that the player is currently buffering (in "play" state) | 21 | | `Connecting` | State indicating that the player is currently buffering (in "pause" state) | 22 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/api/functions/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Functions", 3 | "position": 1 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/api/objects/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Objects", 3 | "position": 5 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/api/objects/feedback.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Feedback 6 | 7 | Controls the rendering of the control center item. 8 | 9 | | Param | Type | Description | 10 | | -------------- | --------------------------- | ------------ | 11 | | isActive | `boolean` | Marks wether the option should be marked as active or "done" | 12 | | title | `boolean` | The title to give the action (relevant for iOS) | 13 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/api/objects/resource.md: -------------------------------------------------------------------------------- 1 | # Resource 2 | 3 | Resource objects are the result of `require`/`import` for files. 4 | 5 | For more information about Resource Objects, read the [Images](https://reactnative.dev/docs/images) section of the React Native documentation 6 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/basics/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "The Basics", 3 | "position": 2 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/core-team.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 12 3 | --- 4 | 5 | # Core Team ✨ 6 | 7 | 8 | 9 | 16 | 23 | 30 | 31 |
10 | 11 | 12 |
David Chavez 13 |
14 |
15 |
17 | 18 | 19 |
Milen Pivchev 20 |
21 |
22 |
24 | 25 | 26 |
Jacob Spizziri 27 |
28 |
29 |
32 | 33 | ## Special Thanks ✨ 34 | 35 | 36 | 43 | 50 | 51 |
37 | 38 | 39 |
Guilherme Chaguri 40 |
41 |
42 |
44 | 45 | 46 |
Dustin Bahr 47 |
48 |
49 |
52 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/guides/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Guides", 3 | "position": 4 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/guides/offline-playback.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # Offline Playback 6 | 7 | There are two general use-cases for offline playback: 8 | 9 | 1. An "Offline Only" case where all the audio is bundled with your App itself. 10 | 2. A "Hybrid Offline/Network" case where some of the time you're playing from a 11 | network and sometime you're playing offline. 12 | 13 | Both of these can be achieved by with this project. The only practical 14 | difference between the two is in the 2nd you'll need another package to 15 | download your audio while your App is running instead of loading into the App's 16 | source at build time. 17 | 18 | After that, you simply send a `Track` object to the player with a **local file 19 | path** to your audio. 20 | 21 | ## Offline Only 22 | 23 | This case is simple, just stick your audio files in your repository with your 24 | source code and use the file paths to them when adding Tracks. 25 | 26 | :warning: Please take into consideration that this approach will increase 27 | the size of your App based on how much audio you want the user to be able to 28 | play. If you're doing anything substantial, it's recommended that you use 29 | the [Hybrid Offline/Network](#hybrid-offline-network) approach. 30 | 31 | ## Hybrid Offline/Network 32 | 33 | To do this you'll first need to install a package like: 34 | 35 | - [react-native-fs](https://github.com/itinance/react-native-fs/) 36 | - [rn-fetch-blob](https://github.com/joltup/rn-fetch-blob) 37 | - [expo-file-system](https://www.npmjs.com/package/expo-file-system) 38 | 39 | The typical approach is to then create a download button in your app, which, 40 | once clicked, uses one of the above packages to download your audio to a local 41 | file. Then voila! Simply play the local file after download. 42 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/guides/saving-progress.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Saving Progress 6 | 7 | A common use-case is to store the users progress on a particular `Track` 8 | somewhere so that when they leave and come back, they can pick up right where 9 | they left off. To do this you need to listen for progress updates and then 10 | store the progress somewhere. There are two high level ways of getting this 11 | done. 12 | 13 | ## Naive Approach 14 | 15 | One approach could be to use the progress events/updates that the `useProgress` 16 | hook provides. This isn't a very good idea and here's why: 17 | 18 | Users can listen to audio both "in-App" and "Remotely". In-App would be defined 19 | as playback while the user has the app opened on screen. However, whenever 20 | audio is being played in the background/remotely. For example: playback on the 21 | lockscreen, carplay, etc. In these situations **the UI is not mounted**, meaning 22 | the `useProgress` hook, or really any event listeners that are registered 23 | inside of your App UI tree (anything called as a result of 24 | `AppRegistry.registerComponent(appName, () => App);` in your `index.js` file) 25 | **WILL NOT EXECUTE**. 26 | 27 | In a nutshell, if you do this, you're progress **will not** update when the user 28 | is playing back in Remote contexts and therefore your app will seem buggy. 29 | 30 | ## Recommended Approach 31 | 32 | The correct way to handle this is to track progress in the 33 | [Playback Service](../basics/playback-service.md), based on the 34 | `Event.PlaybackProgressUpdated` event. These events fire all the time, including 35 | when your app is playing back remotely. 36 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/guides/sleeptimers.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | --- 4 | 5 | # Sleeptimers 6 | 7 | This guide has very similar principles and implementation to 8 | [Saving Progress](./saving-progress.md). First please read through that guide 9 | to understand the concept of "remote" playback and why coupling playback events 10 | to the UI is a bad idea. 11 | 12 | Once you've understood that concept, this concept is nearly identical. You would 13 | leverage the same `Event.PlaybackProgressUpdated` event in this scenario too. 14 | 15 | Here's how you would use an event to implement a sleep timer: 16 | 17 | 1. The user configures a sleep timer in the UI. 18 | 2. Persist the time they configure in a store as a timestamp. 19 | 3. Each time the progress event fires you check your persisted sleep timer timestamp. 20 | - IF `sleeptime !== null && sleeptime <= now` THEN pause. 21 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.1/sponsors.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 11 3 | --- 4 | 5 | # Sponsors ❤️ 6 | 7 | Thanks to our backers and sponsors for their generous support! 8 | 9 | ## Backers 10 | 11 | Support us with a monthly donation and help us continue our activities. [[Become a backer](https://github.com/sponsors/doublesymmetry)] 12 | 13 | 14 | 15 | 16 | 17 | ## Sponsors 18 | 19 | Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://github.com/sponsors/doublesymmetry)] 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/api/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "API Reference", 3 | "position": 3 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/api/constants/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Constants", 3 | "position": 4 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/api/constants/app-killed-playback-behavior.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 6 3 | --- 4 | 5 | # App Killed Playback Behavior (android-only) 6 | 7 | ```ts 8 | import { AppKilledPlaybackBehavior } from 'react-native-track-player'; 9 | ``` 10 | 11 | ## `ContinuePlayback` (default) 12 | 13 | This option will continue playing audio in the background when the app is 14 | removed from recents. The notification remains. This is the default. 15 | 16 | ## `PausePlayback` 17 | 18 | This option will pause playing audio in the background when the app is removed 19 | from recents. The notification remains and can be used to resume playback. 20 | 21 | ## `StopPlaybackAndRemoveNotification` 22 | 23 | This option will stop playing audio in the background when the app is removed 24 | from recents. The notification is removed and can't be used to resume playback. 25 | Users would need to open the app again to start playing audio. 26 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/api/constants/capability.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Capability 6 | 7 | All Capability types are made available through the named export `Capability`: 8 | 9 | ```ts 10 | import { Capability } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Play` | Capability indicating the ability to play | 16 | | `PlayFromId` | Capability indicating the ability to play from a track id (Required for Android Auto) | 17 | | `PlayFromSearch` | Capability indicating the ability to play from a text/voice search (Required for Android Auto) | 18 | | `Pause` | Capability indicating the ability to pause | 19 | | `Stop` | Capability indicating the ability to stop | 20 | | `SeekTo` | Capability indicating the ability to seek to a position in the timeline | 21 | | `Skip` | Capability indicating the ability to skip to any song in the queue | 22 | | `SkipToNext` | Capability indicating the ability to skip to the next track | 23 | | `SkipToPrevious` | Capability indicating the ability to skip to the previous track | 24 | | `SetRating` | Capability indicating the ability to set the rating value based on the rating type | 25 | | `JumpForward` | Capability indicating the ability to jump forward by the amount of seconds specified in the options | 26 | | `JumpBackward` | Capability indicating the ability to jump backward by the amount of seconds specified in the options | 27 | | `Like` | (ios-only) Capability indicating the ability to like from control center | 28 | | `Dislike` | (ios-only) Capability indicating the ability to dislike from control center | 29 | | `Bookmark` | (ios-only) Capability indicating the ability to bookmark from control center | 30 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/api/constants/pitch-algorithm.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 5 3 | --- 4 | 5 | # Pitch Algorithm (ios-only) 6 | 7 | All PitchAlgorithm types are made available through the named export `PitchAlgorithm`: 8 | 9 | ```ts 10 | import { PitchAlgorithm } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Linear` | An algorithm suitable for general use. | 16 | | `Music` | An algorithm suitable for music. | 17 | | `Voice` | An algorithm suitable for voice. | 18 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/api/constants/rating.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | --- 4 | 5 | # Rating 6 | 7 | All RatingType types are made available through the named export `RatingType`: 8 | 9 | ```ts 10 | import { RatingType } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Heart` | Rating type indicating "with heart" or "without heart", its value is a `boolean`. | 16 | | `ThumbsUpDown` | Rating type indicating "thumbs up" or "thumbs down", its value is a `boolean`. | 17 | | `ThreeStars` | Rating type indicating 0 to 3 stars, its value is a `number` of stars. | 18 | | `FourStars` | Rating type indicating 0 to 4 stars, its value is a `number` of stars. | 19 | | `FiveStars` | Rating type indicating 0 to 5 stars, its value is a `number` of stars. | 20 | | `Percentage` | Rating type indicating percentage, its value is a `number`. | 21 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/api/constants/repeat-mode.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 4 3 | --- 4 | 5 | # Repeat Mode 6 | 7 | All RepeatMode types are made available through the named export `RepeatMode`: 8 | 9 | ```ts 10 | import { RepeatMode } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `Off` | Doesn't repeat. | 16 | | `Track` | Loops the current track. | 17 | | `Queue` | Repeats the whole queue. | 18 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/api/constants/state.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # State 6 | 7 | All State types are made available through the named export `State`: 8 | 9 | ```ts 10 | import { State } from 'react-native-track-player'; 11 | ``` 12 | 13 | | Name | Description | 14 | |------|-------------| 15 | | `None` | State indicating that no media is currently loaded | 16 | | `Ready` | State indicating that the player is ready to start playing | 17 | | `Playing` | State indicating that the player is currently playing | 18 | | `Paused` | State indicating that the player is currently paused | 19 | | `Stopped` | State indicating that the player is currently stopped | 20 | | `Buffering` | State indicating that the player is currently buffering (in "play" state) | 21 | | `Connecting` | State indicating that the player is currently buffering (in "pause" state) | 22 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/api/functions/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Functions", 3 | "position": 1 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/api/objects/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Objects", 3 | "position": 5 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/api/objects/android-options.md: -------------------------------------------------------------------------------- 1 | # AndroidOptions 2 | 3 | Options available for the android player. All options are optional. 4 | 5 | | Param | Type | Default | Description | 6 | |-------|-------|---------|-------------| 7 | | `appKilledPlaybackBehavior` | [`AppKilledPlaybackBehavior`](../constants/app-killed-playback-behavior.md) | [`ContinuePlayback`](../constants/app-killed-playback-behavior#continueplayback-default.md) | Define how the audio playback should behave after removing the app from recents (killing it). | 8 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/api/objects/feedback.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Feedback 6 | 7 | Controls the rendering of the control center item. 8 | 9 | | Param | Type | Description | 10 | | -------------- | --------------------------- | ------------ | 11 | | isActive | `boolean` | Marks wether the option should be marked as active or "done" | 12 | | title | `boolean` | The title to give the action (relevant for iOS) | 13 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/api/objects/resource.md: -------------------------------------------------------------------------------- 1 | # Resource 2 | 3 | Resource objects are the result of `require`/`import` for files. 4 | 5 | For more information about Resource Objects, read the [Images](https://reactnative.dev/docs/images) section of the React Native documentation 6 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/basics/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "The Basics", 3 | "position": 2 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/core-team.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 12 3 | --- 4 | 5 | # Core Team ✨ 6 | 7 | 8 | 9 | 16 | 23 | 30 | 31 |
10 | 11 | 12 |
David Chavez 13 |
14 |
15 |
17 | 18 | 19 |
Milen Pivchev 20 |
21 |
22 |
24 | 25 | 26 |
Jacob Spizziri 27 |
28 |
29 |
32 | 33 | ## Special Thanks ✨ 34 | 35 | 36 | 43 | 50 | 51 |
37 | 38 | 39 |
Guilherme Chaguri 40 |
41 |
42 |
44 | 45 | 46 |
Dustin Bahr 47 |
48 |
49 |
52 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/guides/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Guides", 3 | "position": 4 4 | } 5 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/guides/offline-playback.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # Offline Playback 6 | 7 | There are two general use-cases for offline playback: 8 | 9 | 1. An "Offline Only" case where all the audio is bundled with your App itself. 10 | 2. A "Hybrid Offline/Network" case where some of the time you're playing from a 11 | network and sometime you're playing offline. 12 | 13 | Both of these can be achieved by with this project. The only practical 14 | difference between the two is in the 2nd you'll need another package to 15 | download your audio while your App is running instead of loading into the App's 16 | source at build time. 17 | 18 | After that, you simply send a `Track` object to the player with a **local file 19 | path** to your audio. 20 | 21 | ## Offline Only 22 | 23 | This case is simple, just stick your audio files in your repository with your 24 | source code and use the file paths to them when adding Tracks. 25 | 26 | :warning: Please take into consideration that this approach will increase 27 | the size of your App based on how much audio you want the user to be able to 28 | play. If you're doing anything substantial, it's recommended that you use 29 | the [Hybrid Offline/Network](#hybrid-offline-network) approach. 30 | 31 | ## Hybrid Offline/Network 32 | 33 | To do this you'll first need to install a package like: 34 | 35 | - [react-native-fs](https://github.com/itinance/react-native-fs/) 36 | - [rn-fetch-blob](https://github.com/joltup/rn-fetch-blob) 37 | - [expo-file-system](https://www.npmjs.com/package/expo-file-system) 38 | 39 | The typical approach is to then create a download button in your app, which, 40 | once clicked, uses one of the above packages to download your audio to a local 41 | file. Then voila! Simply play the local file after download. 42 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/guides/saving-progress.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Saving Progress 6 | 7 | A common use-case is to store the users progress on a particular `Track` 8 | somewhere so that when they leave and come back, they can pick up right where 9 | they left off. To do this you need to listen for progress updates and then 10 | store the progress somewhere. There are two high level ways of getting this 11 | done. 12 | 13 | ## Naive Approach 14 | 15 | One approach could be to use the progress events/updates that the `useProgress` 16 | hook provides. This isn't a very good idea and here's why: 17 | 18 | Users can listen to audio both "in-App" and "Remotely". In-App would be defined 19 | as playback while the user has the app opened on screen. However, whenever 20 | audio is being played in the background/remotely. For example: playback on the 21 | lockscreen, carplay, etc. In these situations **the UI is not mounted**, meaning 22 | the `useProgress` hook, or really any event listeners that are registered 23 | inside of your App UI tree (anything called as a result of 24 | `AppRegistry.registerComponent(appName, () => App);` in your `index.js` file) 25 | **WILL NOT EXECUTE**. 26 | 27 | In a nutshell, if you do this, you're progress **will not** update when the user 28 | is playing back in Remote contexts and therefore your app will seem buggy. 29 | 30 | ## Recommended Approach 31 | 32 | The correct way to handle this is to track progress in the 33 | [Playback Service](../basics/playback-service.md), based on the 34 | `Event.PlaybackProgressUpdated` event. These events fire all the time, including 35 | when your app is playing back remotely. 36 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/guides/sleeptimers.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | --- 4 | 5 | # Sleeptimers 6 | 7 | This guide has very similar principles and implementation to 8 | [Saving Progress](./saving-progress.md). First please read through that guide 9 | to understand the concept of "remote" playback and why coupling playback events 10 | to the UI is a bad idea. 11 | 12 | Once you've understood that concept, this concept is nearly identical. You would 13 | leverage the same `Event.PlaybackProgressUpdated` event in this scenario too. 14 | 15 | Here's how you would use an event to implement a sleep timer: 16 | 17 | 1. The user configures a sleep timer in the UI. 18 | 2. Persist the time they configure in a store as a timestamp. 19 | 3. Each time the progress event fires you check your persisted sleep timer timestamp. 20 | - IF `sleeptime !== null && sleeptime <= now` THEN pause. 21 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/sponsors.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 11 3 | --- 4 | 5 | # Sponsors ❤️ 6 | 7 | Thanks to our backers and sponsors for their generous support! 8 | 9 | ## Backers 10 | 11 | Support us with a monthly donation and help us continue our activities. [[Become a backer](https://github.com/sponsors/doublesymmetry)] 12 | 13 | 14 | 15 | 16 | 17 | ## Sponsors 18 | 19 | Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://github.com/sponsors/doublesymmetry)] 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/versioned_docs/version-3.2/v3.1.0-migration.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 7 3 | --- 4 | 5 | # Migrating from v3.1.0 to v3.2.0 6 | 7 | ### `stoppingAppPausesPlayback` is deprecated 8 | 9 | ```diff 10 | await TrackPlayer.updateOptions({ 11 | + android: { 12 | + appKilledPlaybackBehavior: AppKilledPlaybackBehavior.ContinuePlayback 13 | + }, 14 | // This flag is now deprecated. Please use the above to define playback mode. 15 | - stoppingAppPausesPlayback: true, 16 | } 17 | ``` -------------------------------------------------------------------------------- /docs/versioned_sidebars/version-2.1-sidebars.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": [ 3 | { 4 | "type": "autogenerated", 5 | "dirName": "." 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /docs/versioned_sidebars/version-3.1-sidebars.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": [ 3 | { 4 | "type": "autogenerated", 5 | "dirName": "." 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /docs/versioned_sidebars/version-3.2-sidebars.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": [ 3 | { 4 | "type": "autogenerated", 5 | "dirName": "." 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /docs/versions.json: -------------------------------------------------------------------------------- 1 | [ 2 | "3.2", 3 | "3.1", 4 | "2.1" 5 | ] 6 | -------------------------------------------------------------------------------- /example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /example/.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /example/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: '@typescript-eslint/parser', // Specifies the ESLint parser 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin 7 | 'plugin:react-hooks/recommended', 8 | ], 9 | parserOptions: { 10 | ecmaVersion: 2017, // Allows for the parsing of modern ECMAScript features 11 | sourceType: 'module', // Allows for the use of imports 12 | }, 13 | rules: { 14 | // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | yarn-error.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | *.keystore 42 | !debug.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | 58 | # CocoaPods 59 | /ios/Pods/ 60 | 61 | # Gemfile 62 | ios/vendor/ 63 | vendor/ 64 | -------------------------------------------------------------------------------- /example/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | singleQuote: true, 3 | } 4 | -------------------------------------------------------------------------------- /example/.ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.4 2 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby '3.0.5' 5 | 6 | gem 'cocoapods', '~> 1.11', '>= 1.11.2' 7 | gem 'rexml' -------------------------------------------------------------------------------- /example/__tests__/App-test.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import React from 'react' 6 | import 'react-native' 7 | import App from '../src/App' 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer' 11 | 12 | it('renders correctly', () => { 13 | renderer.create() 14 | }) 15 | -------------------------------------------------------------------------------- /example/android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.example", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.example", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /example/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/debug.keystore -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.os.Bundle; 4 | 5 | import com.facebook.react.ReactActivity; 6 | import com.facebook.react.ReactActivityDelegate; 7 | import com.facebook.react.ReactRootView; 8 | 9 | public class MainActivity extends ReactActivity { 10 | 11 | /** 12 | * Returns the name of the main component registered from JavaScript. This is used to schedule 13 | * rendering of the component. 14 | */ 15 | @Override 16 | protected String getMainComponentName() { 17 | return "example"; 18 | } 19 | 20 | /** 21 | * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and 22 | * you can specify the rendered you wish to use (Fabric or the older renderer). 23 | */ 24 | @Override 25 | protected ReactActivityDelegate createReactActivityDelegate() { 26 | return new MainActivityDelegate(this, getMainComponentName()); 27 | } 28 | 29 | public static class MainActivityDelegate extends ReactActivityDelegate { 30 | public MainActivityDelegate(ReactActivity activity, String mainComponentName) { 31 | super(activity, mainComponentName); 32 | } 33 | 34 | @Override 35 | protected ReactRootView createRootView() { 36 | ReactRootView reactRootView = new ReactRootView(getContext()); 37 | // If you opted-in for the New Architecture, we enable the Fabric Renderer. 38 | reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); 39 | return reactRootView; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/newarchitecture/components/MainComponentsRegistry.java: -------------------------------------------------------------------------------- 1 | package com.example.newarchitecture.components; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.proguard.annotations.DoNotStrip; 5 | import com.facebook.react.fabric.ComponentFactory; 6 | import com.facebook.soloader.SoLoader; 7 | 8 | /** 9 | * Class responsible to load the custom Fabric Components. This class has native methods and needs a 10 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 11 | * folder for you). 12 | * 13 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 14 | * `newArchEnabled` property). Is ignored otherwise. 15 | */ 16 | @DoNotStrip 17 | public class MainComponentsRegistry { 18 | static { 19 | SoLoader.loadLibrary("fabricjni"); 20 | } 21 | 22 | @DoNotStrip private final HybridData mHybridData; 23 | 24 | @DoNotStrip 25 | private native HybridData initHybrid(ComponentFactory componentFactory); 26 | 27 | @DoNotStrip 28 | private MainComponentsRegistry(ComponentFactory componentFactory) { 29 | mHybridData = initHybrid(componentFactory); 30 | } 31 | 32 | @DoNotStrip 33 | public static MainComponentsRegistry register(ComponentFactory componentFactory) { 34 | return new MainComponentsRegistry(componentFactory); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/Android.mk: -------------------------------------------------------------------------------- 1 | THIS_DIR := $(call my-dir) 2 | 3 | include $(REACT_ANDROID_DIR)/Android-prebuilt.mk 4 | 5 | # If you wish to add a custom TurboModule or Fabric component in your app you 6 | # will have to include the following autogenerated makefile. 7 | # include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk 8 | include $(CLEAR_VARS) 9 | 10 | LOCAL_PATH := $(THIS_DIR) 11 | 12 | # You can customize the name of your application .so file here. 13 | LOCAL_MODULE := example_appmodules 14 | 15 | LOCAL_C_INCLUDES := $(LOCAL_PATH) 16 | LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) 17 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 18 | 19 | # If you wish to add a custom TurboModule or Fabric component in your app you 20 | # will have to uncomment those lines to include the generated source 21 | # files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni) 22 | # 23 | # LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni 24 | # LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp) 25 | # LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni 26 | 27 | # Here you should add any native library you wish to depend on. 28 | LOCAL_SHARED_LIBRARIES := \ 29 | libfabricjni \ 30 | libfbjni \ 31 | libfolly_futures \ 32 | libfolly_json \ 33 | libglog \ 34 | libjsi \ 35 | libreact_codegen_rncore \ 36 | libreact_debug \ 37 | libreact_nativemodule_core \ 38 | libreact_render_componentregistry \ 39 | libreact_render_core \ 40 | libreact_render_debug \ 41 | libreact_render_graphics \ 42 | librrc_view \ 43 | libruntimeexecutor \ 44 | libturbomodulejsijni \ 45 | libyoga 46 | 47 | LOCAL_CFLAGS := -DLOG_TAG=\"ReactNative\" -fexceptions -frtti -std=c++17 -Wall 48 | 49 | include $(BUILD_SHARED_LIBRARY) 50 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationModuleProvider.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationModuleProvider.h" 2 | 3 | #include 4 | 5 | namespace facebook { 6 | namespace react { 7 | 8 | std::shared_ptr MainApplicationModuleProvider( 9 | const std::string moduleName, 10 | const JavaTurboModule::InitParams ¶ms) { 11 | // Here you can provide your own module provider for TurboModules coming from 12 | // either your application or from external libraries. The approach to follow 13 | // is similar to the following (for a library called `samplelibrary`: 14 | // 15 | // auto module = samplelibrary_ModuleProvider(moduleName, params); 16 | // if (module != nullptr) { 17 | // return module; 18 | // } 19 | // return rncore_ModuleProvider(moduleName, params); 20 | return rncore_ModuleProvider(moduleName, params); 21 | } 22 | 23 | } // namespace react 24 | } // namespace facebook 25 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationModuleProvider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | std::shared_ptr MainApplicationModuleProvider( 12 | const std::string moduleName, 13 | const JavaTurboModule::InitParams ¶ms); 14 | 15 | } // namespace react 16 | } // namespace facebook 17 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationTurboModuleManagerDelegate.h" 2 | #include "MainApplicationModuleProvider.h" 3 | 4 | namespace facebook { 5 | namespace react { 6 | 7 | jni::local_ref 8 | MainApplicationTurboModuleManagerDelegate::initHybrid( 9 | jni::alias_ref) { 10 | return makeCxxInstance(); 11 | } 12 | 13 | void MainApplicationTurboModuleManagerDelegate::registerNatives() { 14 | registerHybrid({ 15 | makeNativeMethod( 16 | "initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid), 17 | makeNativeMethod( 18 | "canCreateTurboModule", 19 | MainApplicationTurboModuleManagerDelegate::canCreateTurboModule), 20 | }); 21 | } 22 | 23 | std::shared_ptr 24 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 25 | const std::string name, 26 | const std::shared_ptr jsInvoker) { 27 | // Not implemented yet: provide pure-C++ NativeModules here. 28 | return nullptr; 29 | } 30 | 31 | std::shared_ptr 32 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 33 | const std::string name, 34 | const JavaTurboModule::InitParams ¶ms) { 35 | return MainApplicationModuleProvider(name, params); 36 | } 37 | 38 | bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule( 39 | std::string name) { 40 | return getTurboModule(name, nullptr) != nullptr || 41 | getTurboModule(name, {.moduleName = name}) != nullptr; 42 | } 43 | 44 | } // namespace react 45 | } // namespace facebook 46 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | namespace facebook { 8 | namespace react { 9 | 10 | class MainApplicationTurboModuleManagerDelegate 11 | : public jni::HybridClass< 12 | MainApplicationTurboModuleManagerDelegate, 13 | TurboModuleManagerDelegate> { 14 | public: 15 | // Adapt it to the package you used for your Java class. 16 | static constexpr auto kJavaDescriptor = 17 | "Lcom/example/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;"; 18 | 19 | static jni::local_ref initHybrid(jni::alias_ref); 20 | 21 | static void registerNatives(); 22 | 23 | std::shared_ptr getTurboModule( 24 | const std::string name, 25 | const std::shared_ptr jsInvoker) override; 26 | std::shared_ptr getTurboModule( 27 | const std::string name, 28 | const JavaTurboModule::InitParams ¶ms) override; 29 | 30 | /** 31 | * Test-only method. Allows user to verify whether a TurboModule can be 32 | * created by instances of this class. 33 | */ 34 | bool canCreateTurboModule(std::string name); 35 | }; 36 | 37 | } // namespace react 38 | } // namespace facebook 39 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainComponentsRegistry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | class MainComponentsRegistry 12 | : public facebook::jni::HybridClass { 13 | public: 14 | // Adapt it to the package you used for your Java class. 15 | constexpr static auto kJavaDescriptor = 16 | "Lcom/example/newarchitecture/components/MainComponentsRegistry;"; 17 | 18 | static void registerNatives(); 19 | 20 | MainComponentsRegistry(ComponentFactory *delegate); 21 | 22 | private: 23 | static std::shared_ptr 24 | sharedProviderRegistry(); 25 | 26 | static jni::local_ref initHybrid( 27 | jni::alias_ref, 28 | ComponentFactory *delegate); 29 | }; 30 | 31 | } // namespace react 32 | } // namespace facebook 33 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/OnLoad.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "MainApplicationTurboModuleManagerDelegate.h" 3 | #include "MainComponentsRegistry.h" 4 | 5 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { 6 | return facebook::jni::initialize(vm, [] { 7 | facebook::react::MainApplicationTurboModuleManagerDelegate:: 8 | registerNatives(); 9 | facebook::react::MainComponentsRegistry::registerNatives(); 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-anydpi-v26/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher_foreground.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher_foreground.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher_foreground.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | RNTrackPlayerExample 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'example' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | includeBuild('../node_modules/react-native-gradle-plugin') 5 | 6 | if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") { 7 | include(":ReactAndroid") 8 | project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') 9 | } 10 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "displayName": "example" 4 | } -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /example/icon-background.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /example/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | import {AppRegistry} from 'react-native'; 2 | import TrackPlayer from 'react-native-track-player'; 3 | 4 | import App from './src/App'; 5 | import {PlaybackService} from './src/services'; 6 | import {name as appName} from './app.json'; 7 | 8 | AppRegistry.registerComponent(appName, () => App); 9 | TrackPlayer.registerPlaybackService(() => PlaybackService); 10 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | # use cocoapods CDN per https://blog.cocoapods.org/CocoaPods-1.7.2/ 5 | source 'https://cdn.cocoapods.org/' 6 | 7 | platform :ios, '11.0' 8 | install! 'cocoapods', :deterministic_uuids => false 9 | 10 | target 'example' do 11 | config = use_native_modules! 12 | 13 | # Flags change depending on the env values. 14 | flags = get_default_flags() 15 | 16 | use_react_native!( 17 | :path => config[:reactNativePath], 18 | # to enable hermes on iOS, change `false` to `true` and then install pods 19 | :hermes_enabled => flags[:hermes_enabled], 20 | :fabric_enabled => flags[:fabric_enabled], 21 | # An absolute path to your application root. 22 | :app_path => "#{Pod::Config.instance.installation_root}/.." 23 | ) 24 | # pod 'react-native-track-player', :path => '../..' 25 | 26 | target 'exampleTests' do 27 | inherit! :complete 28 | # Pods for testing 29 | end 30 | 31 | # Enables Flipper. 32 | # 33 | # Note that if you have use_frameworks! enabled, Flipper will not work and 34 | # you should disable the next line. 35 | use_flipper!() 36 | 37 | post_install do |installer| 38 | react_native_post_install(installer) 39 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /example/ios/dummy.swift: -------------------------------------------------------------------------------- 1 | // 2 | // dummy.swift 3 | // example 4 | // 5 | // Created by David Chavez on 28.05.21. 6 | // 7 | 8 | import Foundation 9 | -------------------------------------------------------------------------------- /example/ios/example-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | -------------------------------------------------------------------------------- /example/ios/example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/100.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/1024.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/114.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/120.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/128.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/144.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/152.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/16.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/167.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/172.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/172.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/180.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/196.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/196.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/20.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/216.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/216.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/256.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/29.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/32.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/40.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/48.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/50.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/512.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/55.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/57.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/58.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/60.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/64.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/72.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/76.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/80.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/87.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/88.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/88.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/ios-marketing-1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/ios-marketing-1024@1x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-20@1x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-20@2x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-29@1x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-29@2x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-40@1x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-40@2x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-76@1x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-76@2x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/ipad-83.5@2x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-20@2x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-20@3x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-29@2x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-29@3x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-40@2x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-40@3x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-60@2x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/ios/example/Images.xcassets/AppIcon.appiconset/iphone-60@3x.png -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/example/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | @autoreleasepool { 8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /example/ios/exampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | const path = require('path'); 8 | const exclusionList = require('metro-config/src/defaults/exclusionList'); 9 | 10 | module.exports = { 11 | resolver: { 12 | blockList: exclusionList([ 13 | // This stops "react-native run-windows" from causing the metro server to crash if its already running 14 | new RegExp( 15 | `${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`, 16 | ), 17 | // This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip 18 | /.*\.ProjectImports\.zip/, 19 | ]), 20 | }, 21 | transformer: { 22 | getTransformOptions: async () => ({ 23 | transform: { 24 | experimentalImportSupport: false, 25 | inlineRequires: true, 26 | }, 27 | }), 28 | }, 29 | }; 30 | -------------------------------------------------------------------------------- /example/msbuild.binlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/msbuild.binlog -------------------------------------------------------------------------------- /example/src/assets/data/playlist.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://react-native-track-player.js.org/example/Longing.mp3", 4 | "title": "Longing", 5 | "artist": "David Chavez", 6 | "artwork": "https://react-native-track-player.js.org/example/Longing.jpeg", 7 | "duration": 143 8 | }, 9 | { 10 | "url": "https://react-native-track-player.js.org/example/Soul%20Searching.mp3", 11 | "title": "Soul Searching (Demo)", 12 | "artist": "David Chavez", 13 | "artwork": "https://react-native-track-player.js.org/example/Soul%20Searching.jpeg", 14 | "duration": 77 15 | }, 16 | { 17 | "url": "https://react-native-track-player.js.org/example/Lullaby%20(Demo).mp3", 18 | "title": "Lullaby (Demo)", 19 | "artist": "David Chavez", 20 | "artwork": "https://react-native-track-player.js.org/example/Lullaby%20(Demo).jpeg", 21 | "duration": 71 22 | }, 23 | { 24 | "url": "https://react-native-track-player.js.org/example/Rhythm%20City%20(Demo).mp3", 25 | "title": "Rhythm City (Demo)", 26 | "artist": "David Chavez", 27 | "artwork": "https://react-native-track-player.js.org/example/Rhythm%20City%20(Demo).jpeg", 28 | "duration": 106 29 | }, 30 | { 31 | "url": "https://react-native-track-player.js.org/example/hls/whip/playlist.m3u8", 32 | "title": "Whip", 33 | "artist": "prazkhanal", 34 | "artwork": "https://react-native-track-player.js.org/example/hls/whip/whip.jpeg", 35 | "type": "hls" 36 | }, 37 | { 38 | "url": "https://ais-sa5.cdnstream1.com/b75154_128mp3", 39 | "title": "Smooth Jazz 24/7", 40 | "artist": "New York, NY", 41 | "artwork": "https://react-native-track-player.js.org/example/smooth-jazz-24-7.jpeg", 42 | "isLiveStream": true 43 | } 44 | ] 45 | -------------------------------------------------------------------------------- /example/src/assets/resources/artwork.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/src/assets/resources/artwork.jpg -------------------------------------------------------------------------------- /example/src/assets/resources/pure.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitehorse21/react-native-track-player/8b0cb1089409eff451fa252f2ba68b3c09f638eb/example/src/assets/resources/pure.m4a -------------------------------------------------------------------------------- /example/src/components/Button.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { 3 | StyleSheet, 4 | Text, 5 | TextStyle, 6 | TouchableWithoutFeedback, 7 | ViewStyle, 8 | } from 'react-native'; 9 | 10 | export interface ButtonProps { 11 | title: string; 12 | onPress: () => void; 13 | type?: keyof typeof styles; 14 | style?: ViewStyle | TextStyle; 15 | } 16 | 17 | export const Button: React.FC = ({ 18 | title, 19 | onPress, 20 | type = 'primary', 21 | style, 22 | }) => { 23 | return ( 24 | 25 | 31 | {title} 32 | 33 | 34 | ); 35 | }; 36 | 37 | const styles = StyleSheet.create({ 38 | primary: { 39 | fontSize: 18, 40 | fontWeight: '600', 41 | color: '#FFD479', 42 | padding: 20, 43 | }, 44 | secondary: { 45 | fontSize: 14, 46 | color: '#FFD479', 47 | padding: 22, 48 | }, 49 | }); 50 | -------------------------------------------------------------------------------- /example/src/components/PlayPauseButton.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ActivityIndicator, StyleSheet, View } from 'react-native'; 3 | import { State, usePlaybackState } from 'react-native-track-player'; 4 | import { useOnTogglePlayback } from '../hooks'; 5 | import { useDebouncedValue } from '../hooks/useDebouncedValue'; 6 | 7 | import { Button } from './Button'; 8 | 9 | export const PlayPauseButton: React.FC = () => { 10 | const state = usePlaybackState(); 11 | const isPlaying = state === State.Playing; 12 | const isLoading = useDebouncedValue( 13 | state === State.Connecting || state === State.Buffering, 14 | 250 15 | ); 16 | 17 | const onTogglePlayback = useOnTogglePlayback(); 18 | 19 | if (isLoading) { 20 | return ( 21 | 22 | {isLoading && } 23 | 24 | ); 25 | } 26 | 27 | return ( 28 |