Skip to main content
Version: Next

PlayerOptions

All parameters are optional. You also only need to specify the ones you want to update.

ParamTypeDescriptionAndroidiOS
minBuffernumberMinimum duration of media that the player will attempt to buffer in seconds.
maxBuffernumberMaximum duration of media that the player will attempt to buffer in seconds.
backBuffernumberDuration in seconds that should be kept in the buffer behind the current playhead time.
playBuffernumberDuration of media in seconds that must be buffered for playback to start or resume following a user action such as a seek.
maxCacheSizenumberMaximum cache size in kilobytes.
iosCategoryIOSCategoryAn IOSCategory. Sets on play().
iosCategoryModeIOSCategoryModeThe audio session mode, together with the audio session category, indicates to the system how you intend to use audio in your app. You can use a mode to configure the audio system for specific use cases such as video recording, voice or video chat, or audio analysis. Sets on play().
iosCategoryOptionsIOSCategoryOptions[]An array of IOSCategoryOptions. Sets on play().
waitForBufferbooleanIndicates whether the player should automatically delay playback in order to minimize stalling. Defaults to true. @deprecated This option has been nominated for removal in a future version of RNTP. If you have this set to true, you can safely remove this from the options. If you are setting this to false and have a reason for that, please post a comment in the following discussion: https://github.com/doublesymmetry/react-native-track-player/pull/1695 and describe why you are doing so.
autoUpdateMetadatabooleanIndicates whether the player should automatically update now playing metadata data in control center / notification. Defaults to true.
autoHandleInterruptionsbooleanIndicates whether the player should automatically handle audio interruptions. Defaults to false.
androidAudioContentTypebooleanThe audio content type indicates to the android system how you intend to use audio in your app. With autoHandleInterruptions: true and androidAudioContentType: AndroidAudioContentType.Speech, the audio will be paused during short interruptions, such as when a message arrives. Otherwise the playback volume is reduced while the notification is playing. Defaults to AndroidAudioContentType.Music