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.
설치
설치 제목Capgo의 AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 스킬을 추가하려면 다음 명령어를 사용하세요:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins다음 명령어를 사용하세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-audio-session` plugin in my project.만약 Manual Setup을 선호한다면, 다음 명령어를 실행하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르시오:
bun add @capgo/capacitor-audio-sessionbunx cap syncImport
__CAPGO_KEEP_0__ 개요import { AudioSession } from '@capgo/capacitor-audio-session';API Overview
Section titled “API Overview”currentOutputs
웹 및 iOS 이외의 플랫폼에서 이 값은 빈 배열로 반환됩니다.복사
__CAPGO_KEEP_0__ 개요
import { AudioSession } from '@capgo/capacitor-audio-session';
await AudioSession.currentOutputs();overrideOutput
overrideOutput현재 오디오 출력 경로를 오버라이드합니다.
Use speaker built-in 스피커를 통해 재생하거나
default 시스템이 선택한 경로를 복원합니다.
import { AudioSession } from '@capgo/capacitor-audio-session';
await AudioSession.overrideOutput({} as OutputOverrideType);Type Reference
Type ReferenceAudioSessionPorts
AudioSessionPortsiOS에서 사용 가능한 오디오 출력 경로입니다.
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
OutputOverrideType출력 오버라이드 유형. - default: 시스템이 선택한 경로를 사용합니다. - speaker : 내장 스피커를 통해 재생을 강제합니다.
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
경로 변경 이유export 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
중단 유형export enum InterruptionTypes { BEGAN = 'began', ENDED = 'ended',}실질적인 원천
실질적인 원천이 페이지는 플러그인의 src/definitions.ts공개 API이 업스트림에서 변경될 때 다시 싱크를 실행하세요.
시작부터 계속
실질적인 원천만약 당신이 사용 중이라면 Getting Started native 미디어 및 인터페이스 동작을 계획하기 위해 연결하세요. Using @capgo/capacitor-audio-session for the native capability in Using @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.