From b2a1244f9718e1f9984b47a96f041586a5ace456 Mon Sep 17 00:00:00 2001 From: albuFlaviu Date: Fri, 24 Nov 2023 13:55:04 +0200 Subject: [PATCH 1/4] react-native-video@6.0.0-beta --- packages/media-console/package.json | 7 ++----- packages/media-console/src/VideoPlayer.tsx | 15 +++++++++------ packages/media-console/src/types.ts | 7 +++---- packages/media-console/tsconfig.json | 1 - yarn.lock | 5 +++++ 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/packages/media-console/package.json b/packages/media-console/package.json index a4b2f8e..9228bf5 100644 --- a/packages/media-console/package.json +++ b/packages/media-console/package.json @@ -24,18 +24,15 @@ "prepare": "bob build", "release": "release-it" }, - "dependencies": {}, "peerDependencies": { - "react-native": ">=0.46.0", - "react-native-video": ">=2.0.0" + "react-native": ">=0.46.0" }, "devDependencies": { - "@types/react-native-video": "^5.0.14", "react": "^17.0.2", "react-native": "npm:react-native-tvos@0.68.2-5", "react-native-builder-bob": "^0.18.2", - "react-native-video": "^5.2.0", "react-native-reanimated": "^2.12.0", + "react-native-video": "6.0.0-beta.0", "typescript": "^4.6.2" }, "react-native": "src/index.ts", diff --git a/packages/media-console/src/VideoPlayer.tsx b/packages/media-console/src/VideoPlayer.tsx index ae20078..41e2860 100644 --- a/packages/media-console/src/VideoPlayer.tsx +++ b/packages/media-console/src/VideoPlayer.tsx @@ -2,8 +2,11 @@ import React, {useCallback, useState, useEffect, useRef} from 'react'; import {View} from 'react-native'; import Video, { OnLoadData, + OnLoadStartData, OnProgressData, OnSeekData, + ResizeMode, + VideoRef, } from 'react-native-video'; import {useControlTimeout, useJSAnimations, usePanResponders} from './hooks'; import { @@ -29,7 +32,7 @@ const AnimatedVideoPlayer = ( animations, toggleResizeModeOnFullscreen, doubleTapTime = 130, - resizeMode = 'contain', + resizeMode = ResizeMode.CONTAIN, isFullscreen = false, showOnStart = false, showOnEnd = false, @@ -75,12 +78,12 @@ const AnimatedVideoPlayer = ( } = props; const mounted = useRef(false); - const _videoRef = useRef