Refactor <Video> to TypeScript (#34284)

This commit is contained in:
Eugen Rochko 2025-03-28 13:15:43 +01:00 committed by GitHub
parent e28b64ac2d
commit e5fd61a84e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 1219 additions and 756 deletions

View file

@ -2,7 +2,7 @@ import { useCallback } from 'react';
import { removePictureInPicture } from 'mastodon/actions/picture_in_picture';
import Audio from 'mastodon/features/audio';
import Video from 'mastodon/features/video';
import { Video } from 'mastodon/features/video';
import { useAppDispatch, useAppSelector } from 'mastodon/store/typed_functions';
import Footer from './components/footer';
@ -35,6 +35,10 @@ export const PictureInPicture: React.FC = () => {
accentColor,
} = pipState;
if (!src) {
return null;
}
let player;
switch (type) {
@ -42,11 +46,10 @@ export const PictureInPicture: React.FC = () => {
player = (
<Video
src={src}
currentTime={currentTime}
volume={volume}
muted={muted}
autoPlay
inline
startTime={currentTime}
startVolume={volume}
startMuted={muted}
startPlaying
alwaysVisible
/>
);