Skip to content

Commit

Permalink
Review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
behenate committed Mar 27, 2024
1 parent 8c59b87 commit 26b116d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/pages/versions/unversioned/sdk/video-av.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ 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)
> **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.
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).

Expand Down
14 changes: 7 additions & 7 deletions docs/pages/versions/unversioned/sdk/video.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ import APISection from '~/components/plugins/APISection';
import { APIInstallSection } from '~/components/plugins/InstallSection';
import { SnackInline } from '~/ui/components/Snippet';

> **info** expo-video is a new, experimental package that aims to replace the `Video` component from expo-av with a more modern and reliable implementation. If you are concerned about using a new package, consider [expo-av](video.mdx) until expo-video has stabilized.
> **info** `expo-video` is a new, experimental library that aims to replace the `Video` component from `expo-av` with a more modern and reliable implementation. If you are looking for a more stable API, use [`expo-av`](video.mdx) until this library has stabilized.
A cross-platform, performant video component for React Native and Expo with Web support.
`expo-video` is a cross-platform, performant video component for React Native and Expo with Web support.

## Installation

<APIInstallSection />

## Usage

Here's a simple example of a video with a play/pause button.
Here's a simple example of a video with a play and pause button.

<SnackInline label='Video' dependencies={['expo-video']}>

```jsx
import { useVideoPlayer, VideoView, VideoSource } from 'expo-video';
import React, { useEffect, useRef, useState } from 'react';
import { useVideoPlayer, VideoView } from 'expo-video';
import { useEffect, useRef, useState } from 'react';
import { PixelRatio, StyleSheet, View, Button } from 'react-native';

const videoSource: VideoSource =
const videoSource =
'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4';

export default function VideoScreen() {
const ref = useRef<VideoView>(null);
const ref = useRef(null);
const [isPlaying, setIsPlaying] = useState(true);
const player = useVideoPlayer(videoSource, (player) => {
player.loop = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/expo-video/build/VideoView.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/expo-video/build/VideoView.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/expo-video/build/VideoView.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/expo-video/src/VideoView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { VideoPlayer, VideoSource, VideoViewProps } from './VideoView.types';

/**
* Creates a `VideoPlayer`, which will be automatically cleaned up when the component is unmounted.
* @param source - A video source to initialize the player with
* @param source - A video source that is used to initialize the player.
* @param setup - A function that allows setting up the player. It will run after the player is created.
*/
export function useVideoPlayer(
Expand Down

0 comments on commit 26b116d

Please sign in to comment.