diff --git a/docs/pages/versions/unversioned/sdk/av.mdx b/docs/pages/versions/unversioned/sdk/av.mdx index 55bf4c91dee1b..6dd0efdafadaf 100644 --- a/docs/pages/versions/unversioned/sdk/av.mdx +++ b/docs/pages/versions/unversioned/sdk/av.mdx @@ -16,7 +16,7 @@ import { } from '~/components/plugins/ConfigSection'; import { AndroidPermissions, IOSPermissions } from '~/components/plugins/permissions'; -The [`Audio.Sound`](audio.mdx) objects and [`Video`](video.mdx) components share a unified imperative API for media playback. +The [`Audio.Sound`](audio.mdx) objects and [`Video`](video-av.mdx) components share a unified imperative API for media playback. Note that for `Video`, all of the operations are also available via props on the component. However, we recommend using this imperative playback API for most applications where finer control over the state of the video playback is needed. @@ -108,7 +108,7 @@ render() { } ``` -See the [video documentation](video.mdx) for further information. +See the [video documentation](video-av.mdx) for further information. ### Example: `setOnPlaybackStatusUpdate()` diff --git a/docs/pages/versions/unversioned/sdk/video-av.mdx b/docs/pages/versions/unversioned/sdk/video-av.mdx new file mode 100644 index 0000000000000..fc86ebf1b849c --- /dev/null +++ b/docs/pages/versions/unversioned/sdk/video-av.mdx @@ -0,0 +1,98 @@ +--- +title: Video (expo-av) +description: A library that provides an API to implement video playback and recording in apps. +sourceCodeUrl: 'https://github.com/expo/expo/tree/main/packages/expo-av' +packageName: 'expo-av' +iconUrl: '/static/images/packages/expo-av.png' +platforms: ['android', 'ios', 'web'] +--- + +import APISection from '~/components/plugins/APISection'; +import { APIInstallSection } from '~/components/plugins/InstallSection'; +import { SnackInline } from '~/ui/components/Snippet'; + +> **info** The `Video` component from expo-av, which is documented on this page, will be replaced by an improved version in expo-video in an upcoming release (when the new library is stable). [Learn about expo-video](video.mdx) + +The `Video` component from **`expo-av`** displays a video inline with the other UI elements in your app. + +Much of Video and Audio have common APIs that are documented in [AV documentation](av.mdx). This page covers video-specific props and APIs. We encourage you to skim through this document to get basic video working, and then move on to [AV documentation](av.mdx) for more advanced functionality. The audio experience of video (such as whether to interrupt music already playing in another app, or whether to play sound while the phone is on silent mode) can be customized using the [Audio API](audio.mdx). + +## Installation + + + +## Usage + +Here's a simple example of a video with a play/pause button. + + + +```jsx +import * as React from 'react'; +import { View, StyleSheet, Button } from 'react-native'; +import { Video, ResizeMode } from 'expo-av'; + +export default function App() { + const video = React.useRef(null); + const [status, setStatus] = React.useState({}); + return ( + +