跳过内容

开始使用

终端窗口
bun add @capgo/ricoh360
bunx cap sync
import { Ricoh360Camera } from '@capgo/ricoh360';

初始化SDK并使用摄像头URL

import { Ricoh360Camera } from '@capgo/ricoh360';
await Ricoh360Camera.initialize({} as InitializeOptions);

从URL中检索摄像头资产并以base64返回

import { Ricoh360Camera } from '@capgo/ricoh360';
await Ricoh360Camera.getCameraAsset({} as GetCameraAssetOptions);

列出摄像头存储的文件

import { Ricoh360Camera } from '@capgo/ricoh360';
await Ricoh360Camera.listFiles();

capturePicture

标题:捕获图片

捕捉图片

import { Ricoh360Camera } from '@capgo/ricoh360';
await Ricoh360Camera.capturePicture();

捕捉视频

import { Ricoh360Camera } from '@capgo/ricoh360';
await Ricoh360Camera.captureVideo({} as VideoCaptureOptions);

开始实时预览

import { Ricoh360Camera } from '@capgo/ricoh360';
await Ricoh360Camera.livePreview({} as LivePreviewOptions);

停止实时预览

import { Ricoh360Camera } from '@capgo/ricoh360';
await Ricoh360Camera.stopLivePreview();

读取相机设置

import { Ricoh360Camera } from '@capgo/ricoh360';
await Ricoh360Camera.readSettings({} as { options: string[] });

设置相机设置

import { Ricoh360Camera } from '@capgo/ricoh360';
await Ricoh360Camera.setSettings({} as { options: Record<string, any> });

复制到剪贴板

import { Ricoh360Camera } from '@capgo/ricoh360';
await Ricoh360Camera.sendCommand({} as { endpoint: string; payload: Record<string, any> });

InitializeOptions

复制到剪贴板
export interface InitializeOptions {
url: string;
}

CommandResponse

命令响应
export 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

列出文件选项
export interface ListFilesOptions {
fileType?: 'all' | 'image' | 'video';
startPosition?: number;
entryCount?: number;
maxThumbSize?: number;
_detail?: boolean;
}

ListFilesResponse

列出文件响应
export 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

视频捕获选项
export interface VideoCaptureOptions {
// Define any specific options needed for capturing a video
resolution?: '4K' | '2K';
frameRate?: number;
bitrate?: number;
}

LivePreviewOptions

LivePreviewOptions
export interface LivePreviewOptions {
displayInFront?: boolean;
cropPreview?: boolean;
}

真实来源

真实来源

本页面是由插件生成的。 src/definitions.ts. 当公共 API 上游更改时,请重新运行同步。