MCPcopy Create free account
hub / github.com/adobe/react-spectrum / Video

Function Video

packages/dev/s2-docs/src/Video.tsx:5–24  ·  view source on GitHub ↗
(props: VideoHTMLAttributes<HTMLVideoElement>)

Source from the content-addressed store, hash-verified

3import {VideoHTMLAttributes} from 'react';
4
5export function Video(props: VideoHTMLAttributes<HTMLVideoElement>) {
6 return (
7 // eslint-disable-next-line
8 <video
9 {...props}
10 tabIndex={props.autoPlay && !props.controls ? 0 : undefined}
11 onClick={e => {
12 if (props.autoPlay && !props.controls) {
13 e.currentTarget.paused ? e.currentTarget.play() : e.currentTarget.pause();
14 }
15 }}
16 onKeyDown={e => {
17 if (props.autoPlay && !props.controls && e.key === ' ') {
18 e.preventDefault();
19 e.currentTarget.paused ? e.currentTarget.play() : e.currentTarget.pause();
20 }
21 }}
22 />
23 );
24}

Callers

nothing calls this directly

Calls 1

pauseMethod · 0.80

Tested by

no test coverage detected