diff --git a/example/react-native-media-controls/@types/@react-native-community/slider.ts b/example/react-native-media-controls/@types/@react-native-community/slider.ts new file mode 100644 index 00000000..b0a4ea08 --- /dev/null +++ b/example/react-native-media-controls/@types/@react-native-community/slider.ts @@ -0,0 +1 @@ +declare module "@react-native-community/slider"; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 24800038..0dc0bc4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,15 @@ { "name": "react-native-media-controls", - "version": "2.2.0", + "version": "2.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "2.2.0", + "name": "react-native-media-controls", + "version": "2.3.0", "license": "MIT", "devDependencies": { + "@react-native-community/slider": "^4.4.1", "@types/react": "^16.9.34", "@types/react-native": "^0.62.5", "husky": "^4.2.5", @@ -2905,6 +2907,12 @@ "node": ">=6" } }, + "node_modules/@react-native-community/slider": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@react-native-community/slider/-/slider-4.4.1.tgz", + "integrity": "sha512-CLzwZyLlWfDYN4xj6Wwqm+HisF6dd+rq9pk6Cp+Auw0bm4eb4GLQNc29ILh051xHMe5Dhrd9+NBrbvaEujevkA==", + "dev": true + }, "node_modules/@rollup/plugin-commonjs": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-11.1.0.tgz", @@ -5394,8 +5402,7 @@ "esprima": "^4.0.1", "estraverse": "^4.2.0", "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" + "optionator": "^0.8.1" }, "bin": { "escodegen": "bin/escodegen.js", @@ -8232,7 +8239,6 @@ "@jest/types": "^24.9.0", "anymatch": "^2.0.0", "fb-watchman": "^2.0.0", - "fsevents": "^1.2.7", "graceful-fs": "^4.1.15", "invariant": "^2.2.4", "jest-serializer": "^24.9.0", @@ -9847,9 +9853,6 @@ "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", "peer": true, - "dependencies": { - "graceful-fs": "^4.1.9" - }, "optionalDependencies": { "graceful-fs": "^4.1.9" } @@ -10943,9 +10946,6 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "peer": true, - "dependencies": { - "graceful-fs": "^4.1.6" - }, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -18005,6 +18005,12 @@ "integrity": "sha512-ael2f1onoPF3vF7YqHGWy7NnafzGu+yp88BbFbP0ydoCP2xGSUzmZVw0zakPTC040Id+JQ9WeFczujMkDy6jYQ==", "peer": true }, + "@react-native-community/slider": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@react-native-community/slider/-/slider-4.4.1.tgz", + "integrity": "sha512-CLzwZyLlWfDYN4xj6Wwqm+HisF6dd+rq9pk6Cp+Auw0bm4eb4GLQNc29ILh051xHMe5Dhrd9+NBrbvaEujevkA==", + "dev": true + }, "@rollup/plugin-commonjs": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-11.1.0.tgz", diff --git a/package.json b/package.json index 6ffdf1ea..84e39ed5 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ } }, "devDependencies": { + "@react-native-community/slider": "^4.4.1", "@types/react": "^16.9.34", "@types/react-native": "^0.62.5", "husky": "^4.2.5", diff --git a/src/@types/@react-native-community/slider.ts b/src/@types/@react-native-community/slider.ts new file mode 100644 index 00000000..fcced317 --- /dev/null +++ b/src/@types/@react-native-community/slider.ts @@ -0,0 +1 @@ +declare module "@react-native-community/slider"; diff --git a/src/Slider.tsx b/src/Slider.tsx index 3576fccf..3efa9faf 100644 --- a/src/Slider.tsx +++ b/src/Slider.tsx @@ -1,6 +1,6 @@ import React from "react"; import { TouchableOpacity, View, Text, Image, ViewStyle } from "react-native"; -import RNSlider from "react-native-slider"; +import RNSlider from "@react-native-community/slider"; import styles from "./MediaControls.style"; import { humanizeVideoDuration } from "./utils"; import { Props as MediaControlsProps } from "./MediaControls"; @@ -39,8 +39,6 @@ const Slider = (props: Props) => { } = props; const containerStyle = customSliderStyle?.containerStyle || {}; - const customTrackStyle = customSliderStyle?.trackStyle || {}; - const customThumbStyle = customSliderStyle?.thumbStyle || {}; const dragging = (value: number) => { const { onSeeking, playerState } = props; @@ -77,12 +75,6 @@ const Slider = (props: Props) => { onSlidingComplete={seekVideo} maximumValue={Math.floor(duration)} value={Math.floor(progress)} - trackStyle={[styles.track, customTrackStyle]} - thumbStyle={[ - styles.thumb, - customThumbStyle, - { borderColor: mainColor }, - ]} minimumTrackTintColor={mainColor} />