Getting Started
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함하는 설정 프롬프트 복사
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-audio-session`, `@capgo/capacitor-audiosession`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/audiosession/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
설치
설치 제목bun add @capgo/capacitor-audio-sessionbunx cap syncimport { AudioSession } from '@capgo/capacitor-audio-session';API 개요
API 개요currentOutputs
__CAPGO_KEEP_0__현재 활성 오디오 출력 경로를 가져옵니다.
웹 및 iOS가 아닌 플랫폼에서 이 값은 빈 배열로 반환됩니다.
import { AudioSession } from '@capgo/capacitor-audio-session';
await AudioSession.currentOutputs();overrideOutput
__CAPGO_KEEP_0__ 오디오 출력 경로를 재정의합니다.__CAPGO_KEEP_0__를 사용하여 내장 스피커를 통해 재생을 강제로 하거나
__CAPGO_KEEP_0__를 사용하여 내장 스피커를 통해 재생을 강제로 합니다. speaker __CAPGO_KEEP_0__를 사용하여 내장 스피커를 통해 재생을 강제로 합니다.
default __CAPGO_KEEP_0__
import { AudioSession } from '@capgo/capacitor-audio-session';
await AudioSession.overrideOutput({} as OutputOverrideType);__CAPGO_KEEP_2__
__CAPGO_KEEP_3__AudioSessionPorts
__CAPGO_KEEP_4____CAPGO_KEEP_5__
export enum AudioSessionPorts { AIR_PLAY = 'airplay', BLUETOOTH_LE = 'bluetooth-le', BLUETOOTH_HFP = 'bluetooth-hfp', BLUETOOTH_A2DP = 'bluetooth-a2dp', BUILT_IN_SPEAKER = 'builtin-speaker', BUILT_IN_RECEIVER = 'builtin-receiver', HDMI = 'hdmi', HEADPHONES = 'headphones', LINE_OUT = 'line-out',}OutputOverrideType
__CAPGO_KEEP_7____CAPGO_KEEP_8__ default__CAPGO_KEEP_9__ speaker__CAPGO_KEEP_10__
export type OutputOverrideType = 'default' | 'speaker';OverrideResult
OverrideResult출력 오버라이드 요청의 결과입니다.
export type OverrideResult = { success: boolean; message: string;};RouteChangeListener
RouteChangeListener오디오 루트가 변경될 때 호출되는 리스너입니다.
export type RouteChangeListener = (reason: RouteChangeReasons) => void;InterruptionListener
InterruptionListener오디오 세션의 중단 또는 종료 시 호출되는 리스너입니다.
export type InterruptionListener = (type: InterruptionTypes) => void;RouteChangeReasons
RouteChangeReasonsexport enum RouteChangeReasons { NEW_DEVICE_AVAILABLE = 'new-device-available', OLD_DEVICE_UNAVAILABLE = 'old-device-unavailable', CATEGORY_CHANGE = 'category-change', OVERRIDE = 'override', WAKE_FROM_SLEEP = 'wake-from-sleep', NO_SUITABLE_ROUTE_FOR_CATEGORY = 'no-suitable-route-for-category', ROUTE_CONFIGURATION_CHANGE = 'route-config-change', UNKNOWN = 'unknown',}InterruptionTypes
InterruptionTypesexport enum InterruptionTypes { BEGAN = 'began', ENDED = 'ended',}실질적인 출처
실질적인 출처이 페이지는 플러그인의 src/definitions.ts공개 API이 업스트림에서 변경될 때 다시 싱크를 실행하세요.
Getting Started에서 계속
Getting StartedGetting Started를 사용하여 Getting Started를 사용하여 Getting Started를 사용하여 Using @capgo/capacitor-audio-session @capgo/capacitor-audio-session Using @capgo/capacitor-live-activities for the native capability in Using @capgo/capacitor-live-activities, @capgo/capacitor-live-activities for the implementation detail in @capgo/capacitor-live-activities, Using @capgo/capacitor-video-player for the native capability in Using @capgo/capacitor-video-player, and @capgo/capacitor-video-player for the implementation detail in @capgo/capacitor-video-player.