Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): revert media3 update, back to 1.1.1 #3369

Merged
merged 4 commits into from
Nov 22, 2023
Merged
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
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ RNVideo_targetSdkVersion=31
RNVideo_compileSdkVersion=31
RNVideo_ndkversion=21.4.7075529
RNVideo_buildToolsVersion=30.0.2
RNVideo_media3Version=1.2.0
RNVideo_media3Version=1.1.1
RNVideo_RNVUseExoplayerIMA=false
13 changes: 13 additions & 0 deletions examples/basic/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"plugins": ["@typescript-eslint"],
"extends": [
"@react-native",
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"parserOptions": {
"requireConfigFile": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public boolean getUseDeveloperSupport() {
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new ReactVideoPackage());
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
Expand Down
3 changes: 3 additions & 0 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
"prettier": "^2.4.1",
"typescript": "4.8.4"
},
"resolutions": {
"@types/react": "^18.0.24"
},
"engines": {
"node": ">=16"
}
Expand Down
48 changes: 28 additions & 20 deletions examples/basic/src/MultiValueControl.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FunctionComponent } from 'react';
import React, {FunctionComponent} from 'react';

import {
StyleSheet,
Expand All @@ -7,21 +7,26 @@ import {
TouchableOpacity,
View,
} from 'react-native';
import {ResizeMode} from 'react-native-video';

export type MultiValueControlPropType = number | string | ResizeMode;

/*
* MultiValueControl displays a list clickable text view
*/
* MultiValueControl displays a list clickable text view
*/

interface MultiValueControlType<T> {
// a list a string or number to be displayed
values: Array<T>
values: Array<T>;
// The selected value in values
selected?: T
selected?: T;
// callback to press onPress
onPress: (arg: T) => any
onPress: (arg: MultiValueControlPropType) => void;
}

const MultiValueControl: FunctionComponent<MultiValueControlType<any>> = ({ values, selected, onPress }) => {
const MultiValueControl: FunctionComponent<
MultiValueControlType<MultiValueControlPropType>
> = ({values, selected, onPress}) => {
const selectedStyle: TextStyle = StyleSheet.flatten([
styles.option,
{fontWeight: 'bold'},
Expand All @@ -32,20 +37,23 @@ const MultiValueControl: FunctionComponent<MultiValueControlType<any>> = ({ valu
{fontWeight: 'normal'},
]);

return <View style={styles.container}>
{values.map((value: string | number) => {
const _style = value === selected ? selectedStyle : unselectedStyle
return (
<TouchableOpacity
key={value}
onPress={() => {
onPress?.(value)
}}>
return (
<View style={styles.container}>
{values.map((value: MultiValueControlPropType) => {
const _style = value === selected ? selectedStyle : unselectedStyle;
return (
<TouchableOpacity
key={value}
onPress={() => {
onPress?.(value);
}}>
<Text style={_style}>{value}</Text>
</TouchableOpacity>)
})}
</View>
}
</TouchableOpacity>
);
})}
</View>
);
};

const styles = StyleSheet.create({
option: {
Expand Down
39 changes: 22 additions & 17 deletions examples/basic/src/ToggleControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,29 @@ import {
} from 'react-native';

/*
* ToggleControl displays a 2 states clickable text
*/
* ToggleControl displays a 2 states clickable text
*/

interface ToggleControlType {
// boolean indicating if text is selected state
isSelected?: boolean
isSelected?: boolean;
// value of text when selected
selectedText?: string
selectedText?: string;
// value of text when NOT selected
unselectedText?: string
unselectedText?: string;
// default text if no only one text field is needed
text?: string
text?: string;
// callback called when pressing the component
onPress: () => any
onPress: () => void;
}

const ToggleControl = ({ isSelected, selectedText, unselectedText, text, onPress }: ToggleControlType) => {
const ToggleControl = ({
isSelected,
selectedText,
unselectedText,
text,
onPress,
}: ToggleControlType) => {
const selectedStyle: TextStyle = StyleSheet.flatten([
styles.controlOption,
{fontWeight: 'bold'},
Expand All @@ -36,17 +42,16 @@ const ToggleControl = ({ isSelected, selectedText, unselectedText, text, onPress
{fontWeight: 'normal'},
]);

const style = isSelected ? selectedStyle : unselectedStyle;
const _text = text ? text : isSelected ? selectedText : unselectedText;
return (
<View style={styles.resizeModeControl}>
<TouchableOpacity
onPress={onPress}>
const style = isSelected ? selectedStyle : unselectedStyle;
const _text = text ? text : isSelected ? selectedText : unselectedText;
return (
<View style={styles.resizeModeControl}>
<TouchableOpacity onPress={onPress}>
<Text style={style}>{_text}</Text>
</TouchableOpacity>
</View>
);
}
</View>
);
};

const styles = StyleSheet.create({
controlOption: {
Expand Down
Loading