Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module "@react-native-community/slider";
28 changes: 17 additions & 11 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/@types/@react-native-community/slider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module "@react-native-community/slider";
10 changes: 1 addition & 9 deletions src/Slider.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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}
/>
</View>
Expand Down