Skip to content

Commit

Permalink
chore(docs): update docs for v4.1.0 (#2277)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcvz authored Mar 25, 2024
1 parent 4ce34b7 commit 94dd1f0
Show file tree
Hide file tree
Showing 51 changed files with 2,535 additions and 126 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ jobs:
workflow:
- '.github/workflows/validate.yml'
js:
- '.node-version'
- '.eslintrc.js'
- '.prettierrc.js'
- 'package.json'
- 'tsconfig.json'
- 'yarn.lock'
- 'src/**'
- '**.json'
- '**.js'
- 'example/src/**'
- 'example/**.json'
- 'example/**.js'
Expand Down
253 changes: 129 additions & 124 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/versioned_docs/version-4.1/api/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "API Reference",
"position": 3
}
4 changes: 4 additions & 0 deletions docs/versioned_docs/version-4.1/api/constants/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Constants",
"position": 4
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
sidebar_position: 6
---

# App Killed Playback Behavior (android-only)

```ts
import { AppKilledPlaybackBehavior } from 'react-native-track-player';
```

## `ContinuePlayback` (default)

This option will continue playing audio in the background when the app is
removed from recents. The notification remains. This is the default.

## `PausePlayback`

This option will pause playing audio in the background when the app is removed
from recents. The notification remains and can be used to resume playback.

## `StopPlaybackAndRemoveNotification`

This option will stop playing audio in the background when the app is removed
from recents. The notification is removed and can't be used to resume playback.
Users would need to open the app again to start playing audio.
29 changes: 29 additions & 0 deletions docs/versioned_docs/version-4.1/api/constants/capability.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
sidebar_position: 2
---

# Capability

All Capability types are made available through the named export `Capability`:

```ts
import { Capability } from 'react-native-track-player';
```

| Name | Description |
|------|-------------|
| `Play` | Capability indicating the ability to play |
| `PlayFromId` | Capability indicating the ability to play from a track id (Required for Android Auto) |
| `PlayFromSearch` | Capability indicating the ability to play from a text/voice search (Required for Android Auto) |
| `Pause` | Capability indicating the ability to pause |
| `Stop` | Capability indicating the ability to stop (on iOS available only for tracks where `.isLiveStream` is `true`) |
| `SeekTo` | Capability indicating the ability to seek to a position in the timeline |
| `Skip` | Capability indicating the ability to skip to any song in the queue |
| `SkipToNext` | Capability indicating the ability to skip to the next track |
| `SkipToPrevious` | Capability indicating the ability to skip to the previous track |
| `SetRating` | Capability indicating the ability to set the rating value based on the rating type |
| `JumpForward` | Capability indicating the ability to jump forward by the amount of seconds specified in the options |
| `JumpBackward` | Capability indicating the ability to jump backward by the amount of seconds specified in the options |
| `Like` | (ios-only) Capability indicating the ability to like from control center |
| `Dislike` | (ios-only) Capability indicating the ability to dislike from control center |
| `Bookmark` | (ios-only) Capability indicating the ability to bookmark from control center |
67 changes: 67 additions & 0 deletions docs/versioned_docs/version-4.1/api/constants/ios-category-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
sidebar_position: 7
---

# iOS Category Mode (ios-only)

All iOS Category Mode types are made available through the named export `IOSCategoryMode`:

## `Default`

The default audio session mode.

[See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/1616579-default)

## `GameChat`

A mode that the GameKit framework sets on behalf of an application that
uses GameKit’s voice chat service.

[See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/1616511-gamechat)


## `Measurement`

A mode that indicates that your app is performing measurement of audio
input or output.

[See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/1616608-measurement)

## `MoviePlayback`

A mode that indicates that your app is playing back movie content.

[See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/1616623-movieplayback)

## `SpokenAudio`

A mode used for continuous spoken audio to pause the audio when another
app plays a short audio prompt.

[See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/1616510-spokenaudio)

## `VideoChat`

A mode that indicates that your app is engaging in online video conferencing.

[See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/1616590-videochat)

## `VideoRecording`

A mode that indicates that your app is recording a movie.

[See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/1616535-videorecording)

## `VoiceChat`

A mode that indicates that your app is performing two-way voice communication,
such as using Voice over Internet Protocol (VoIP).

[See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/1616455-voicechat)


## `VoicePrompt`

A mode that indicates that your app plays audio using text-to-speech.

[See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/2962803-voiceprompt)
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
sidebar_position: 8
---

# iOS Category Options (ios-only)

All iOS Category Options types are made available through the named export `IOSCategoryOptions`:

```ts
import { IOSCategoryOptions } from 'react-native-track-player';
```

## `MixWithOthers`

An option that indicates whether audio from this session mixes with audio
from active sessions in other audio apps.

[See the Apple Docs ](https://developer.apple.com/documentation/avfaudio/avaudiosession/categoryoptions/1616611-mixwithothers)

## `DuckOthers`

An option that reduces the volume of other audio sessions while audio from
this session plays.

[See the Apple Docs ](https://developer.apple.com/documentation/avfaudio/avaudiosession/categoryoptions/1616618-duckothers)

## `InterruptSpokenAudioAndMixWithOthers`

An option that determines whether to pause spoken audio content from other
sessions when your app plays its audio.

[See the Apple Docs ](https://developer.apple.com/documentation/avfaudio/avaudiosession/categoryoptions/1616534-interruptspokenaudioandmixwithot)

## `AllowBluetooth`

An option that determines whether Bluetooth hands-free devices appear as
available input routes.

[See the Apple Docs ](https://developer.apple.com/documentation/avfaudio/avaudiosession/categoryoptions/1616518-allowbluetooth)

## `AllowBluetoothA2DP`

An option that determines whether you can stream audio from this session
to Bluetooth devices that support the Advanced Audio Distribution Profile (A2DP).

[See the Apple Docs ](https://developer.apple.com/documentation/avfaudio/avaudiosession/categoryoptions/1771735-allowbluetootha2dp)

## `AllowAirPlay`

An option that determines whether you can stream audio from this session
to AirPlay devices.

[See the Apple Docs ](https://developer.apple.com/documentation/avfaudio/avaudiosession/categoryoptions/1771736-allowairplay)

## `DefaultToSpeaker`

An option that determines whether audio from the session defaults to the
built-in speaker instead of the receiver.

[See the Apple Docs ](https://developer.apple.com/documentation/avfaudio/avaudiosession/categoryoptions/1616462-defaulttospeaker)
52 changes: 52 additions & 0 deletions docs/versioned_docs/version-4.1/api/constants/ios-category.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
sidebar_position: 6
---

# iOS Category (ios-only)

All iOS Category types are made available through the named export `IOSCategory`:

```ts
import { IOSCategory } from 'react-native-track-player';
```

## `Playback`

The category for playing recorded music or other sounds that are central to the
successful use of your app.

[See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/category/1616509-playback)


## `PlayAndRecord`

The category for recording (input) and playback (output) of audio, such as for a
Voice over Internet Protocol (VoIP) app.

[See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/category/1616568-playandrecord)

## `MultiRoute`

The category for routing distinct streams of audio data to different output
devices at the same time.

[See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/category/1616484-multiroute)

## `Ambient`

The category for an app in which sound playback is nonprimary — that is, your
app also works with the sound turned off.

[See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/category/1616560-ambient)

## `SoloAmbient`

The default audio session category.

[See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/category/1616488-soloambient)

## `Record`

The category for recording audio while also silencing playback audio.

[See the Apple Docs](https://developer.apple.com/documentation/avfaudio/avaudiosession/category/1616451-record)
17 changes: 17 additions & 0 deletions docs/versioned_docs/version-4.1/api/constants/pitch-algorithm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
sidebar_position: 5
---

# Pitch Algorithm (ios-only)

All PitchAlgorithm types are made available through the named export `PitchAlgorithm`:

```ts
import { PitchAlgorithm } from 'react-native-track-player';
```

| Name | Description |
|------|-------------|
| `Linear` | An algorithm suitable for general use. |
| `Music` | An algorithm suitable for music. |
| `Voice` | An algorithm suitable for voice. |
20 changes: 20 additions & 0 deletions docs/versioned_docs/version-4.1/api/constants/rating.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
sidebar_position: 3
---

# Rating

All RatingType types are made available through the named export `RatingType`:

```ts
import { RatingType } from 'react-native-track-player';
```

| Name | Description |
|------|-------------|
| `Heart` | Rating type indicating "with heart" or "without heart", its value is a `boolean`. |
| `ThumbsUpDown` | Rating type indicating "thumbs up" or "thumbs down", its value is a `boolean`. |
| `ThreeStars` | Rating type indicating 0 to 3 stars, its value is a `number` of stars. |
| `FourStars` | Rating type indicating 0 to 4 stars, its value is a `number` of stars. |
| `FiveStars` | Rating type indicating 0 to 5 stars, its value is a `number` of stars. |
| `Percentage` | Rating type indicating percentage, its value is a `number`. |
17 changes: 17 additions & 0 deletions docs/versioned_docs/version-4.1/api/constants/repeat-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
sidebar_position: 4
---

# Repeat Mode

All RepeatMode types are made available through the named export `RepeatMode`:

```ts
import { RepeatMode } from 'react-native-track-player';
```

| Name | Description |
|------|-------------|
| `Off` | Doesn't repeat. |
| `Track` | Loops the current track. |
| `Queue` | Repeats the whole queue. |
24 changes: 24 additions & 0 deletions docs/versioned_docs/version-4.1/api/constants/state.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
sidebar_position: 1
---

# State

All State types are made available through the named export `State`:

```ts
import { State } from 'react-native-track-player';
```

| Name | Description |
|------|-------------|
| `None` | State indicating that no media is currently loaded |
| `Ready` | State indicates that the player is paused, but ready to start playing |
| `Playing` | State indicating that the player is currently playing |
| `Paused` | State indicating that the player is currently paused |
| `Stopped` | State indicating that the player is currently stopped |
| `Ended` | State indicates playback stopped due to the end of the queue being reached |
| `Buffering` | State indicating that the player is currently buffering (no matter whether playback is paused or not) |
| `Loading` | State indicating the initial loading phase of a track |
| `Error` | State indicating that the player experienced a playback error causing the audio to stop playing (or not start playing). When in `State.Error`, calling `play()` reloads the current track and seeks to its last known time. |
| `Connecting` | **⚠️ Deprecated**. Please use `State.Loading` instead. State indicating that the player is currently buffering (in "pause" state) |
Loading

0 comments on commit 94dd1f0

Please sign in to comment.