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

setDataSource failed error #62

Closed
sania232 opened this issue Apr 28, 2022 · 10 comments
Closed

setDataSource failed error #62

sania232 opened this issue Apr 28, 2022 · 10 comments

Comments

@sania232
Copy link

When Im trying this with a youtube video URL it is giving me the below error:
setDataSource failed: status = 0x80000000
I followed the example code and am using React Native CLI

@Subiyel
Copy link

Subiyel commented Apr 30, 2022

Same here getting following error:
Error: setDataSource failed: status = 0xFFFFFFEA

Android

Local Video File

try {
const response = await createThumbnail({
url: absolutePath,
timeStamp: 1,
});
console.log("Thumbnail: ", response.path);
} catch (err) {
console.error(err);
}

@souvik-ghosh
Copy link
Owner

@sania232 @Subiyel I need a few inputs. Can you please check if the video is playable(using react-native-video) on the device? (using the same path)

@Subiyel
Copy link

Subiyel commented May 3, 2022

Yes, the video is playable using the same path via react-native-video. i am picking the video using react-native-image-picker.
For temporary workaround i am now uploading the video to my server and using that url to create thumbnail and it works fine. Issue is occurring only using local file path.

       buildToolsVersion = "30.0.0"
        minSdkVersion = 21
        compileSdkVersion = 31
        targetSdkVersion = 31
        ndkVersion = "21.4.7075529"
       "react-native-create-thumbnail": "^1.5.1",
       "react-native": "0.67.4",

@AdamTyler
Copy link

I'm also running into this issue on Android only. For all thumbnails the return I see is: {"err": [Error: setDataSource failed: status = 0xFFFFFFEA]}.

        buildToolsVersion = "30.0.2"
        minSdkVersion = 24
        compileSdkVersion = 31
        targetSdkVersion = 30
        ndkVersion = "21.4.7075529"
        kotlinVersion = '1.5.0'
        supportLibVersion = "29"
        playServicesVersion = "17.0.0"
"react-native-create-thumbnail": "^1.5.1",
"react-native": "^0.67.4"

@tudormarze
Copy link

On Android, I had 0xFFFFFFEA fixed by making sure the url starts with file://somepath rather than /somepath only

@souvik-ghosh souvik-ghosh pinned this issue Feb 18, 2023
@ranjitAcelucid
Copy link

Hii @tudormarze ,
Could you provide me the example of this? How can you implemented it?

Thanks

@vrsmk1995
Copy link

@sania232 @Subiyel I need a few inputs. Can you please check if the video is playable(using react-native-video) on the device? (using the same path)

iam using youtube url links for creating thumbnails iam getting same error
app.json
app.json

import React, {useState} from 'react';
import {
Image,
Text,
View,
StyleSheet,
TextInput,
Button,
ActivityIndicator,
} from 'react-native';
import {createThumbnail} from 'react-native-create-thumbnail';

const placeholderImage = require('./Images/image.png');

const App = () => {
const [path, setPath] = useState('');
const [thumbnail, setThumbnail] = useState('');
const [timeStamp, setTimeStamp] = useState('1000');
const [isLoading, setIsLoading] = useState(false);

return (

☆CreateThumbnail example☆



☆THUMBNAIL☆

{isLoading ? (

) : (
<Image
style={styles.image}
source={thumbnail ? {uri: thumbnail} : placeholderImage}
/>
)}


);

async function generateThumbnail() {
if (!path) {
return;
}

setIsLoading(true);

try {
  const response = await createThumbnail({
    url: path,
    timeStamp: parseInt(timeStamp, 10),
  });
  setThumbnail(response.path);
} catch (err) {
  console.error(err, 'error');
} finally {
  setIsLoading(false);
}

}
};

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 20,
color: 'black',
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 20,
},
image: {
height: 150,
width: 250,
backgroundColor: 'lightgrey',
justifyContent: 'center',
},
pathInput: {
backgroundColor: '#eaeaea',
width: '80%',
paddingHorizontal: 10,
color: 'black',
borderColor: 'lightgrey',
borderWidth: 1,
},
timeInput: {
backgroundColor: '#eaeaea',
width: '40%',
paddingHorizontal: 10,
margin: 20,
color: 'black',
borderColor: 'lightgrey',
borderWidth: 1,
},
});

export default App;
this is my code can u please help

@souvik-ghosh
Copy link
Owner

@vrsmk1995 Youtube links won't work. This library only supports direct links to videos.

@vrsmk1995
Copy link

vrsmk1995 commented Jan 31, 2024 via email

@ahsanreal4
Copy link

@vrsmk1995 Any breakthrough on HLS player support ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants