@javascriptcommon/react-native-track-player 1.2.9

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 (79) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/LICENSE +21 -0
  3. package/android/build.gradle +34 -0
  4. package/android/proguard-rules.txt +3 -0
  5. package/android/react-native-music-control.iml +139 -0
  6. package/android/react-native-track-player.iml +151 -0
  7. package/android/src/main/AndroidManifest.xml +30 -0
  8. package/android/src/main/java/com/guichaguri/trackplayer/TrackPlayer.java +28 -0
  9. package/android/src/main/java/com/guichaguri/trackplayer/module/MusicEvents.java +55 -0
  10. package/android/src/main/java/com/guichaguri/trackplayer/module/MusicModule.java +298 -0
  11. package/android/src/main/java/com/guichaguri/trackplayer/service/HeadlessJsMediaService.java +174 -0
  12. package/android/src/main/java/com/guichaguri/trackplayer/service/MusicBinder.java +47 -0
  13. package/android/src/main/java/com/guichaguri/trackplayer/service/MusicManager.java +383 -0
  14. package/android/src/main/java/com/guichaguri/trackplayer/service/MusicService.java +271 -0
  15. package/android/src/main/java/com/guichaguri/trackplayer/service/Utils.java +243 -0
  16. package/android/src/main/java/com/guichaguri/trackplayer/service/metadata/ButtonEvents.java +148 -0
  17. package/android/src/main/java/com/guichaguri/trackplayer/service/metadata/MetadataManager.java +379 -0
  18. package/android/src/main/java/com/guichaguri/trackplayer/service/models/Track.java +141 -0
  19. package/android/src/main/java/com/guichaguri/trackplayer/service/models/TrackType.java +35 -0
  20. package/android/src/main/res/drawable-hdpi/ic_forward.png +0 -0
  21. package/android/src/main/res/drawable-hdpi/ic_logo.png +0 -0
  22. package/android/src/main/res/drawable-hdpi/ic_next.png +0 -0
  23. package/android/src/main/res/drawable-hdpi/ic_pause.png +0 -0
  24. package/android/src/main/res/drawable-hdpi/ic_play.png +0 -0
  25. package/android/src/main/res/drawable-hdpi/ic_previous.png +0 -0
  26. package/android/src/main/res/drawable-hdpi/ic_rewind.png +0 -0
  27. package/android/src/main/res/drawable-hdpi/ic_stop.png +0 -0
  28. package/android/src/main/res/drawable-mdpi/ic_forward.png +0 -0
  29. package/android/src/main/res/drawable-mdpi/ic_logo.png +0 -0
  30. package/android/src/main/res/drawable-mdpi/ic_next.png +0 -0
  31. package/android/src/main/res/drawable-mdpi/ic_pause.png +0 -0
  32. package/android/src/main/res/drawable-mdpi/ic_play.png +0 -0
  33. package/android/src/main/res/drawable-mdpi/ic_previous.png +0 -0
  34. package/android/src/main/res/drawable-mdpi/ic_rewind.png +0 -0
  35. package/android/src/main/res/drawable-mdpi/ic_stop.png +0 -0
  36. package/android/src/main/res/drawable-xhdpi/ic_forward.png +0 -0
  37. package/android/src/main/res/drawable-xhdpi/ic_logo.png +0 -0
  38. package/android/src/main/res/drawable-xhdpi/ic_next.png +0 -0
  39. package/android/src/main/res/drawable-xhdpi/ic_pause.png +0 -0
  40. package/android/src/main/res/drawable-xhdpi/ic_play.png +0 -0
  41. package/android/src/main/res/drawable-xhdpi/ic_previous.png +0 -0
  42. package/android/src/main/res/drawable-xhdpi/ic_rewind.png +0 -0
  43. package/android/src/main/res/drawable-xhdpi/ic_stop.png +0 -0
  44. package/android/src/main/res/drawable-xxhdpi/ic_forward.png +0 -0
  45. package/android/src/main/res/drawable-xxhdpi/ic_logo.png +0 -0
  46. package/android/src/main/res/drawable-xxhdpi/ic_next.png +0 -0
  47. package/android/src/main/res/drawable-xxhdpi/ic_pause.png +0 -0
  48. package/android/src/main/res/drawable-xxhdpi/ic_play.png +0 -0
  49. package/android/src/main/res/drawable-xxhdpi/ic_previous.png +0 -0
  50. package/android/src/main/res/drawable-xxhdpi/ic_rewind.png +0 -0
  51. package/android/src/main/res/drawable-xxhdpi/ic_stop.png +0 -0
  52. package/android/src/main/res/drawable-xxxhdpi/ic_forward.png +0 -0
  53. package/android/src/main/res/drawable-xxxhdpi/ic_logo.png +0 -0
  54. package/android/src/main/res/drawable-xxxhdpi/ic_next.png +0 -0
  55. package/android/src/main/res/drawable-xxxhdpi/ic_pause.png +0 -0
  56. package/android/src/main/res/drawable-xxxhdpi/ic_play.png +0 -0
  57. package/android/src/main/res/drawable-xxxhdpi/ic_previous.png +0 -0
  58. package/android/src/main/res/drawable-xxxhdpi/ic_rewind.png +0 -0
  59. package/android/src/main/res/drawable-xxxhdpi/ic_stop.png +0 -0
  60. package/index.d.ts +174 -0
  61. package/index.js +4 -0
  62. package/ios/RNTrackPlayer/Models/Capabilities.swift +17 -0
  63. package/ios/RNTrackPlayer/Models/MediaURL.swift +32 -0
  64. package/ios/RNTrackPlayer/Models/Track.swift +120 -0
  65. package/ios/RNTrackPlayer/RNTrackPlayer.swift +488 -0
  66. package/ios/RNTrackPlayer/RNTrackPlayerBridge.h +12 -0
  67. package/ios/RNTrackPlayer/RNTrackPlayerBridge.m +29 -0
  68. package/ios/RNTrackPlayer/Support/RNTrackPlayer-Bridging-Header.h +6 -0
  69. package/ios/TrackPlayer.xcodeproj/project.pbxproj +495 -0
  70. package/ios/TrackPlayer.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  71. package/ios/TrackPlayer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  72. package/ios/TrackPlayer.xcodeproj/project.xcworkspace/xcuserdata/marco.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  73. package/ios/TrackPlayer.xcodeproj/xcuserdata/marco.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  74. package/lib/ProgressComponent.js +70 -0
  75. package/lib/eventTypes.js +28 -0
  76. package/lib/hooks.js +160 -0
  77. package/lib/index.js +177 -0
  78. package/package.json +47 -0
  79. package/react-native-track-player.podspec +22 -0
@@ -0,0 +1,495 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 48;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+ 9A0CF10E2046E5AC0093A5DF /* PitchAlgorithms.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0CF10D2046E5AC0093A5DF /* PitchAlgorithms.swift */; };
11
+ 9B0E282E1F07D76F00B71D2A /* RNTrackPlayerBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0E282D1F07D76F00B71D2A /* RNTrackPlayerBridge.m */; };
12
+ 9B0E282F1F07D76F00B71D2A /* RNTrackPlayerBridge.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9B0E282C1F07D76F00B71D2A /* RNTrackPlayerBridge.h */; };
13
+ 9B18C2FA226356560019375A /* SessionCategories.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C2F9226356560019375A /* SessionCategories.swift */; };
14
+ 9B18C326226357940019375A /* AudioItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C308226357930019375A /* AudioItem.swift */; };
15
+ 9B18C327226357940019375A /* Event.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C309226357930019375A /* Event.swift */; };
16
+ 9B18C328226357940019375A /* QueueManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C30A226357930019375A /* QueueManager.swift */; };
17
+ 9B18C329226357940019375A /* RemoteCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C30C226357930019375A /* RemoteCommand.swift */; };
18
+ 9B18C32A226357940019375A /* RemoteCommandController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C30D226357930019375A /* RemoteCommandController.swift */; };
19
+ 9B18C32B226357940019375A /* QueuedAudioPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C30E226357930019375A /* QueuedAudioPlayer.swift */; };
20
+ 9B18C32C226357940019375A /* TimeEventFrequency.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C30F226357930019375A /* TimeEventFrequency.swift */; };
21
+ 9B18C32D226357940019375A /* APError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C310226357930019375A /* APError.swift */; };
22
+ 9B18C32E226357940019375A /* AVPlayerObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C312226357930019375A /* AVPlayerObserver.swift */; };
23
+ 9B18C32F226357940019375A /* AVPlayerItemNotificationObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C313226357930019375A /* AVPlayerItemNotificationObserver.swift */; };
24
+ 9B18C330226357940019375A /* AVPlayerItemObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C314226357930019375A /* AVPlayerItemObserver.swift */; };
25
+ 9B18C331226357940019375A /* AVPlayerTimeObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C315226357930019375A /* AVPlayerTimeObserver.swift */; };
26
+ 9B18C332226357940019375A /* MediaItemProperty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C317226357930019375A /* MediaItemProperty.swift */; };
27
+ 9B18C333226357940019375A /* NowPlayingInfoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C318226357930019375A /* NowPlayingInfoController.swift */; };
28
+ 9B18C334226357940019375A /* NowPlayingInfoKeyValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C319226357930019375A /* NowPlayingInfoKeyValue.swift */; };
29
+ 9B18C335226357940019375A /* NowPlayingInfoControllerProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C31A226357930019375A /* NowPlayingInfoControllerProtocol.swift */; };
30
+ 9B18C336226357940019375A /* NowPlayingInfoProperty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C31B226357930019375A /* NowPlayingInfoProperty.swift */; };
31
+ 9B18C337226357940019375A /* NowPlayingInfoCenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C31C226357930019375A /* NowPlayingInfoCenter.swift */; };
32
+ 9B18C338226357940019375A /* AudioPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C31D226357930019375A /* AudioPlayer.swift */; };
33
+ 9B18C339226357940019375A /* AVPlayerWrapperState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C31F226357930019375A /* AVPlayerWrapperState.swift */; };
34
+ 9B18C33A226357940019375A /* AVPlayerWrapperProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C320226357930019375A /* AVPlayerWrapperProtocol.swift */; };
35
+ 9B18C33B226357940019375A /* AVPlayerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C321226357930019375A /* AVPlayerWrapper.swift */; };
36
+ 9B18C33C226357940019375A /* AVPlayerWrapperDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C322226357930019375A /* AVPlayerWrapperDelegate.swift */; };
37
+ 9B18C33D226357940019375A /* AudioSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C324226357940019375A /* AudioSession.swift */; };
38
+ 9B18C33E226357940019375A /* AudioSessionController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B18C325226357940019375A /* AudioSessionController.swift */; };
39
+ 9B58DF3B1F40C0F000C2105E /* RNTrackPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B58DF3A1F40C0F000C2105E /* RNTrackPlayer.swift */; };
40
+ 9B78A2461F3F12BC002B5E3C /* Track.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B78A2451F3F12BC002B5E3C /* Track.swift */; };
41
+ 9B78A2481F3F12C9002B5E3C /* MediaURL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B78A2471F3F12C9002B5E3C /* MediaURL.swift */; };
42
+ 9BFC1FDD1F61A8E8008795BF /* Capabilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BFC1FDC1F61A8E8008795BF /* Capabilities.swift */; };
43
+ /* End PBXBuildFile section */
44
+
45
+ /* Begin PBXCopyFilesBuildPhase section */
46
+ 9B0E28271F07D76F00B71D2A /* CopyFiles */ = {
47
+ isa = PBXCopyFilesBuildPhase;
48
+ buildActionMask = 2147483647;
49
+ dstPath = "include/$(PRODUCT_NAME)";
50
+ dstSubfolderSpec = 16;
51
+ files = (
52
+ 9B0E282F1F07D76F00B71D2A /* RNTrackPlayerBridge.h in CopyFiles */,
53
+ );
54
+ runOnlyForDeploymentPostprocessing = 0;
55
+ };
56
+ /* End PBXCopyFilesBuildPhase section */
57
+
58
+ /* Begin PBXFileReference section */
59
+ 9A0CF10D2046E5AC0093A5DF /* PitchAlgorithms.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PitchAlgorithms.swift; sourceTree = "<group>"; };
60
+ 9B0E28291F07D76F00B71D2A /* libRNTrackPlayer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNTrackPlayer.a; sourceTree = BUILT_PRODUCTS_DIR; };
61
+ 9B0E282C1F07D76F00B71D2A /* RNTrackPlayerBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNTrackPlayerBridge.h; sourceTree = "<group>"; };
62
+ 9B0E282D1F07D76F00B71D2A /* RNTrackPlayerBridge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNTrackPlayerBridge.m; sourceTree = "<group>"; };
63
+ 9B18C2F9226356560019375A /* SessionCategories.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SessionCategories.swift; sourceTree = "<group>"; };
64
+ 9B18C308226357930019375A /* AudioItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AudioItem.swift; sourceTree = "<group>"; };
65
+ 9B18C309226357930019375A /* Event.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Event.swift; sourceTree = "<group>"; };
66
+ 9B18C30A226357930019375A /* QueueManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QueueManager.swift; sourceTree = "<group>"; };
67
+ 9B18C30C226357930019375A /* RemoteCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RemoteCommand.swift; sourceTree = "<group>"; };
68
+ 9B18C30D226357930019375A /* RemoteCommandController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RemoteCommandController.swift; sourceTree = "<group>"; };
69
+ 9B18C30E226357930019375A /* QueuedAudioPlayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QueuedAudioPlayer.swift; sourceTree = "<group>"; };
70
+ 9B18C30F226357930019375A /* TimeEventFrequency.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TimeEventFrequency.swift; sourceTree = "<group>"; };
71
+ 9B18C310226357930019375A /* APError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = APError.swift; sourceTree = "<group>"; };
72
+ 9B18C312226357930019375A /* AVPlayerObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AVPlayerObserver.swift; sourceTree = "<group>"; };
73
+ 9B18C313226357930019375A /* AVPlayerItemNotificationObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AVPlayerItemNotificationObserver.swift; sourceTree = "<group>"; };
74
+ 9B18C314226357930019375A /* AVPlayerItemObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AVPlayerItemObserver.swift; sourceTree = "<group>"; };
75
+ 9B18C315226357930019375A /* AVPlayerTimeObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AVPlayerTimeObserver.swift; sourceTree = "<group>"; };
76
+ 9B18C317226357930019375A /* MediaItemProperty.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaItemProperty.swift; sourceTree = "<group>"; };
77
+ 9B18C318226357930019375A /* NowPlayingInfoController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NowPlayingInfoController.swift; sourceTree = "<group>"; };
78
+ 9B18C319226357930019375A /* NowPlayingInfoKeyValue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NowPlayingInfoKeyValue.swift; sourceTree = "<group>"; };
79
+ 9B18C31A226357930019375A /* NowPlayingInfoControllerProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NowPlayingInfoControllerProtocol.swift; sourceTree = "<group>"; };
80
+ 9B18C31B226357930019375A /* NowPlayingInfoProperty.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NowPlayingInfoProperty.swift; sourceTree = "<group>"; };
81
+ 9B18C31C226357930019375A /* NowPlayingInfoCenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NowPlayingInfoCenter.swift; sourceTree = "<group>"; };
82
+ 9B18C31D226357930019375A /* AudioPlayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AudioPlayer.swift; sourceTree = "<group>"; };
83
+ 9B18C31F226357930019375A /* AVPlayerWrapperState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AVPlayerWrapperState.swift; sourceTree = "<group>"; };
84
+ 9B18C320226357930019375A /* AVPlayerWrapperProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AVPlayerWrapperProtocol.swift; sourceTree = "<group>"; };
85
+ 9B18C321226357930019375A /* AVPlayerWrapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AVPlayerWrapper.swift; sourceTree = "<group>"; };
86
+ 9B18C322226357930019375A /* AVPlayerWrapperDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AVPlayerWrapperDelegate.swift; sourceTree = "<group>"; };
87
+ 9B18C324226357940019375A /* AudioSession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AudioSession.swift; sourceTree = "<group>"; };
88
+ 9B18C325226357940019375A /* AudioSessionController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AudioSessionController.swift; sourceTree = "<group>"; };
89
+ 9B58DF3A1F40C0F000C2105E /* RNTrackPlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNTrackPlayer.swift; sourceTree = "<group>"; };
90
+ 9B78A2451F3F12BC002B5E3C /* Track.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Track.swift; sourceTree = "<group>"; };
91
+ 9B78A2471F3F12C9002B5E3C /* MediaURL.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaURL.swift; sourceTree = "<group>"; };
92
+ 9BFBA4D01F3DFA3F00453D3A /* RNTrackPlayer-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RNTrackPlayer-Bridging-Header.h"; sourceTree = "<group>"; };
93
+ 9BFC1FDC1F61A8E8008795BF /* Capabilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Capabilities.swift; sourceTree = "<group>"; };
94
+ /* End PBXFileReference section */
95
+
96
+ /* Begin PBXFrameworksBuildPhase section */
97
+ 9B0E28261F07D76F00B71D2A /* Frameworks */ = {
98
+ isa = PBXFrameworksBuildPhase;
99
+ buildActionMask = 2147483647;
100
+ files = (
101
+ );
102
+ runOnlyForDeploymentPostprocessing = 0;
103
+ };
104
+ /* End PBXFrameworksBuildPhase section */
105
+
106
+ /* Begin PBXGroup section */
107
+ 9B0E28201F07D76E00B71D2A = {
108
+ isa = PBXGroup;
109
+ children = (
110
+ 9B0E282B1F07D76F00B71D2A /* RNTrackPlayer */,
111
+ 9B0E282A1F07D76F00B71D2A /* Products */,
112
+ );
113
+ sourceTree = "<group>";
114
+ };
115
+ 9B0E282A1F07D76F00B71D2A /* Products */ = {
116
+ isa = PBXGroup;
117
+ children = (
118
+ 9B0E28291F07D76F00B71D2A /* libRNTrackPlayer.a */,
119
+ );
120
+ name = Products;
121
+ sourceTree = "<group>";
122
+ };
123
+ 9B0E282B1F07D76F00B71D2A /* RNTrackPlayer */ = {
124
+ isa = PBXGroup;
125
+ children = (
126
+ 9BFBA4D31F3DFA4B00453D3A /* Support */,
127
+ 9B0E287A1F0831A400B71D2A /* Models */,
128
+ 9B0E28621F07DF6200B71D2A /* Vendor */,
129
+ 9B0E282C1F07D76F00B71D2A /* RNTrackPlayerBridge.h */,
130
+ 9B0E282D1F07D76F00B71D2A /* RNTrackPlayerBridge.m */,
131
+ 9B58DF3A1F40C0F000C2105E /* RNTrackPlayer.swift */,
132
+ );
133
+ path = RNTrackPlayer;
134
+ sourceTree = "<group>";
135
+ };
136
+ 9B0E28621F07DF6200B71D2A /* Vendor */ = {
137
+ isa = PBXGroup;
138
+ children = (
139
+ 9B8D9F551F40AEC3003A0C0B /* AudioPlayer */,
140
+ );
141
+ path = Vendor;
142
+ sourceTree = "<group>";
143
+ };
144
+ 9B0E287A1F0831A400B71D2A /* Models */ = {
145
+ isa = PBXGroup;
146
+ children = (
147
+ 9B78A2451F3F12BC002B5E3C /* Track.swift */,
148
+ 9B78A2471F3F12C9002B5E3C /* MediaURL.swift */,
149
+ 9BFC1FDC1F61A8E8008795BF /* Capabilities.swift */,
150
+ 9A0CF10D2046E5AC0093A5DF /* PitchAlgorithms.swift */,
151
+ 9B18C2F9226356560019375A /* SessionCategories.swift */,
152
+ );
153
+ path = Models;
154
+ sourceTree = "<group>";
155
+ };
156
+ 9B18C30B226357930019375A /* RemoteCommandController */ = {
157
+ isa = PBXGroup;
158
+ children = (
159
+ 9B18C30C226357930019375A /* RemoteCommand.swift */,
160
+ 9B18C30D226357930019375A /* RemoteCommandController.swift */,
161
+ );
162
+ path = RemoteCommandController;
163
+ sourceTree = "<group>";
164
+ };
165
+ 9B18C311226357930019375A /* Observer */ = {
166
+ isa = PBXGroup;
167
+ children = (
168
+ 9B18C312226357930019375A /* AVPlayerObserver.swift */,
169
+ 9B18C313226357930019375A /* AVPlayerItemNotificationObserver.swift */,
170
+ 9B18C314226357930019375A /* AVPlayerItemObserver.swift */,
171
+ 9B18C315226357930019375A /* AVPlayerTimeObserver.swift */,
172
+ );
173
+ path = Observer;
174
+ sourceTree = "<group>";
175
+ };
176
+ 9B18C316226357930019375A /* NowPlayingInfoController */ = {
177
+ isa = PBXGroup;
178
+ children = (
179
+ 9B18C317226357930019375A /* MediaItemProperty.swift */,
180
+ 9B18C318226357930019375A /* NowPlayingInfoController.swift */,
181
+ 9B18C319226357930019375A /* NowPlayingInfoKeyValue.swift */,
182
+ 9B18C31A226357930019375A /* NowPlayingInfoControllerProtocol.swift */,
183
+ 9B18C31B226357930019375A /* NowPlayingInfoProperty.swift */,
184
+ 9B18C31C226357930019375A /* NowPlayingInfoCenter.swift */,
185
+ );
186
+ path = NowPlayingInfoController;
187
+ sourceTree = "<group>";
188
+ };
189
+ 9B18C31E226357930019375A /* AVPlayerWrapper */ = {
190
+ isa = PBXGroup;
191
+ children = (
192
+ 9B18C31F226357930019375A /* AVPlayerWrapperState.swift */,
193
+ 9B18C320226357930019375A /* AVPlayerWrapperProtocol.swift */,
194
+ 9B18C321226357930019375A /* AVPlayerWrapper.swift */,
195
+ 9B18C322226357930019375A /* AVPlayerWrapperDelegate.swift */,
196
+ );
197
+ path = AVPlayerWrapper;
198
+ sourceTree = "<group>";
199
+ };
200
+ 9B18C323226357940019375A /* AudioSessionController */ = {
201
+ isa = PBXGroup;
202
+ children = (
203
+ 9B18C324226357940019375A /* AudioSession.swift */,
204
+ 9B18C325226357940019375A /* AudioSessionController.swift */,
205
+ );
206
+ path = AudioSessionController;
207
+ sourceTree = "<group>";
208
+ };
209
+ 9B8D9F551F40AEC3003A0C0B /* AudioPlayer */ = {
210
+ isa = PBXGroup;
211
+ children = (
212
+ 9B18C310226357930019375A /* APError.swift */,
213
+ 9B18C308226357930019375A /* AudioItem.swift */,
214
+ 9B18C31D226357930019375A /* AudioPlayer.swift */,
215
+ 9B18C323226357940019375A /* AudioSessionController */,
216
+ 9B18C31E226357930019375A /* AVPlayerWrapper */,
217
+ 9B18C309226357930019375A /* Event.swift */,
218
+ 9B18C316226357930019375A /* NowPlayingInfoController */,
219
+ 9B18C311226357930019375A /* Observer */,
220
+ 9B18C30E226357930019375A /* QueuedAudioPlayer.swift */,
221
+ 9B18C30A226357930019375A /* QueueManager.swift */,
222
+ 9B18C30B226357930019375A /* RemoteCommandController */,
223
+ 9B18C30F226357930019375A /* TimeEventFrequency.swift */,
224
+ );
225
+ name = AudioPlayer;
226
+ path = AudioPlayer/SwiftAudio/Classes;
227
+ sourceTree = "<group>";
228
+ };
229
+ 9BFBA4D31F3DFA4B00453D3A /* Support */ = {
230
+ isa = PBXGroup;
231
+ children = (
232
+ 9BFBA4D01F3DFA3F00453D3A /* RNTrackPlayer-Bridging-Header.h */,
233
+ );
234
+ path = Support;
235
+ sourceTree = "<group>";
236
+ };
237
+ /* End PBXGroup section */
238
+
239
+ /* Begin PBXNativeTarget section */
240
+ 9B0E28281F07D76F00B71D2A /* RNTrackPlayer */ = {
241
+ isa = PBXNativeTarget;
242
+ buildConfigurationList = 9B0E28321F07D76F00B71D2A /* Build configuration list for PBXNativeTarget "RNTrackPlayer" */;
243
+ buildPhases = (
244
+ 9B0E28251F07D76F00B71D2A /* Sources */,
245
+ 9B0E28261F07D76F00B71D2A /* Frameworks */,
246
+ 9B0E28271F07D76F00B71D2A /* CopyFiles */,
247
+ );
248
+ buildRules = (
249
+ );
250
+ dependencies = (
251
+ );
252
+ name = RNTrackPlayer;
253
+ productName = RNTrackPlayer;
254
+ productReference = 9B0E28291F07D76F00B71D2A /* libRNTrackPlayer.a */;
255
+ productType = "com.apple.product-type.library.static";
256
+ };
257
+ /* End PBXNativeTarget section */
258
+
259
+ /* Begin PBXProject section */
260
+ 9B0E28211F07D76E00B71D2A /* Project object */ = {
261
+ isa = PBXProject;
262
+ attributes = {
263
+ LastUpgradeCheck = 0900;
264
+ ORGANIZATIONNAME = "David Chavez";
265
+ TargetAttributes = {
266
+ 9B0E28281F07D76F00B71D2A = {
267
+ CreatedOnToolsVersion = 9.0;
268
+ LastSwiftMigration = 0900;
269
+ };
270
+ };
271
+ };
272
+ buildConfigurationList = 9B0E28241F07D76E00B71D2A /* Build configuration list for PBXProject "RNTrackPlayer" */;
273
+ compatibilityVersion = "Xcode 8.0";
274
+ developmentRegion = en;
275
+ hasScannedForEncodings = 0;
276
+ knownRegions = (
277
+ en,
278
+ );
279
+ mainGroup = 9B0E28201F07D76E00B71D2A;
280
+ productRefGroup = 9B0E282A1F07D76F00B71D2A /* Products */;
281
+ projectDirPath = "";
282
+ projectRoot = "";
283
+ targets = (
284
+ 9B0E28281F07D76F00B71D2A /* RNTrackPlayer */,
285
+ );
286
+ };
287
+ /* End PBXProject section */
288
+
289
+ /* Begin PBXSourcesBuildPhase section */
290
+ 9B0E28251F07D76F00B71D2A /* Sources */ = {
291
+ isa = PBXSourcesBuildPhase;
292
+ buildActionMask = 2147483647;
293
+ files = (
294
+ 9B0E282E1F07D76F00B71D2A /* RNTrackPlayerBridge.m in Sources */,
295
+ 9B18C334226357940019375A /* NowPlayingInfoKeyValue.swift in Sources */,
296
+ 9B18C327226357940019375A /* Event.swift in Sources */,
297
+ 9B18C332226357940019375A /* MediaItemProperty.swift in Sources */,
298
+ 9B18C329226357940019375A /* RemoteCommand.swift in Sources */,
299
+ 9B18C333226357940019375A /* NowPlayingInfoController.swift in Sources */,
300
+ 9B18C32B226357940019375A /* QueuedAudioPlayer.swift in Sources */,
301
+ 9B18C33D226357940019375A /* AudioSession.swift in Sources */,
302
+ 9B18C32F226357940019375A /* AVPlayerItemNotificationObserver.swift in Sources */,
303
+ 9B18C32A226357940019375A /* RemoteCommandController.swift in Sources */,
304
+ 9B18C2FA226356560019375A /* SessionCategories.swift in Sources */,
305
+ 9B78A2481F3F12C9002B5E3C /* MediaURL.swift in Sources */,
306
+ 9B18C338226357940019375A /* AudioPlayer.swift in Sources */,
307
+ 9B18C326226357940019375A /* AudioItem.swift in Sources */,
308
+ 9B18C328226357940019375A /* QueueManager.swift in Sources */,
309
+ 9BFC1FDD1F61A8E8008795BF /* Capabilities.swift in Sources */,
310
+ 9B18C337226357940019375A /* NowPlayingInfoCenter.swift in Sources */,
311
+ 9B18C33E226357940019375A /* AudioSessionController.swift in Sources */,
312
+ 9B18C32D226357940019375A /* APError.swift in Sources */,
313
+ 9B78A2461F3F12BC002B5E3C /* Track.swift in Sources */,
314
+ 9B18C336226357940019375A /* NowPlayingInfoProperty.swift in Sources */,
315
+ 9B18C33A226357940019375A /* AVPlayerWrapperProtocol.swift in Sources */,
316
+ 9B18C339226357940019375A /* AVPlayerWrapperState.swift in Sources */,
317
+ 9B18C331226357940019375A /* AVPlayerTimeObserver.swift in Sources */,
318
+ 9A0CF10E2046E5AC0093A5DF /* PitchAlgorithms.swift in Sources */,
319
+ 9B18C32E226357940019375A /* AVPlayerObserver.swift in Sources */,
320
+ 9B18C33C226357940019375A /* AVPlayerWrapperDelegate.swift in Sources */,
321
+ 9B18C32C226357940019375A /* TimeEventFrequency.swift in Sources */,
322
+ 9B18C33B226357940019375A /* AVPlayerWrapper.swift in Sources */,
323
+ 9B18C330226357940019375A /* AVPlayerItemObserver.swift in Sources */,
324
+ 9B18C335226357940019375A /* NowPlayingInfoControllerProtocol.swift in Sources */,
325
+ 9B58DF3B1F40C0F000C2105E /* RNTrackPlayer.swift in Sources */,
326
+ );
327
+ runOnlyForDeploymentPostprocessing = 0;
328
+ };
329
+ /* End PBXSourcesBuildPhase section */
330
+
331
+ /* Begin XCBuildConfiguration section */
332
+ 9B0E28301F07D76F00B71D2A /* Debug */ = {
333
+ isa = XCBuildConfiguration;
334
+ buildSettings = {
335
+ ALWAYS_SEARCH_USER_PATHS = NO;
336
+ CLANG_ANALYZER_NONNULL = YES;
337
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
338
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
339
+ CLANG_CXX_LIBRARY = "libc++";
340
+ CLANG_ENABLE_MODULES = YES;
341
+ CLANG_ENABLE_OBJC_ARC = YES;
342
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
343
+ CLANG_WARN_BOOL_CONVERSION = YES;
344
+ CLANG_WARN_COMMA = YES;
345
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
346
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
347
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
348
+ CLANG_WARN_EMPTY_BODY = YES;
349
+ CLANG_WARN_ENUM_CONVERSION = YES;
350
+ CLANG_WARN_INFINITE_RECURSION = YES;
351
+ CLANG_WARN_INT_CONVERSION = YES;
352
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
353
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
354
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
355
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
356
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
357
+ CLANG_WARN_UNREACHABLE_CODE = YES;
358
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
359
+ CODE_SIGN_IDENTITY = "iPhone Developer";
360
+ COPY_PHASE_STRIP = NO;
361
+ DEBUG_INFORMATION_FORMAT = dwarf;
362
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
363
+ ENABLE_TESTABILITY = YES;
364
+ GCC_C_LANGUAGE_STANDARD = gnu11;
365
+ GCC_DYNAMIC_NO_PIC = NO;
366
+ GCC_NO_COMMON_BLOCKS = YES;
367
+ GCC_OPTIMIZATION_LEVEL = 0;
368
+ GCC_PREPROCESSOR_DEFINITIONS = (
369
+ "DEBUG=1",
370
+ "$(inherited)",
371
+ );
372
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
373
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
374
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
375
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
376
+ GCC_WARN_UNUSED_FUNCTION = YES;
377
+ GCC_WARN_UNUSED_VARIABLE = YES;
378
+ IPHONEOS_DEPLOYMENT_TARGET = 10.0;
379
+ MTL_ENABLE_DEBUG_INFO = YES;
380
+ ONLY_ACTIVE_ARCH = YES;
381
+ SDKROOT = iphoneos;
382
+ SWIFT_VERSION = 4.0;
383
+ };
384
+ name = Debug;
385
+ };
386
+ 9B0E28311F07D76F00B71D2A /* Release */ = {
387
+ isa = XCBuildConfiguration;
388
+ buildSettings = {
389
+ ALWAYS_SEARCH_USER_PATHS = NO;
390
+ CLANG_ANALYZER_NONNULL = YES;
391
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
392
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
393
+ CLANG_CXX_LIBRARY = "libc++";
394
+ CLANG_ENABLE_MODULES = YES;
395
+ CLANG_ENABLE_OBJC_ARC = YES;
396
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
397
+ CLANG_WARN_BOOL_CONVERSION = YES;
398
+ CLANG_WARN_COMMA = YES;
399
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
400
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
401
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
402
+ CLANG_WARN_EMPTY_BODY = YES;
403
+ CLANG_WARN_ENUM_CONVERSION = YES;
404
+ CLANG_WARN_INFINITE_RECURSION = YES;
405
+ CLANG_WARN_INT_CONVERSION = YES;
406
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
407
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
408
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
409
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
410
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
411
+ CLANG_WARN_UNREACHABLE_CODE = YES;
412
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
413
+ CODE_SIGN_IDENTITY = "iPhone Developer";
414
+ COPY_PHASE_STRIP = NO;
415
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
416
+ ENABLE_NS_ASSERTIONS = NO;
417
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
418
+ GCC_C_LANGUAGE_STANDARD = gnu11;
419
+ GCC_NO_COMMON_BLOCKS = YES;
420
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
421
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
422
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
423
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
424
+ GCC_WARN_UNUSED_FUNCTION = YES;
425
+ GCC_WARN_UNUSED_VARIABLE = YES;
426
+ IPHONEOS_DEPLOYMENT_TARGET = 10.0;
427
+ MTL_ENABLE_DEBUG_INFO = NO;
428
+ SDKROOT = iphoneos;
429
+ SWIFT_VERSION = 4.0;
430
+ VALIDATE_PRODUCT = YES;
431
+ };
432
+ name = Release;
433
+ };
434
+ 9B0E28331F07D76F00B71D2A /* Debug */ = {
435
+ isa = XCBuildConfiguration;
436
+ buildSettings = {
437
+ CLANG_ENABLE_MODULES = YES;
438
+ DEFINES_MODULE = YES;
439
+ DEVELOPMENT_TEAM = B82TF96752;
440
+ HEADER_SEARCH_PATHS = "$(PODS_ROOT)/Headers/Public/React";
441
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
442
+ OTHER_LDFLAGS = "-ObjC";
443
+ PODS_ROOT = "\"${SRCROOT}/../../../ios/Pods\"";
444
+ PRODUCT_NAME = "$(TARGET_NAME)";
445
+ SKIP_INSTALL = YES;
446
+ SWIFT_OBJC_BRIDGING_HEADER = "RNTrackPlayer/Support/RNTrackPlayer-Bridging-Header.h";
447
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
448
+ SWIFT_VERSION = 5.0;
449
+ TARGETED_DEVICE_FAMILY = "1,2";
450
+ };
451
+ name = Debug;
452
+ };
453
+ 9B0E28341F07D76F00B71D2A /* Release */ = {
454
+ isa = XCBuildConfiguration;
455
+ buildSettings = {
456
+ CLANG_ENABLE_MODULES = YES;
457
+ DEFINES_MODULE = YES;
458
+ DEVELOPMENT_TEAM = B82TF96752;
459
+ HEADER_SEARCH_PATHS = "$(PODS_ROOT)/Headers/Public/React";
460
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
461
+ OTHER_LDFLAGS = "-ObjC";
462
+ PODS_ROOT = "\"${SRCROOT}/../../../ios/Pods\"";
463
+ PRODUCT_NAME = "$(TARGET_NAME)";
464
+ SKIP_INSTALL = YES;
465
+ SWIFT_OBJC_BRIDGING_HEADER = "RNTrackPlayer/Support/RNTrackPlayer-Bridging-Header.h";
466
+ SWIFT_VERSION = 5.0;
467
+ TARGETED_DEVICE_FAMILY = "1,2";
468
+ };
469
+ name = Release;
470
+ };
471
+ /* End XCBuildConfiguration section */
472
+
473
+ /* Begin XCConfigurationList section */
474
+ 9B0E28241F07D76E00B71D2A /* Build configuration list for PBXProject "RNTrackPlayer" */ = {
475
+ isa = XCConfigurationList;
476
+ buildConfigurations = (
477
+ 9B0E28301F07D76F00B71D2A /* Debug */,
478
+ 9B0E28311F07D76F00B71D2A /* Release */,
479
+ );
480
+ defaultConfigurationIsVisible = 0;
481
+ defaultConfigurationName = Release;
482
+ };
483
+ 9B0E28321F07D76F00B71D2A /* Build configuration list for PBXNativeTarget "RNTrackPlayer" */ = {
484
+ isa = XCConfigurationList;
485
+ buildConfigurations = (
486
+ 9B0E28331F07D76F00B71D2A /* Debug */,
487
+ 9B0E28341F07D76F00B71D2A /* Release */,
488
+ );
489
+ defaultConfigurationIsVisible = 0;
490
+ defaultConfigurationName = Release;
491
+ };
492
+ /* End XCConfigurationList section */
493
+ };
494
+ rootObject = 9B0E28211F07D76E00B71D2A /* Project object */;
495
+ }
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "self:RNTrackPlayer.xcodeproj">
6
+ </FileRef>
7
+ </Workspace>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>IDEDidComputeMac32BitWarning</key>
6
+ <true/>
7
+ </dict>
8
+ </plist>
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>SchemeUserState</key>
6
+ <dict>
7
+ <key>RNTrackPlayer.xcscheme_^#shared#^_</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ </dict>
13
+ </dict>
14
+ </plist>
@@ -0,0 +1,70 @@
1
+ import React, { Component } from 'react';
2
+ import TrackPlayer from './index.js';
3
+
4
+ class ProgressComponent extends Component {
5
+
6
+ constructor(props) {
7
+ super(props);
8
+ this.state = {
9
+ position: 0,
10
+ bufferedPosition: 0,
11
+ duration: 0
12
+ };
13
+ }
14
+
15
+ componentDidMount() {
16
+ this._progressUpdates = true;
17
+ this._updateProgress();
18
+ this._timer = setInterval(this._updateProgress.bind(this), 1000);
19
+ }
20
+
21
+ componentWillUnmount() {
22
+ this._progressUpdates = false;
23
+ clearInterval(this._timer);
24
+ }
25
+
26
+ /**
27
+ * Updates the progress state
28
+ * @private
29
+ */
30
+ async _updateProgress() {
31
+ // TODO check for performance here
32
+ // We can create a new native function to reduces these 3 native calls to only one, if needed
33
+ try {
34
+ const data = {
35
+ position: await TrackPlayer.getPosition(),
36
+ bufferedPosition: await TrackPlayer.getBufferedPosition(),
37
+ duration: await TrackPlayer.getDuration()
38
+ };
39
+
40
+ if(this._progressUpdates) {
41
+ this.setState(data);
42
+ }
43
+ } catch(e) {
44
+ // The player is probably not initialized yet, we'll just ignore it
45
+ }
46
+ }
47
+
48
+ /**
49
+ * Gets the played progress expressed between 0 and 1
50
+ * @return {number}
51
+ */
52
+ getProgress() {
53
+ if(!this.state.duration || !this.state.position) return 0;
54
+
55
+ return this.state.position / this.state.duration;
56
+ }
57
+
58
+ /**
59
+ * Gets the buffered progress expressed between 0 and 1
60
+ * @return {number}
61
+ */
62
+ getBufferedProgress() {
63
+ if(!this.state.duration || !this.state.bufferedPosition) return 0;
64
+
65
+ return this.state.bufferedPosition / this.state.duration;
66
+ }
67
+
68
+ }
69
+
70
+ module.exports = ProgressComponent;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @description
3
+ * Available event types that can be emitted from TrackPlayer.
4
+ */
5
+ const TrackPlayerEvents = {
6
+ REMOTE_PLAY_PAUSE: 'remote-play-pause',
7
+ REMOTE_PLAY: 'remote-play',
8
+ REMOTE_PLAY_ID: 'remote-play-id',
9
+ REMOTE_PLAY_SEARCH: 'remote-play-search',
10
+ REMOTE_PAUSE: 'remote-pause',
11
+ REMOTE_STOP: 'remote-stop',
12
+ REMOTE_SKIP: 'remote-skip',
13
+ REMOTE_PREVIOUS: 'remote-previous',
14
+ REMOTE_SEEK: 'remote-seek',
15
+ REMOTE_SET_RATING: 'remote-set-rating',
16
+ REMOTE_JUMP_FORWARD: 'remote-jump-forward',
17
+ REMOTE_JUMP_BACKWARD: 'remote-jump-backward',
18
+ REMOTE_DUCK: 'remote-duck',
19
+ REMOTE_LIKE: 'remote-like',
20
+ REMOTE_DISLIKE: 'remote-dislike',
21
+ REMOTE_BOOKMARK: 'remote-bookmark',
22
+ PLAYBACK_STATE: 'playback-state',
23
+ PLAYBACK_TRACK_CHANGED: 'playback-track-changed',
24
+ PLAYBACK_QUEUE_ENDED: 'playback-queue-ended',
25
+ PLAYBACK_ERROR: 'playback-error'
26
+ }
27
+
28
+ module.exports = TrackPlayerEvents