__CAPGO_KEEP_1__
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 프롬프트를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-media-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/media-session/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-media-sessionbunx cap syncimport
설정 제목 “import”import { MediaSession } from '@capgo/capacitor-media-session';API 개요
설정 제목 “API 개요”setMetadata
설정 제목 “setMetadata”현재 재생 중인 미디어의 메타데이터를 설정합니다.
import { MediaSession } from '@capgo/capacitor-media-session';
await MediaSession.setMetadata({} as MetadataOptions);setPlaybackState
__CAPGO_KEEP_1__ (재생 상태 설정)__CAPGO_KEEP_2__ (미디어 세션의 재생 상태를 업데이트합니다.)
import { MediaSession } from '@capgo/capacitor-media-session';
await MediaSession.setPlaybackState({} as PlaybackStateOptions);setActionHandler
__CAPGO_KEEP_1__ (액션 핸들러 등록)__CAPGO_KEEP_2__ (미디어 세션 액션에 대한 핸들러를 등록합니다.)
import { MediaSession } from '@capgo/capacitor-media-session';
await MediaSession.setActionHandler({} as ActionHandlerOptions, {} as ActionHandler | null);setPositionState
__CAPGO_KEEP_1__ (재생 위치 상태 설정)__CAPGO_KEEP_2__ (활성 미디어 세션의 위치 상태를 업데이트합니다.)
import { MediaSession } from '@capgo/capacitor-media-session';
await MediaSession.setPositionState({} as PositionStateOptions);__CAPGO_KEEP_1__ (타입 참조)
__CAPGO_KEEP_2__ (타입 참조)MetadataOptions
MetadataOptions 섹션export interface MetadataOptions { album?: string; artist?: string; artwork?: MediaImage[]; title?: string;}PlaybackStateOptions
PlaybackStateOptions 섹션export interface PlaybackStateOptions { playbackState: MediaSessionPlaybackState;}ActionHandlerOptions
ActionHandlerOptions 섹션export interface ActionHandlerOptions { action: MediaSessionAction;}ActionHandler
ActionHandler 섹션export type ActionHandler = (details: ActionDetails) => void;PositionStateOptions
PositionStateOptions 섹션export interface PositionStateOptions { duration?: number; playbackRate?: number; position?: number;}MediaImage
MediaImage 섹션export interface MediaImage { src: string; sizes?: string; type?: string;}MediaSessionPlaybackState
미디어 세션 재생 상태export type MediaSessionPlaybackState = 'none' | 'paused' | 'playing';MediaSessionAction
미디어 세션 액션export type MediaSessionAction = | 'play' | 'pause' | 'seekbackward' | 'seekforward' | 'previoustrack' | 'nexttrack' | 'seekto' | 'stop';진실의 근원
진실의 근원이 페이지는 플러그인의 src/definitions.tsAPI이 업스트림에서 변경될 때 다시 싱크를 실행하세요.
시작부터 계속
시작부터 계속Capacitor를 사용 중이라면 시작부터 대시보드와 API 운영을 계획하고 연결하세요. Using @capgo/capacitor-media-session Using @capgo/capacitor-media-session API 개요 for the implementation detail in API Overview 소개 for the implementation detail in Introduction API 키 for the implementation detail in API Keys, and 기기 for the implementation detail in Devices.