Skip to content

Commit

Permalink
chore(example): fix ci errors in the example project (#1885)
Browse files Browse the repository at this point in the history
* chore(example): fix ts linter errors in the example project

* chore(example): fix example project prettier errors

* chore(example): fix react-native-track-player typing path
  • Loading branch information
jspizziri authored Jan 24, 2023
1 parent 979f02c commit 11137d5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion example/src/components/PlayPauseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export const PlayPauseButton: React.FC<{
const isPaused = state === State.Paused;
const isStopped = state === State.Stopped;
const isEnded = state === State.Ended;
const showPause = playWhenReady && !(isErrored || isStopped || isPaused || isEnded);
const showPause =
playWhenReady && !(isErrored || isStopped || isPaused || isEnded);
const showBuffering = playWhenReady && isLoading;
return showBuffering ? (
<View style={styles.statusContainer}>
Expand Down
11 changes: 3 additions & 8 deletions example/src/services/PlaybackService.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import TrackPlayer, { Event } from 'react-native-track-player';

let wasPausedByDuck = false;

export async function PlaybackService() {
TrackPlayer.addEventListener(Event.RemotePause, () => {
console.log('Event.RemotePause');
Expand Down Expand Up @@ -38,12 +36,9 @@ export async function PlaybackService() {
TrackPlayer.seekTo(event.position);
});

TrackPlayer.addEventListener(
Event.RemoteDuck,
async (event) => {
console.log('Event.RemoteDuck', event);
}
);
TrackPlayer.addEventListener(Event.RemoteDuck, async (event) => {
console.log('Event.RemoteDuck', event);
});

TrackPlayer.addEventListener(Event.PlaybackQueueEnded, (event) => {
console.log('Event.PlaybackQueueEnded', event);
Expand Down
4 changes: 2 additions & 2 deletions example/src/services/SetupService.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import TrackPlayer, {
AppKilledPlaybackBehavior,
Capability,
RepeatMode
RepeatMode,
} from 'react-native-track-player';

export const SetupService = async (): Promise<boolean> => {
Expand All @@ -12,7 +12,7 @@ export const SetupService = async (): Promise<boolean> => {
isSetup = true;
} catch {
await TrackPlayer.setupPlayer({
autoHandleInterruptions: true
autoHandleInterruptions: true,
});
await TrackPlayer.updateOptions({
android: {
Expand Down
5 changes: 5 additions & 0 deletions example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"compilerOptions": {
"paths": {
"react-native-track-player": [
"../src/index.ts"
]
},
"allowJs": false,
"allowSyntheticDefaultImports": true,
"declaration": true,
Expand Down

0 comments on commit 11137d5

Please sign in to comment.