开始使用
复制一个包含安装步骤和本插件的完整 Markdown 指南的设置提示。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-ricoh360`
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/ricoh360-camera/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 助手设置来安装插件。将 Capgo 能力添加到您的 AI 工具中,使用以下命令:
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-ricoh360` plugin in my project.如果您更喜欢手动设置,请运行以下命令安装插件,并按照以下平台特定的说明进行操作:
npm install @capgo/capacitor-ricoh360npx cap sync导入
导入import { Ricoh360Camera } from '@capgo/capacitor-ricoh360';API概述
导入API概述每个示例都重复导入,以便可以单独复制代码片段。
initialize
初始化初始化SDK并使用相机URL
import { Ricoh360Camera } from '@capgo/capacitor-ricoh360';
const result = await Ricoh360Camera.initialize({ url: 'https://example.com' });console.log(result);getCameraAsset
获取相机资产从 URL 中检索并返回相机资产的 base64 表示
import { Ricoh360Camera } from '@capgo/capacitor-ricoh360';
const result = await Ricoh360Camera.getCameraAsset({ url: 'https://example.com' });console.log(result);listFiles
列表文件列出存储在相机中的文件
import { Ricoh360Camera } from '@capgo/capacitor-ricoh360';
const result = await Ricoh360Camera.listFiles();console.log(result);capturePicture
capturePicture捕获照片
import { Ricoh360Camera } from '@capgo/capacitor-ricoh360';
const result = await Ricoh360Camera.capturePicture();console.log(result);captureVideo
captureVideo捕获视频
import { Ricoh360Camera } from '@capgo/capacitor-ricoh360';
const result = await Ricoh360Camera.captureVideo({ resolution: '4K', frameRate: 1, bitrate: 1,});console.log(result);livePreview
Section titled “实时预览”开始实时预览
import { Ricoh360Camera } from '@capgo/capacitor-ricoh360';
const result = await Ricoh360Camera.livePreview({ displayInFront: false, cropPreview: false,});console.log(result);stopLivePreview
Section titled “停止实时预览”停止实时预览
import { Ricoh360Camera } from '@capgo/capacitor-ricoh360';
const result = await Ricoh360Camera.stopLivePreview();console.log(result);readSettings
Section titled “读取设置”读取相机设置
import { Ricoh360Camera } from '@capgo/capacitor-ricoh360';
const result = await Ricoh360Camera.readSettings({ options: ['option'] });console.log(result);setSettings
Section titled “设置设置”设置相机设置
import { Ricoh360Camera } from '@capgo/capacitor-ricoh360';
const result = await Ricoh360Camera.setSettings({ options: {} });console.log(result);sendCommand
sendCommand将原始命令发送到相机
import { Ricoh360Camera } from '@capgo/capacitor-ricoh360';
const result = await Ricoh360Camera.sendCommand({ endpoint: 'https://example.com', payload: {},});console.log(result);类型参考
类型参考InitializeOptions
InitializeOptionsexport interface InitializeOptions { url: string;}CommandResponse
CommandResponseexport interface CommandResponse { session?: string; info?: string; preview?: string; picture?: string; settings?: string;}GetCameraAssetOptions
获取相机资产选项export interface GetCameraAssetOptions { url: string; saveToFile?: boolean;}GetCameraAssetResponse
获取相机资产响应export interface GetCameraAssetResponse { statusCode: number; data: string; // base64 encoded data filePath?: string;}ListFilesOptions
标题:ListFilesOptionsexport interface ListFilesOptions { fileType?: 'all' | 'image' | 'video'; startPosition?: number; entryCount?: number; maxThumbSize?: number; _detail?: boolean;}ListFilesResponse
标题:ListFilesResponseexport interface ListFilesResponse { results: { entries: { name: string; fileUrl: string; size: number; dateTimeZone: string; width?: number; height?: number; previewUrl?: string; _projectionType?: string; isProcessed?: boolean; _thumbSize?: number; }[]; totalEntries: number; };}VideoCaptureOptions
标题:VideoCaptureOptionsexport interface VideoCaptureOptions { // Define any specific options needed for capturing a video resolution?: '4K' | '2K'; frameRate?: number; bitrate?: number;}LivePreviewOptions
标题:LivePreviewOptionsexport interface LivePreviewOptions { displayInFront?: boolean; cropPreview?: boolean;}真实数据来源
标题:真实数据来源本页面是根据插件的 src/definitions.ts重新同步时,公共API上游发生变化。
继续从Getting Started
标题:继续从Getting Started如果您正在使用 开始使用 来规划原生媒体和界面行为,连接它与 使用@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-视频播放器 了解 @capgo/capacitor-视频播放器 的实现细节 使用 @capgo/capacitor-原生导航 了解使用 @capgo/capacitor-原生导航 的原生能力