ytdlp-react-native 1.0.0 → 1.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +54 -1
  2. package/README.md +422 -267
  3. package/android/src/main/AndroidManifest.xml +20 -1
  4. package/android/src/main/java/expo/modules/ytdlp/ExpoYtDlpModule.kt +8 -0
  5. package/android/src/main/java/expo/modules/ytdlp/YtDlpDownloadManager.kt +177 -16
  6. package/android/src/main/java/expo/modules/ytdlp/YtDlpEngine.kt +35 -4
  7. package/android/src/main/java/expo/modules/ytdlp/YtDlpForegroundService.kt +241 -0
  8. package/android/src/main/java/expo/modules/ytdlp/YtDlpTask.kt +44 -2
  9. package/build/ExpoYtDlpModule.d.ts +2 -0
  10. package/build/ExpoYtDlpModule.d.ts.map +1 -1
  11. package/build/ExpoYtDlpModule.js.map +1 -1
  12. package/build/YtDlp.d.ts +10 -0
  13. package/build/YtDlp.d.ts.map +1 -1
  14. package/build/YtDlp.js +22 -77
  15. package/build/YtDlp.js.map +1 -1
  16. package/build/constants.d.ts +1 -4
  17. package/build/constants.d.ts.map +1 -1
  18. package/build/constants.js +2 -1
  19. package/build/constants.js.map +1 -1
  20. package/build/downloadTask.d.ts +2 -0
  21. package/build/downloadTask.d.ts.map +1 -1
  22. package/build/downloadTask.js +7 -0
  23. package/build/downloadTask.js.map +1 -1
  24. package/build/errors.js +3 -3
  25. package/build/errors.js.map +1 -1
  26. package/build/index.d.ts +3 -1
  27. package/build/index.d.ts.map +1 -1
  28. package/build/index.js +3 -1
  29. package/build/index.js.map +1 -1
  30. package/build/mappers.js +3 -2
  31. package/build/mappers.js.map +1 -1
  32. package/build/serializers.d.ts +5 -0
  33. package/build/serializers.d.ts.map +1 -0
  34. package/build/serializers.js +96 -0
  35. package/build/serializers.js.map +1 -0
  36. package/build/types.d.ts +39 -1
  37. package/build/types.d.ts.map +1 -1
  38. package/build/types.js.map +1 -1
  39. package/package.json +7 -5
  40. package/src/ExpoYtDlpModule.ts +2 -0
  41. package/src/YtDlp.ts +21 -57
  42. package/src/__tests__/errors.test.ts +117 -0
  43. package/src/__tests__/mappers.test.ts +167 -0
  44. package/src/__tests__/serializers.test.ts +72 -0
  45. package/src/constants.ts +3 -1
  46. package/src/downloadTask.ts +9 -0
  47. package/src/errors.ts +3 -3
  48. package/src/index.ts +3 -1
  49. package/src/mappers.ts +3 -2
  50. package/src/serializers.ts +78 -0
  51. package/src/types.ts +47 -1
package/CHANGELOG.md CHANGED
@@ -5,7 +5,60 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [Unreleased]
8
+ ## [1.1.0-beta.0] - 2026-09-06
9
+
10
+ ### Added
11
+
12
+ - **Background downloads via a native foreground service** (issue #3).
13
+ While at least one download runs, the module promotes the process with a
14
+ `dataSync` foreground service showing live progress, a Cancel action
15
+ (stops all active downloads), and tap-to-reopen. A partial wake lock keeps
16
+ screen-off downloads moving. No new API: the service starts/stops
17
+ automatically with the active-run count, and `cancelAll()` backs the
18
+ notification action. Survives backgrounding, screen-off and swipe-away;
19
+ does not survive process death or reboot (tasks stay process-local).
20
+
21
+ - **Pause and resume support** for downloads (issue #4). `DownloadTask` now
22
+ exposes `pause(): Promise<boolean>` and `resume(): Promise<boolean>`, plus
23
+ `YtDlp.pause(taskId)` / `YtDlp.resume(taskId)`. Pause aborts the download
24
+ cooperatively and keeps the task registered with the new `paused` status;
25
+ resume re-runs the same options and yt-dlp continues from the `.part` file
26
+ by default. A per-task run generation prevents stale runners from racing a
27
+ freshly resumed download.
28
+ - Optional FFmpeg support via the new `ffmpeg.location` download option.
29
+ Point it at an `ffmpeg` executable on the device (the package does not
30
+ bundle one) and `bestvideo+bestaudio` merging, audio extraction /
31
+ re-encoding, and metadata/thumbnail embedding become available instead of
32
+ being rejected with `PROCESSING_FAILED`.
33
+ - Unit tests for the download/extract option serializers.
34
+
35
+ ### Fixed
36
+
37
+ - `YtDlp.getVersion().library` now reports the version from `package.json`
38
+ instead of a hardcoded constant, so it can no longer drift out of sync.
39
+ - `mapDownloadProgress` now actually returns `null` for non-object payloads
40
+ (the previous null guard was dead code because `asRecord` returned `{}`).
41
+ - Extraction error classification now checks age restriction before
42
+ sign-in/auth, so messages like _Sign in to confirm your age_ map to
43
+ `AGE_RESTRICTED` instead of `AUTHENTICATION_REQUIRED`.
44
+
45
+ ### Added
46
+
47
+ - Unit tests for the TypeScript layer (`errors`, `mappers`) so
48
+ `bun run test` runs and passes instead of failing with "No tests found".
49
+
50
+ ### Changed
51
+
52
+ - Dev toolchain aligned to the documented support matrix: Expo SDK 57,
53
+ React Native 0.86, React 19.2, `babel-preset-expo` 57 and `jest-expo` 57.
54
+ - `bun` is the package manager; `package-lock.json` is not used.
55
+
56
+ ## [1.0.0] - 2026-08-31
57
+
58
+ ### Changed
59
+
60
+ - Package renamed from `expo-ytdlp-native` to `ytdlp-react-native` and
61
+ released as 1.0.0 with matching repository metadata and keywords.
9
62
 
10
63
  ## [0.1.3] - 2026-08-17
11
64