{"_id":"@dkaliinin505/capacitor-native-audio","_rev":"4-6aa7b503139cb713db2d6967ad958a35","name":"@dkaliinin505/capacitor-native-audio","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@dkaliinin505/capacitor-native-audio","version":"1.0.0","keywords":["capacitor","plugin","native","android","ios","audio"],"author":{"name":"bahus"},"license":"MIT","_id":"@dkaliinin505/capacitor-native-audio@1.0.0","maintainers":[{"name":"bahus","email":"dp101196@gmail.com"}],"homepage":"https://github.com/dkaliinin505/capacitor-native-audio#readme","bugs":{"url":"https://github.com/dkaliinin505/capacitor-native-audio/issues"},"dist":{"shasum":"081261784590a23647353c17ada7f32932c3ae7d","tarball":"https://registry.npmjs.org/@dkaliinin505/capacitor-native-audio/-/capacitor-native-audio-1.0.0.tgz","fileCount":37,"integrity":"sha512-5Uz71MVONeGHf5o58i1/LDJ209wvJMmN7nQ1u0QWjy2FvOTs7NQo56xiz/RPI+Nbb6ckM1m2hnp9WFd6yfJOog==","signatures":[{"sig":"MEYCIQDcRuQfqV38DQ6rKd8dc4TZlwsZkYv1JPAm9ygFwpyaagIhAJTshzsXxoP9EP3bdHKXY9KS7BbOLCTR5hrXRus8y0EN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":201528},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","gitHead":"a4cba50fd8934ff35eba31e8cb5bac8dc5b3bf05","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api AudioPlayerPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prepare":"npm run build","prettier":"prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java","swiftlint":"node-swiftlint","verify:ios":"xcodebuild -scheme DkaliniinCapacitorNativeAudio -destination generic/platform=iOS","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd .."},"_npmUser":{"name":"bahus","actor":{"name":"bahus","type":"user","email":"dp101196@gmail.com"},"email":"dp101196@gmail.com"},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/dkaliinin505/capacitor-native-audio.git","type":"git"},"_npmVersion":"10.8.1","description":"Play audio in a Capacitor app natively from a URL/web source simultaneously with background audio.","directories":{},"_nodeVersion":"20.16.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610","devDependencies":{"eslint":"^8.57.0","rimraf":"^6.0.1","rollup":"^4.30.1","prettier":"^3.4.2","swiftlint":"^2.0.0","typescript":"~4.1.5","@capacitor/ios":"^7.0.0","@capacitor/core":"^7.0.0","@capacitor/docgen":"^0.3.0","@capacitor/android":"^7.0.0","@ionic/eslint-config":"^0.4.0","prettier-plugin-java":"^2.6.6","@ionic/prettier-config":"^4.0.0","@ionic/swiftlint-config":"^2.0.0"},"peerDependencies":{"@capacitor/core":">=7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-native-audio_1.0.0_1750147744028_0.6717129625769374","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@dkaliinin505/capacitor-native-audio","version":"1.0.1","keywords":["capacitor","plugin","native","android","ios","audio"],"author":{"name":"bahus"},"license":"MIT","_id":"@dkaliinin505/capacitor-native-audio@1.0.1","maintainers":[{"name":"bahus","email":"dp101196@gmail.com"}],"homepage":"https://github.com/dkaliinin505/capacitor-native-audio#readme","bugs":{"url":"https://github.com/dkaliinin505/capacitor-native-audio/issues"},"dist":{"shasum":"b947291d2525e1707017fc6ba2f39a03dd389138","tarball":"https://registry.npmjs.org/@dkaliinin505/capacitor-native-audio/-/capacitor-native-audio-1.0.1.tgz","fileCount":37,"integrity":"sha512-FZf0VoQS4TwkSoQMojich6f+BjGe3gQMKdTCxtcuZdQmyGNGcU8csGomdhcONvh9dNyYMMeAgmhrUqukPNrRDg==","signatures":[{"sig":"MEUCIQCw8zme8+gN3DlYdaUY2BMk7uwDzmsad/WJ6ibS1BZy0AIgEGdpmgZ5j6RKyfjR3mMELzcNmEgcN5eiqtXfEC2fczA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":201541},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","gitHead":"ff5a95e37bf0381c820e51e67f7ce238fb4e4936","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api AudioPlayerPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prepare":"npm run build","prettier":"prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java","swiftlint":"node-swiftlint","verify:ios":"xcodebuild -scheme DkaliniinCapacitorNativeAudio -destination generic/platform=iOS","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd .."},"_npmUser":{"name":"bahus","actor":{"name":"bahus","type":"user","email":"dp101196@gmail.com"},"email":"dp101196@gmail.com"},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/dkaliinin505/capacitor-native-audio.git","type":"git"},"_npmVersion":"10.8.1","description":"Play audio in a Capacitor app natively from a URL/web source simultaneously with background audio.","directories":{},"_nodeVersion":"20.16.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610","devDependencies":{"eslint":"^8.57.0","rimraf":"^6.0.1","rollup":"^4.30.1","prettier":"^3.4.2","swiftlint":"^2.0.0","typescript":"~4.1.5","@capacitor/ios":"^7.0.0","@capacitor/core":"^7.0.0","@capacitor/docgen":"^0.3.0","@capacitor/android":"^7.0.0","@ionic/eslint-config":"^0.4.0","prettier-plugin-java":"^2.6.6","@ionic/prettier-config":"^4.0.0","@ionic/swiftlint-config":"^2.0.0"},"peerDependencies":{"@capacitor/core":">=7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-native-audio_1.0.1_1750148155603_0.6311227929317098","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@dkaliinin505/capacitor-native-audio","version":"1.0.2","keywords":["capacitor","plugin","native","android","ios","audio"],"author":{"name":"bahus"},"license":"MIT","_id":"@dkaliinin505/capacitor-native-audio@1.0.2","maintainers":[{"name":"bahus","email":"dp101196@gmail.com"}],"homepage":"https://github.com/dkaliinin505/capacitor-native-audio#readme","bugs":{"url":"https://github.com/dkaliinin505/capacitor-native-audio/issues"},"dist":{"shasum":"d95d7fa548ddefd9c513941b7151c83250cae7d6","tarball":"https://registry.npmjs.org/@dkaliinin505/capacitor-native-audio/-/capacitor-native-audio-1.0.2.tgz","fileCount":37,"integrity":"sha512-vf66uCZod6OIWbaWZqmSui6AXvR9OfkLU58TjRyf3MKzobdqzamr4RuzvsfOTacjpF+ibtmdvYrOv4fBOpX7dQ==","signatures":[{"sig":"MEYCIQChh+tIsYRfpNHRi+OtYEqsIQwoq/e06kKNmmmEbc6ggQIhAJXMwhq9Pj2v1lPCF8Guf9g/zpOVyxRxxKa0xR/u/vM3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":201574},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","gitHead":"a3c5544d834174a393eea79a7ed86387aaeaff5e","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api AudioPlayerPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint . --ext ts","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","prepare":"npm run build","prettier":"prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java","swiftlint":"node-swiftlint","verify:ios":"xcodebuild -scheme DkaliniinCapacitorNativeAudio -destination generic/platform=iOS","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd .."},"_npmUser":{"name":"bahus","actor":{"name":"bahus","type":"user","email":"dp101196@gmail.com"},"email":"dp101196@gmail.com"},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/dkaliinin505/capacitor-native-audio.git","type":"git"},"_npmVersion":"10.8.1","description":"Play audio in a Capacitor app natively from a URL/web source simultaneously with background audio.","directories":{},"_nodeVersion":"20.16.0","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610","devDependencies":{"eslint":"^8.57.0","rimraf":"^6.0.1","rollup":"^4.30.1","prettier":"^3.4.2","swiftlint":"^2.0.0","typescript":"~4.1.5","@capacitor/ios":"^7.0.0","@capacitor/core":"^7.0.0","@capacitor/docgen":"^0.3.0","@capacitor/android":"^7.0.0","@ionic/eslint-config":"^0.4.0","prettier-plugin-java":"^2.6.6","@ionic/prettier-config":"^4.0.0","@ionic/swiftlint-config":"^2.0.0"},"peerDependencies":{"@capacitor/core":">=7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-native-audio_1.0.2_1750154951499_0.9871197497922333","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@dkaliinin505/capacitor-native-audio","version":"1.0.3","description":"Play audio in a Capacitor app natively from a URL/web source simultaneously with background audio.","main":"dist/plugin.cjs.js","module":"dist/esm/index.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","author":{"name":"bahus"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/dkaliinin505/capacitor-native-audio.git"},"bugs":{"url":"https://github.com/dkaliinin505/capacitor-native-audio/issues"},"homepage":"https://github.com/dkaliinin505/capacitor-native-audio#readme","keywords":["capacitor","plugin","native","android","ios","audio"],"scripts":{"verify":"npm run verify:ios && npm run verify:android && npm run verify:web","verify:ios":"xcodebuild -scheme DkaliniinCapacitorNativeAudio -destination generic/platform=iOS","verify:android":"cd android && ./gradlew clean build test && cd ..","verify:web":"npm run build","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","eslint":"eslint . --ext ts","prettier":"prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java","swiftlint":"node-swiftlint","docgen":"docgen --api AudioPlayerPlugin --output-readme README.md --output-json dist/docs.json","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","prepare":"npm run build","prepublishOnly":"npm run build"},"devDependencies":{"@capacitor/android":"^7.0.0","@capacitor/core":"^7.0.0","@capacitor/docgen":"^0.3.0","@capacitor/ios":"^7.0.0","@ionic/eslint-config":"^0.4.0","@ionic/prettier-config":"^4.0.0","@ionic/swiftlint-config":"^2.0.0","eslint":"^8.57.0","prettier":"^3.4.2","prettier-plugin-java":"^2.6.6","rimraf":"^6.0.1","rollup":"^4.30.1","swiftlint":"^2.0.0","typescript":"~4.1.5"},"peerDependencies":{"@capacitor/core":">=7.0.0"},"swiftlint":"@ionic/swiftlint-config","eslintConfig":{"extends":"@ionic/eslint-config/recommended"},"capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"packageManager":"yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610","_id":"@dkaliinin505/capacitor-native-audio@1.0.3","gitHead":"c9e2a6f53b76fc95680ca1d75be01d2c17a20330","_nodeVersion":"20.16.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-bT6vZ2aigOKfdox/o+27cnEHFlNcP7SqyEZmMnBDV9p81uSNJx1Y//Dj+s/4LCdJYAPSTbA/fRSsy8m7YoCyqA==","shasum":"a47d904ab51a7a2c0f7a907b089ff1ae0cc2b1f7","tarball":"https://registry.npmjs.org/@dkaliinin505/capacitor-native-audio/-/capacitor-native-audio-1.0.3.tgz","fileCount":37,"unpackedSize":209767,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFU9fxTX+vlt1KgQeuN5IeLJlMRFCY2Lh3kX4GPMhjkMAiA0vGY275RUtTp2POLHKA5lwxPPFvU60neHu/XP26FxGQ=="}]},"_npmUser":{"name":"bahus","email":"dp101196@gmail.com","actor":{"name":"bahus","email":"dp101196@gmail.com","type":"user"}},"directories":{},"maintainers":[{"name":"bahus","email":"dp101196@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/capacitor-native-audio_1.0.3_1750156856585_0.5976434915612416"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-17T08:09:03.631Z","modified":"2025-06-17T10:40:56.970Z","1.0.0":"2025-06-17T08:09:04.187Z","1.0.1":"2025-06-17T08:15:55.781Z","1.0.2":"2025-06-17T10:09:11.674Z","1.0.3":"2025-06-17T10:40:56.763Z"},"bugs":{"url":"https://github.com/dkaliinin505/capacitor-native-audio/issues"},"author":{"name":"bahus"},"license":"MIT","homepage":"https://github.com/dkaliinin505/capacitor-native-audio#readme","keywords":["capacitor","plugin","native","android","ios","audio"],"repository":{"type":"git","url":"git+https://github.com/dkaliinin505/capacitor-native-audio.git"},"description":"Play audio in a Capacitor app natively from a URL/web source simultaneously with background audio.","maintainers":[{"name":"bahus","email":"dp101196@gmail.com"}],"readme":"# @mediagrid/capacitor-native-audio\n\n## Description\n\nPlay audio in a Capacitor app natively (Android/iOS) from a URL/web source simultaneously with background audio. Also supports background playing with an OS notification.\n\n## Install\n\n```bash\nnpm install @dkaliinin505/capacitor-native-audio\nnpx cap sync\n```\n\n## Android\n\n### `AndroidManifest.xml` required changes\n\nLocated at `android/app/src/main/AndroidManifest.xml`\n\n```xml\n<application>\n    <!-- OTHER STUFF -->\n\n    <!-- Add service to be used for background play -->\n    <service\n        android:name=\"us.mediagrid.capacitorjs.plugins.nativeaudio.AudioPlayerService\"\n        android:description=\"@string/audio_player_service_description\"\n        android:foregroundServiceType=\"mediaPlayback\"\n        android:exported=\"true\">\n        <intent-filter>\n            <action android:name=\"androidx.media3.session.MediaSessionService\"/>\n        </intent-filter>\n    </service>\n\n    <!-- OTHER STUFF -->\n</application>\n\n<!-- Add required permissions -->\n<uses-permission android:name=\"android.permission.FOREGROUND_SERVICE\"/>\n<uses-permission android:name=\"android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK\" />\n<uses-permission android:name=\"android.permission.WAKE_LOCK\" />\n```\n\n### `strings.xml` required changes\n\nLocated at `android/app/src/main/res/values/strings.xml`\n\n```xml\n<resources>\n    <!-- OTHER STUFF -->\n\n    <!-- Describes the service in your app settings once installed -->\n    <string name=\"audio_player_service_description\">Allows for audio to play in the background.</string>\n</resources>\n```\n\n# iOS\n\n## Enable Audio Background Mode\n\nThis can be done in XCode or by editing `Info.plist` directly.\n\n```xml\n<!-- ios/App/App/Info.plist -->\n\n<dict>\n    <!-- OTHER STUFF -->\n\n    <key>UIBackgroundModes</key>\n    <array>\n        <string>audio</string>\n    </array>\n\n    <!-- OTHER STUFF -->\n</dict>\n```\n\n## Add Now Playing Icon (optional) - DEPRECATED\n\n⚠️⚠️ This is DEPRECATED. Use `artworkSource` now. ⚠️⚠️\n\nIf you would like a now playing icon to show in the iOS notification, add an image with the name `NowPlayingIcon` to your Asset catalog. See [Managing assets with asset catalogs](https://developer.apple.com/documentation/xcode/managing-assets-with-asset-catalogs) on how to add a new asset.\n\nA PNG is recommended with the size of 1024 x 1024px. The same image can be used for the three different Asset wells (1x, 2x, 3x).\n\n# API\n\n<docgen-index>\n\n* [`create(...)`](#create)\n* [`initialize(...)`](#initialize)\n* [`changeAudioSource(...)`](#changeaudiosource)\n* [`changeMetadata(...)`](#changemetadata)\n* [`getDuration(...)`](#getduration)\n* [`getCurrentTime(...)`](#getcurrenttime)\n* [`play(...)`](#play)\n* [`pause(...)`](#pause)\n* [`seek(...)`](#seek)\n* [`stop(...)`](#stop)\n* [`setVolume(...)`](#setvolume)\n* [`setRate(...)`](#setrate)\n* [`isPlaying(...)`](#isplaying)\n* [`destroy(...)`](#destroy)\n* [`onAppGainsFocus(...)`](#onappgainsfocus)\n* [`onAppLosesFocus(...)`](#onapplosesfocus)\n* [`onAudioReady(...)`](#onaudioready)\n* [`onAudioEnd(...)`](#onaudioend)\n* [`onPlaybackStatusChange(...)`](#onplaybackstatuschange)\n* [`onPlayNext(...)`](#onplaynext)\n* [`onPlayPrevious(...)`](#onplayprevious)\n* [`onAudioStalled(...)`](#onaudiostalled)\n* [Interfaces](#interfaces)\n\n</docgen-index>\n\n<docgen-api>\n<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->\n\n### create(...)\n\n```typescript\ncreate(params: AudioPlayerPrepareParams) => Promise<{ success: boolean; }>\n```\n\nCreate an audio source to be played.\n\n| Param        | Type                                                                          |\n| ------------ | ----------------------------------------------------------------------------- |\n| **`params`** | <code><a href=\"#audioplayerprepareparams\">AudioPlayerPrepareParams</a></code> |\n\n**Returns:** <code>Promise&lt;{ success: boolean; }&gt;</code>\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### initialize(...)\n\n```typescript\ninitialize(params: AudioPlayerDefaultParams) => Promise<{ success: boolean; }>\n```\n\nInitialize the audio source. Prepares the audio to be played, buffers and such.\n\nShould be called after callbacks are registered (e.g. `onAudioReady`).\n\n| Param        | Type                                                                          |\n| ------------ | ----------------------------------------------------------------------------- |\n| **`params`** | <code><a href=\"#audioplayerdefaultparams\">AudioPlayerDefaultParams</a></code> |\n\n**Returns:** <code>Promise&lt;{ success: boolean; }&gt;</code>\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### changeAudioSource(...)\n\n```typescript\nchangeAudioSource(params: AudioPlayerDefaultParams & { source: string; }) => Promise<void>\n```\n\nChange the audio source on an existing audio source (`audioId`).\n\nThis is useful for changing background music while the primary audio is playing\nor changing the primary audio before it is playing to accommodate different durations\nthat a user can choose from.\n\n| Param        | Type                                                                                                |\n| ------------ | --------------------------------------------------------------------------------------------------- |\n| **`params`** | <code><a href=\"#audioplayerdefaultparams\">AudioPlayerDefaultParams</a> & { source: string; }</code> |\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### changeMetadata(...)\n\n```typescript\nchangeMetadata(params: AudioPlayerDefaultParams & { albumTitle?: string; artistName?: string; friendlyTitle?: string; artworkSource?: string; }) => Promise<void>\n```\n\nChange the associated metadata of an existing audio source\n\n| Param        | Type                                                                                                                                                                          |\n| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **`params`** | <code><a href=\"#audioplayerdefaultparams\">AudioPlayerDefaultParams</a> & { albumTitle?: string; artistName?: string; friendlyTitle?: string; artworkSource?: string; }</code> |\n\n**Since:** 1.1.0\n\n--------------------\n\n\n### getDuration(...)\n\n```typescript\ngetDuration(params: AudioPlayerDefaultParams) => Promise<{ duration: number; }>\n```\n\nGet the duration of the audio source.\n\nShould be called once the audio is ready (`onAudioReady`).\n\n| Param        | Type                                                                          |\n| ------------ | ----------------------------------------------------------------------------- |\n| **`params`** | <code><a href=\"#audioplayerdefaultparams\">AudioPlayerDefaultParams</a></code> |\n\n**Returns:** <code>Promise&lt;{ duration: number; }&gt;</code>\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### getCurrentTime(...)\n\n```typescript\ngetCurrentTime(params: AudioPlayerDefaultParams) => Promise<{ currentTime: number; }>\n```\n\nGet the current time of the audio source being played.\n\n| Param        | Type                                                                          |\n| ------------ | ----------------------------------------------------------------------------- |\n| **`params`** | <code><a href=\"#audioplayerdefaultparams\">AudioPlayerDefaultParams</a></code> |\n\n**Returns:** <code>Promise&lt;{ currentTime: number; }&gt;</code>\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### play(...)\n\n```typescript\nplay(params: AudioPlayerDefaultParams) => Promise<void>\n```\n\nPlay the audio source.\n\n| Param        | Type                                                                          |\n| ------------ | ----------------------------------------------------------------------------- |\n| **`params`** | <code><a href=\"#audioplayerdefaultparams\">AudioPlayerDefaultParams</a></code> |\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### pause(...)\n\n```typescript\npause(params: AudioPlayerDefaultParams) => Promise<void>\n```\n\nPause the audio source.\n\n| Param        | Type                                                                          |\n| ------------ | ----------------------------------------------------------------------------- |\n| **`params`** | <code><a href=\"#audioplayerdefaultparams\">AudioPlayerDefaultParams</a></code> |\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### seek(...)\n\n```typescript\nseek(params: AudioPlayerDefaultParams & { timeInSeconds: number; }) => Promise<void>\n```\n\nSeek the audio source to a specific time.\n\n| Param        | Type                                                                                                       |\n| ------------ | ---------------------------------------------------------------------------------------------------------- |\n| **`params`** | <code><a href=\"#audioplayerdefaultparams\">AudioPlayerDefaultParams</a> & { timeInSeconds: number; }</code> |\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### stop(...)\n\n```typescript\nstop(params: AudioPlayerDefaultParams) => Promise<void>\n```\n\nStop playing the audio source and reset the current time to zero.\n\n| Param        | Type                                                                          |\n| ------------ | ----------------------------------------------------------------------------- |\n| **`params`** | <code><a href=\"#audioplayerdefaultparams\">AudioPlayerDefaultParams</a></code> |\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### setVolume(...)\n\n```typescript\nsetVolume(params: AudioPlayerDefaultParams & { volume: number; }) => Promise<void>\n```\n\nSet the volume of the audio source. Should be a decimal less than or equal to `1.00`.\n\nThis is useful for background music.\n\n| Param        | Type                                                                                                |\n| ------------ | --------------------------------------------------------------------------------------------------- |\n| **`params`** | <code><a href=\"#audioplayerdefaultparams\">AudioPlayerDefaultParams</a> & { volume: number; }</code> |\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### setRate(...)\n\n```typescript\nsetRate(params: AudioPlayerDefaultParams & { rate: number; }) => Promise<void>\n```\n\nSet the rate for the audio source to be played at.\nShould be a decimal. An example being `1` is normal speed, `0.5` being half the speed and `1.5` being 1.5 times faster.\n\n| Param        | Type                                                                                              |\n| ------------ | ------------------------------------------------------------------------------------------------- |\n| **`params`** | <code><a href=\"#audioplayerdefaultparams\">AudioPlayerDefaultParams</a> & { rate: number; }</code> |\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### isPlaying(...)\n\n```typescript\nisPlaying(params: AudioPlayerDefaultParams) => Promise<{ isPlaying: boolean; }>\n```\n\nWether or not the audio source is currently playing.\n\n| Param        | Type                                                                          |\n| ------------ | ----------------------------------------------------------------------------- |\n| **`params`** | <code><a href=\"#audioplayerdefaultparams\">AudioPlayerDefaultParams</a></code> |\n\n**Returns:** <code>Promise&lt;{ isPlaying: boolean; }&gt;</code>\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### destroy(...)\n\n```typescript\ndestroy(params: AudioPlayerDefaultParams) => Promise<void>\n```\n\nDestroy all resources for the audio source.\nThe audio source with `useForNotification = true` must be destroyed last.\n\n| Param        | Type                                                                          |\n| ------------ | ----------------------------------------------------------------------------- |\n| **`params`** | <code><a href=\"#audioplayerdefaultparams\">AudioPlayerDefaultParams</a></code> |\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### onAppGainsFocus(...)\n\n```typescript\nonAppGainsFocus(params: AudioPlayerListenerParams, callback: () => void) => Promise<AudioPlayerListenerResult>\n```\n\nRegister a callback for when the app comes to the foreground.\n\n| Param          | Type                                                                            |\n| -------------- | ------------------------------------------------------------------------------- |\n| **`params`**   | <code><a href=\"#audioplayerlistenerparams\">AudioPlayerListenerParams</a></code> |\n| **`callback`** | <code>() =&gt; void</code>                                                      |\n\n**Returns:** <code>Promise&lt;<a href=\"#audioplayerlistenerresult\">AudioPlayerListenerResult</a>&gt;</code>\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### onAppLosesFocus(...)\n\n```typescript\nonAppLosesFocus(params: AudioPlayerListenerParams, callback: () => void) => Promise<AudioPlayerListenerResult>\n```\n\nRegisters a callback from when the app goes to the background.\n\n| Param          | Type                                                                            |\n| -------------- | ------------------------------------------------------------------------------- |\n| **`params`**   | <code><a href=\"#audioplayerlistenerparams\">AudioPlayerListenerParams</a></code> |\n| **`callback`** | <code>() =&gt; void</code>                                                      |\n\n**Returns:** <code>Promise&lt;<a href=\"#audioplayerlistenerresult\">AudioPlayerListenerResult</a>&gt;</code>\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### onAudioReady(...)\n\n```typescript\nonAudioReady(params: AudioPlayerListenerParams, callback: () => void) => Promise<AudioPlayerListenerResult>\n```\n\nRegisters a callback for when the audio source is ready to be played.\n\n| Param          | Type                                                                            |\n| -------------- | ------------------------------------------------------------------------------- |\n| **`params`**   | <code><a href=\"#audioplayerlistenerparams\">AudioPlayerListenerParams</a></code> |\n| **`callback`** | <code>() =&gt; void</code>                                                      |\n\n**Returns:** <code>Promise&lt;<a href=\"#audioplayerlistenerresult\">AudioPlayerListenerResult</a>&gt;</code>\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### onAudioEnd(...)\n\n```typescript\nonAudioEnd(params: AudioPlayerListenerParams, callback: () => void) => Promise<AudioPlayerListenerResult>\n```\n\nRegisters a callback for when the audio source has ended (reached the end of the audio).\n\n| Param          | Type                                                                            |\n| -------------- | ------------------------------------------------------------------------------- |\n| **`params`**   | <code><a href=\"#audioplayerlistenerparams\">AudioPlayerListenerParams</a></code> |\n| **`callback`** | <code>() =&gt; void</code>                                                      |\n\n**Returns:** <code>Promise&lt;<a href=\"#audioplayerlistenerresult\">AudioPlayerListenerResult</a>&gt;</code>\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### onPlaybackStatusChange(...)\n\n```typescript\nonPlaybackStatusChange(params: AudioPlayerListenerParams, callback: (result: { status: 'playing' | 'paused' | 'stopped'; }) => void) => Promise<AudioPlayerListenerResult>\n```\n\nRegisters a callback for when state of playback for the audio source has changed.\nThis should be used to update the UI when the notification controls are used to control the playback.\n\n| Param          | Type                                                                              |\n| -------------- | --------------------------------------------------------------------------------- |\n| **`params`**   | <code><a href=\"#audioplayerlistenerparams\">AudioPlayerListenerParams</a></code>   |\n| **`callback`** | <code>(result: { status: 'playing' \\| 'paused' \\| 'stopped'; }) =&gt; void</code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#audioplayerlistenerresult\">AudioPlayerListenerResult</a>&gt;</code>\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### onPlayNext(...)\n\n```typescript\nonPlayNext(params: { audioId: string; }, callback: () => void) => Promise<{ callbackId: string; }>\n```\n\n| Param          | Type                              |\n| -------------- | --------------------------------- |\n| **`params`**   | <code>{ audioId: string; }</code> |\n| **`callback`** | <code>() =&gt; void</code>        |\n\n**Returns:** <code>Promise&lt;{ callbackId: string; }&gt;</code>\n\n--------------------\n\n\n### onPlayPrevious(...)\n\n```typescript\nonPlayPrevious(params: { audioId: string; }, callback: () => void) => Promise<{ callbackId: string; }>\n```\n\n| Param          | Type                              |\n| -------------- | --------------------------------- |\n| **`params`**   | <code>{ audioId: string; }</code> |\n| **`callback`** | <code>() =&gt; void</code>        |\n\n**Returns:** <code>Promise&lt;{ callbackId: string; }&gt;</code>\n\n--------------------\n\n\n### onAudioStalled(...)\n\n```typescript\nonAudioStalled(params: AudioPlayerListenerParams, callback: (result: { reason: 'playback_stalled' | 'buffer_empty' | 'stall_resolved' | 'likely_to_keep_up'; currentTime: number; duration: number; networkAvailable: boolean; bufferEmpty?: boolean; likelyToKeepUp?: boolean; }) => void) => Promise<AudioPlayerListenerResult>\n```\n\nRegisters a callback for when the audio source playback is stalled.\nThis can happen due to network issues, buffering problems, or other playback interruptions.\n\n| Param          | Type                                                                                                                                                                                                                                              |\n| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **`params`**   | <code><a href=\"#audioplayerlistenerparams\">AudioPlayerListenerParams</a></code>                                                                                                                                                                   |\n| **`callback`** | <code>(result: { reason: 'playback_stalled' \\| 'buffer_empty' \\| 'stall_resolved' \\| 'likely_to_keep_up'; currentTime: number; duration: number; networkAvailable: boolean; bufferEmpty?: boolean; likelyToKeepUp?: boolean; }) =&gt; void</code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#audioplayerlistenerresult\">AudioPlayerListenerResult</a>&gt;</code>\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### Interfaces\n\n\n#### AudioPlayerPrepareParams\n\n| Prop                     | Type                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Default            | Since |\n| ------------------------ | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- |\n| **`audioSource`**        | <code>string</code>  | A URI for the audio file to play                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |                    | 1.0.0 |\n| **`albumTitle`**         | <code>string</code>  | The album title/name of the audio file to be used on the notification                                                                                                                                                                                                                                                                                                                                                                                                                                    |                    | 2.1.0 |\n| **`artistName`**         | <code>string</code>  | The artist name of the audio file to be used on the notification                                                                                                                                                                                                                                                                                                                                                                                                                                         |                    | 2.1.0 |\n| **`friendlyTitle`**      | <code>string</code>  | The title/name of the audio file to be used on the notification                                                                                                                                                                                                                                                                                                                                                                                                                                          |                    | 1.0.0 |\n| **`useForNotification`** | <code>boolean</code> | Whether to use this audio file for the notification. This is considered the primary audio to play. It must be created first and you may only have one at a time.                                                                                                                                                                                                                                                                                                                                         | <code>false</code> | 1.0.0 |\n| **`artworkSource`**      | <code>string</code>  | A URI for the album art image to display on the Android/iOS notification. Can also be an in-app source. Pulls from `android/app/src/assets/public` and `ios/App/App/public`. If using [Vite](https://vitejs.dev/guide/assets.html#the-public-directory), you would put the image in your `public` folder and the build process will copy to `dist` which in turn will be copied to the Android/iOS assets by Capacitor. A PNG is the best option with square dimensions. 1200 x 1200px is a good option. |                    | 1.0.0 |\n| **`isBackgroundMusic`**  | <code>boolean</code> | Is this audio for background music/audio. Should not be `true` when `useForNotification = true`.                                                                                                                                                                                                                                                                                                                                                                                                         | <code>false</code> | 1.0.0 |\n| **`loop`**               | <code>boolean</code> | Whether or not to loop other audio like background music while the primary audio (`useForNotification = true`) is playing.                                                                                                                                                                                                                                                                                                                                                                               | <code>false</code> | 1.0.0 |\n| **`showSeekBackward`**   | <code>boolean</code> | Whether or not to show the seek backward button on the OS's notification. Only has affect when `useForNotification = true`.                                                                                                                                                                                                                                                                                                                                                                              | <code>true</code>  | 1.2.0 |\n| **`showSeekForward`**    | <code>boolean</code> | Whether or not to show the seek forward button on the OS's notification. Only has affect when `useForNotification = true`.                                                                                                                                                                                                                                                                                                                                                                               | <code>true</code>  | 1.2.0 |\n\n\n#### AudioPlayerDefaultParams\n\n| Prop          | Type                | Description                                        | Since |\n| ------------- | ------------------- | -------------------------------------------------- | ----- |\n| **`audioId`** | <code>string</code> | Any string to differentiate different audio files. | 1.0.0 |\n\n\n#### AudioPlayerListenerResult\n\n| Prop             | Type                |\n| ---------------- | ------------------- |\n| **`callbackId`** | <code>string</code> |\n\n\n#### AudioPlayerListenerParams\n\n| Prop          | Type                | Description                                 | Since |\n| ------------- | ------------------- | ------------------------------------------- | ----- |\n| **`audioId`** | <code>string</code> | The `audioId` set when `create` was called. | 1.0.0 |\n\n</docgen-api>\n","readmeFilename":"README.md"}