Closed hardik-wts closed 1 year ago
We are facing the same issue. Its very strange that it was working before and suddently its stopped working on already generated builds. Can anyone suggest the fixes asap ?
Could be related to this - https://github.com/facebook/react-native/issues/35210
Hi @hussain-technostacks
Not found a solution with this library
For me it's working fine in iOS for android I'll use react-native-fast-image to display video thumbnail (You can also use react-native <Image />
component )
And I am passing video url directly into FastImage
component
<FastImage
style={styles.image}
resizeMode="cover"
source={{uri: android_path}}
/>
If you have video at local (e.g. in your phone then please add file://
string in your path
const android_path = 'file://' + path;
and as per I know above trick only working for andoird not for iOS so I'll manage thumbnail part Platform wise and my final code as below
import React from 'react';
import {View, Platform} from 'react-native';
import FastImage from 'react-native-fast-image';
import styles from './styles';
export default function VideoBallReview({item = {}}) {
const {thumbnailUrl = '', path = ''} = item;
const android_path = 'file://' + path;
if (Platform.OS === 'ios') {
return (
<View style={styles.mainContainer}>
<FastImage
style={styles.image}
resizeMode="cover"
source={{
uri: thumbnailUrl, // Use react-native-create-thumbnail library to create thumnail
}}
/>
</View>
);
}
return (
<View style={styles.mainContainer}>
<FastImage
style={styles.image}
resizeMode="cover"
source={{
uri: android_path, // Pass direct URL/URI
}}
/>
</View>
);
}
Notes
Hi @hardik-wts I have found solution for Android, please use below solution for Android for No virtual method error. If you vary about how to create patch, then please create patch for below change
Please open CreateThumbnailModule.java file from below path node_modules -> react-native-create-thumbnail -> android -> src -> main -> java -> CreateThumbnailModule.java
protected ProcessDataTask(ReactContext reactContext, Promise promise, ReadableMap options) { + super(reactContext); -> Add this line - super(reactContext.getExceptionHandler()); -> Remove this line this.weakContext = new WeakReference<>(reactContext.getApplicationContext()); this.promise = promise; this.options = options; }
Hi, you guys can check it out => https://github.com/salihgun/react-native-video-processor
Closing due to inactivity
No virtual method get exceptionhandler Unable to create thumnail in android Clone your project and run the project from example folder
Testing on Android 11 emulator
Snack, code example, screenshot, or link to a repository
After tunning this code getting below error![Screenshot_1668604736](https://user-images.githubusercontent.com/87646502/202191575-8d374098-b92b-4e6e-bd40-fd2f811c7cf5.png)