expo-gliph-player 1.3.4 → 1.3.6
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.
- package/LICENSE +1 -1
- package/README.md +6 -6
- package/expo-gliph-player.podspec +10 -1
- package/ios/GliphAudioPlayer.swift +11 -0
- package/lib/commonjs/hooks.js +1 -1
- package/lib/commonjs/types.js +1 -1
- package/lib/module/hooks.js +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/types.js +1 -1
- package/lib/typescript/src/hooks.d.ts +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/types.d.ts +1 -1
- package/package.json +3 -4
- package/src/hooks.ts +1 -1
- package/src/index.ts +1 -1
- package/src/types.ts +1 -1
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2025
|
|
3
|
+
Copyright (c) 2025 expo-gliph-player contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -194,7 +194,7 @@ const styles = StyleSheet.create({
|
|
|
194
194
|
|
|
195
195
|
## 💻 Complete Integration
|
|
196
196
|
|
|
197
|
-
Let's put the pieces together. Using
|
|
197
|
+
Let's put the pieces together. Using expo-gliph-player requires two steps: initializing the background service, and then actually rendering your UI.
|
|
198
198
|
|
|
199
199
|
### Step 1: Setting up the Player
|
|
200
200
|
|
|
@@ -203,7 +203,7 @@ You should initialize the player as soon as your app mounts (usually in App.tsx)
|
|
|
203
203
|
```tsx
|
|
204
204
|
import React, { useEffect } from 'react';
|
|
205
205
|
import { Platform, PermissionsAndroid } from 'react-native';
|
|
206
|
-
import GliphPlayer, { Capability, AppKilledPlaybackBehavior } from '
|
|
206
|
+
import GliphPlayer, { Capability, AppKilledPlaybackBehavior } from 'expo-gliph-player';
|
|
207
207
|
|
|
208
208
|
const myTracks = [
|
|
209
209
|
{
|
|
@@ -262,7 +262,7 @@ Now that the player is initialized, you can control it from anywhere in your app
|
|
|
262
262
|
Building play, pause, next, and previous buttons is straightforward. All commands are async promises.
|
|
263
263
|
|
|
264
264
|
```tsx
|
|
265
|
-
import GliphPlayer from '
|
|
265
|
+
import GliphPlayer from 'expo-gliph-player';
|
|
266
266
|
import { TouchableOpacity, Text, View } from 'react-native';
|
|
267
267
|
|
|
268
268
|
export function PlayerControls() {
|
|
@@ -351,7 +351,7 @@ Instead of manually fetching state, Gliph Player ships with powerful React Hooks
|
|
|
351
351
|
The useIsPlaying() hook makes it incredibly easy to toggle a play/pause icon.
|
|
352
352
|
|
|
353
353
|
```tsx
|
|
354
|
-
import GliphPlayer, { useIsPlaying } from '
|
|
354
|
+
import GliphPlayer, { useIsPlaying } from 'expo-gliph-player';
|
|
355
355
|
import { TouchableOpacity, Text } from 'react-native';
|
|
356
356
|
|
|
357
357
|
export function PlayPauseButton() {
|
|
@@ -378,7 +378,7 @@ export function PlayPauseButton() {
|
|
|
378
378
|
The useProgress() hook returns the current position and duration. It updates automatically so your slider moves smoothly in real-time.
|
|
379
379
|
|
|
380
380
|
```tsx
|
|
381
|
-
import GliphPlayer, { useProgress } from '
|
|
381
|
+
import GliphPlayer, { useProgress } from 'expo-gliph-player';
|
|
382
382
|
import Slider from '@react-native-community/slider';
|
|
383
383
|
|
|
384
384
|
export function ProgressBar() {
|
|
@@ -403,7 +403,7 @@ export function ProgressBar() {
|
|
|
403
403
|
The useActiveTrack() hook returns the data for the song currently playing. It changes automatically when a song skips.
|
|
404
404
|
|
|
405
405
|
```tsx
|
|
406
|
-
import { useActiveTrack } from '
|
|
406
|
+
import { useActiveTrack } from 'expo-gliph-player';
|
|
407
407
|
import { View, Image, Text } from 'react-native';
|
|
408
408
|
|
|
409
409
|
export function NowPlaying() {
|
|
@@ -58,7 +58,16 @@ Pod::Spec.new do |s|
|
|
|
58
58
|
s.header_dir = "expo_gliph_player"
|
|
59
59
|
|
|
60
60
|
s.public_header_files = "ios/GliphAudioPlayer.h", "ios/expo_gliph_player.h"
|
|
61
|
-
s.private_header_files = "ios/GliphPlayerModule.h"
|
|
61
|
+
s.private_header_files = "ios/GliphPlayerModule.h"
|
|
62
|
+
|
|
63
|
+
# ios/GliphPlayer-Bridging-Header.h must not exist in this pod at all —
|
|
64
|
+
# CocoaPods auto-detects any file matching *-Bridging-Header.h in
|
|
65
|
+
# source_files and wires up SWIFT_OBJC_BRIDGING_HEADER for it
|
|
66
|
+
# automatically, regardless of whether it's listed here. Bridging headers
|
|
67
|
+
# are unsupported on framework targets in Xcode, and s.static_framework
|
|
68
|
+
# above makes this a framework target, so the file itself was deleted
|
|
69
|
+
# (see GliphAudioPlayer.swift's local RCTPromiseResolveBlock /
|
|
70
|
+
# RCTPromiseRejectBlock typealiases, which replace what it used to expose).
|
|
62
71
|
|
|
63
72
|
install_modules_dependencies(s)
|
|
64
73
|
|
|
@@ -6,6 +6,17 @@ import UIKit
|
|
|
6
6
|
|
|
7
7
|
public typealias EventEmitter = (String, [String: Any]?) -> Void
|
|
8
8
|
|
|
9
|
+
// React Native's promise block types, redeclared locally so this file has
|
|
10
|
+
// no dependency on a bridging header (`import <React/RCTBridgeModule.h>`).
|
|
11
|
+
// Bridging headers are unsupported on framework targets in Xcode, and this
|
|
12
|
+
// pod builds as a static_framework — so this file must never `import React`
|
|
13
|
+
// or rely on one being injected. These signatures are structurally
|
|
14
|
+
// identical to the real `RCTPromiseResolveBlock` / `RCTPromiseRejectBlock`
|
|
15
|
+
// (id -> Any?, NSString* -> String?, NSError* -> Error?), so the resulting
|
|
16
|
+
// @objc blocks are ABI-compatible with what GliphPlayerModule.mm expects.
|
|
17
|
+
public typealias RCTPromiseResolveBlock = (Any?) -> Void
|
|
18
|
+
public typealias RCTPromiseRejectBlock = (String?, String?, Error?) -> Void
|
|
19
|
+
|
|
9
20
|
// MARK: - GliphAudioPlayer
|
|
10
21
|
|
|
11
22
|
/**
|
package/lib/commonjs/hooks.js
CHANGED
|
@@ -16,7 +16,7 @@ var _GliphPlayer = _interopRequireDefault(require("./GliphPlayer"));
|
|
|
16
16
|
var _types = require("./types");
|
|
17
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
18
|
/**
|
|
19
|
-
* hooks.ts — React hooks for
|
|
19
|
+
* hooks.ts — React hooks for expo-gliph-player
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
// ─── useTrackPlayerEvents ─────────────────────────────────────────────────────
|
package/lib/commonjs/types.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.State = exports.RepeatMode = exports.RatingType = exports.PitchAlgorithm = exports.IOSCategoryOptions = exports.IOSCategoryMode = exports.IOSCategory = exports.Event = exports.Capability = exports.AppKilledPlaybackBehavior = exports.AndroidAudioUsage = exports.AndroidAudioContentType = void 0;
|
|
7
7
|
/**
|
|
8
|
-
* types.ts — Public TypeScript types for
|
|
8
|
+
* types.ts — Public TypeScript types for expo-gliph-player
|
|
9
9
|
*/
|
|
10
10
|
// ─── Track ───────────────────────────────────────────────────────────────────
|
|
11
11
|
// ─── Enums ───────────────────────────────────────────────────────────────────
|
package/lib/module/hooks.js
CHANGED
package/lib/module/index.js
CHANGED
package/lib/module/types.js
CHANGED
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "Aleksey Ostrikov",
|
|
5
5
|
"email": "alex303606@gmail.com"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.3.
|
|
7
|
+
"version": "1.3.6",
|
|
8
8
|
"description": "Fixed version of react-native-gliph-player with Expo compatibility",
|
|
9
9
|
"main": "app.plugin.js",
|
|
10
10
|
"module": "lib/module/index.js",
|
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
"react-native": ">=0.71.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@expo/config-plugins": ">=7.0.0"
|
|
31
|
-
"react-native-gliph-player": "^1.3.4"
|
|
30
|
+
"@expo/config-plugins": ">=7.0.0"
|
|
32
31
|
},
|
|
33
32
|
"files": [
|
|
34
33
|
"app.plugin.js",
|
|
@@ -48,4 +47,4 @@
|
|
|
48
47
|
"javaPackageName": "com.gliphplayer"
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
|
-
}
|
|
50
|
+
}
|
package/src/hooks.ts
CHANGED
package/src/index.ts
CHANGED
package/src/types.ts
CHANGED