시작하기
이 플러그인의 설치 단계와 전체 markdown 가이드가 포함된 설정 프롬프트를 복사하세요.
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`
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.
설치
“설치” 섹션AI 지원 설정으로 플러그인을 설치할 수 있습니다. 다음 명령어로 AI 도구에 Capgo 스킬을 추가하세요:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins그다음 아래 prompt를 사용하세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-audio-session` plugin in my project.Manual Setup을 선호한다면, 다음 명령어를 실행하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르세요:
npm install @capgo/capacitor-audio-sessionnpx cap sync가져오기
“Import” 섹션import { AudioSession } from '@capgo/capacitor-audio-session';빠른 시작
“Quick start” 섹션import { AudioSession } from '@capgo/capacitor-audio-session';
await AudioSession.overrideOutput('speaker');자주 하는 실수
“자주 하는 실수” 섹션- iOS 포커스: 라우팅 API는 iOS audio session 동작을 대상으로 합니다.
- 복구: 호출
overrideOutput('default')통화가 종료된 후. - 정렬: Twilio 또는 미디어 플러그인이 시작되기 전에 설정하세요.
API 개요
“API 개요” 섹션currentOutputs
“currentOutputs” 섹션현재 활성화된 오디오 출력 경로를 가져옵니다.
Web 및 iOS가 아닌 플랫폼에서는 빈 배열이 반환됩니다.
import { AudioSession } from '@capgo/capacitor-audio-session';
const result = await AudioSession.currentOutputs();console.log(result);overrideOutput
“overrideOutput” 섹션현재 오디오 출력 경로를 재정의합니다.
사용하세요: speaker 내장 스피커로 재생을 강제하거나,
default 시스템이 선택한 경로로 복구하려면.
import { AudioSession } from '@capgo/capacitor-audio-session';
const result = await AudioSession.overrideOutput('default');console.log(result);타입 참조
“타입 레퍼런스” 섹션AudioSessionPorts
“AudioSessionPorts” 섹션iOS에서 사용 가능한 오디오 출력 경로.
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
“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
“InterruptionTypes” 섹션export enum InterruptionTypes { BEGAN = 'began', ENDED = 'ended',}기준 소스
“기준 소스” 섹션이 페이지는 플러그인의 src/definitions.ts에서 생성되었습니다. public API가 업스트림에서 변경되면 동기화를 다시 실행하세요.
Getting Started에서 계속하기
“Getting Started에서 계속하기”라는 제목의 섹션사용 중인 경우 시작하기 네이티브 미디어 및 인터페이스 동작을 설계하려면, 이를 다음 항목과 연결하세요 @capgo/capacitor-audio-session 사용하기 @capgo/capacitor-audio-session를 사용하여 네이티브 기능을 구현하려면, @capgo/capacitor-live-activities 사용하기 @capgo/capacitor-live-activities 사용하기의 네이티브 기능을 위해서는, @capgo/capacitor-live-activities @capgo/capacitor-live-activities의 구현 세부 사항에 대해서는, @capgo/capacitor-video-player 사용하기 @capgo/capacitor-video-player 사용하기의 네이티브 기능에 대해서는, 그리고 @capgo/capacitor-video-player @capgo/capacitor-video-player.의 구현 세부 사항에 대해서는