This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Expo LivePhoto
允许在 iOS 上显示实时照片的库。
安装
🌐 Installation
If you are installing this in an existing React Native app, make sure to install expo in your project.
用法
🌐 Usage
这里有一个简单的例子,展示了 expo-live-photo 与 expo-image-picker 的结合使用。
🌐 Here's a simple example of expo-live-photo usage combined with expo-image-picker.
应用接口
🌐 API
import { LivePhotoView } from 'expo-live-photo';
Component
Type: React.Element<LivePhotoViewProps & {
ref: Ref<LivePhotoViewType>
}>
ContentFit • Default: 'contain'Determines how the image should be scaled to fit the container.
'contain'- Scales the image so that its larger dimension fits the target size.'cover'- Scales the image so that it completely fills the target size.
boolean • Default: trueDetermines whether the live photo should also play audio.
(error: LivePhotoLoadError) => voidCalled when an error occurred while loading.
unionThe live photo asset to display.
Acceptable values are: LivePhotoAsset | null
boolean • Default: trueDetermines whether the default iOS gesture recognizer should be used.
When true the playback will start if the user presses and holds on the LivePhotoView.
Types
Literal type: string
Determines how the image should be scaled to fit the container.
'contain'- Scales the image so that its larger dimension fits the target size.'cover'- Scales the image so that it completely fills the target size.
Acceptable values are: 'contain' | 'cover'
A live photo asset.
Note: Due to native limitations, the photo and video parts of the live photo must come from a valid live photo file and be unaltered. When taken, the photo is paired with the video via metadata. If the pairing is broken, joining them into a live photo is impossible.