Skip to content

Commit

Permalink
Fix AirPlay iosCategoryOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchdowney committed Apr 17, 2024
1 parent f773036 commit a58bae5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/services/playerAudioSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ import TrackPlayer, {
import { PV } from '../resources'
import { PVAudioPlayer } from './playerAudio'

const iosCategoryOptions = [
IOSCategoryOptions.AllowBluetoothA2DP,
IOSCategoryOptions.AllowBluetooth,
IOSCategoryOptions.AllowAirPlay
]

const setupPlayer = async (options: Parameters<typeof TrackPlayer.setupPlayer>[0]) => {
const setup = async () => {
try {
Expand All @@ -34,11 +40,7 @@ export const PlayerAudioSetupService = async () => {
waitForBuffer: true,
maxCacheSize: 1000000, // 1 GB from KB, this affects Android only I think.
iosCategoryMode: IOSCategoryMode.SpokenAudio,
iosCategoryOptions: [
IOSCategoryOptions.AllowBluetoothA2DP,
IOSCategoryOptions.AllowBluetooth,
IOSCategoryOptions.AllowAirPlay
],
iosCategoryOptions,
autoHandleInterruptions: Platform.OS === 'android'
// androidAudioContentType: AndroidAudioContentType.Speech
})
Expand Down Expand Up @@ -84,7 +86,8 @@ export const audioUpdateTrackPlayerCapabilities = async () => {
android: {
appKilledPlaybackBehavior
},
iosCategoryMode
iosCategoryMode,
iosCategoryOptions
}

// // HACK: android < 13 doesnt show forward/backward buttons in adnroid auto?
Expand Down

0 comments on commit a58bae5

Please sign in to comment.