Giter VIP home page Giter VIP logo

react-native-thumbnail's People

Contributors

asessa avatar kevinresol avatar n1ru4l avatar phuochau avatar prscms avatar prscx avatar robwalkerco avatar sermler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-thumbnail's Issues

Cannot resolve symbol 'reactlibrary'

Hi,

Environment:
OS: macOS High Sierra 10.13.6
Node: 8.10.0
Yarn: 1.5.1
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.4.1 Build version 9F2000
Android Studio: 3.1 AI-173.4670197

Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.54.4 => 0.54.4

I cannot install the library on Android, It throws the error 'Cannot resolve symbol 'reactlibrary'' and it does not recognize the package when adding the line 'import com.reactlibrary.RNThumbnailPackage;' in MainApplication.java (NOT IN MainActivity as it is i believe wrongly stated on the project page).
The package is installed with 'npm install react-native-thumbnail --save' and appears in package.json.

How to solve this ASAP?
Thank you

Unhandled Promise Reject: No such file or directory

  • Record video with react-native-camera (it records ok)
  • Verify that file exists with RNFetchBlob (it does, looks like file://...)
  • This library will send error "No such file or directory" despite that RNFetchBlob confirms the file exists and it's readable.

Request: Add provision to select thumb from given time

Mostly this happen that first frame of video doesn't depict the actual value and we might want allow user to select their own thumb. From video timestamp. Can we give a provision where user can pass a timestamp and call back create return path for frame of that particular timestamp.

any way to assign the return file path to variable?

getThumbnail(filePath){
      let thumbnailURL;
      RNThumbnail.get(filePath).then((response) => response.path)
      .then((responseData) => {
        console.warn(responseData);
        return responseData;
      })
      .catch(error => console.warn(error));
      
      alert(thumbnailURL);
      //return thumbnailURL;
    }

I am trying to get thumbnail path and storing to a variable to be used, But I am getting undefined

package name change

Hey , The android package name for the library is ReactLibrary which comes by default, It might causes error during build if some new library is added (having the default name). Kindly change it

Android setDataSource Error

I have got the thumbnail on IOS successfully, but on android getting this error:
Note: i try it on android version 4.4 and android 7.0 => { the same error }
Can anyone help me?

screenshot_2017-10-30-10-49-11-194

not work in Android

2019-09-15 00:56:03.426 6000-6000/com.testvideothumb E/Parcel: Reading a NULL string not supported here.
2019-09-15 00:56:03.442 6000-6079/com.testvideothumb E/unknown:ReactNative: Exception in native call
    java.lang.IllegalArgumentException
        at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:110)
        at me.hauvo.thumbnail.RNThumbnailModule.get(RNThumbnailModule.java:46)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:232)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:232)
        at java.lang.Thread.run(Thread.java:764)

I have tried many methods, still ineffective, tired

How should the filepath be?

I am using react-native-document-picker. I get the file path using the res object, res.uri give me file path in the form of content://com.android.providers.media.documents/document/video%xxxxxxx. On giving this file path to RNThumbnail.get(res.uri) my app crashes. I don't know whether there is problem with uri or anything else.

Height and width of 0 thumbnail result

I'm unable to render a thumbnail image with this library. It returns a result with a path for the cached thumbnail but the height and width properties are both 0. Do these properties suggest that the image cannot be rendered? I am providing my own height and width style properties to the <Image /> itself.

Cache Handling

I want to know the point at which the cache generated thumbnail got deleted. Will i have to handle it manually by myself or the deletion of those cache generated thumbnail is automated.. If Yes.. How?

Thanks in advance and best regards

How to make thumbs once

New thumbnail is generating every time i run RNThumbnail.get(path), so how can i generate it only once? Sorry for my english)

Android requires storage permission

Somewhere in the README we should add that you need storage permission to use this library for Android:

import Permissions from "react-native-permissions";
...
if(!isIos) await Permissions.request("storage");

So it doesn't support IOS?

I got the path, but the width and height were 0.
"react-native": "0.57.8"
"react-native-thumbnail": "^1.1.3"

can you fixe it?

We don't need "@Override" for android, aren't we?

I think that we don't need "@OverRide" for public List<Class<? extends JavaScriptModule>> method, when I am trying run "react-native run-android" I have compile error:

/node_modules/react-native-thumbnail/android/src/main/java/com/reactlibrary/RNThumbnailPackage.java:19: error: method does not override or implement a method from a supertype
    @Override
    ^
1 error

When I remove "@OverRide" this works and compile fine

I am not good in Java, but I think we can do it.

Line that I think we need to remove: https://github.com/phuochau/react-native-thumbnail/blob/master/android/src/main/java/com/reactlibrary/RNThumbnailPackage.java#L19

Thumbnails are blurry

Most of the time the thumbnails are blurry. I'm taking the videos with react-native-camera like so:

const options = {
      quality: RNCamera.Constants.VideoQuality["480p"],
      mute: true
      // maxDuration: 60 * 3
    };
...
const data = await this.camera.recordAsync(options);
...
<RNCamera
          ref={this.createRef}
          style={styles.cameraStyles}
          type={this.state.camera.type}
          flashMode={this.state.camera.flashMode}
          onFocusChanged={() => {}}
          onZoomChanged={() => {}}
          defaultTouchToFocus
          mirrorImage={false}
        />

Any way to improve the thumbnail quality?

Android failing

I am using version 7.1 on android and I get this error

Attempt to invoke virtual method 'boolean android.graphics.Bitmap.compress(android.graphics.Bitmap$CompressFormat, int, java.io.OutputStream)' on a null object reference
Error: Attempt to invoke virtual method 'boolean android.graphics.Bitmap.compress(android.graphics.Bitmap$CompressFormat, int, java.io.OutputStream)' on a null object reference

The path am passing on it looks like this : file:///storage/emulated/0/Movies/VID_20170930_062218.mp4
any ideas?

Android publishing application failed

`Execution failed for task ':react-native-thumbnail:verifyReleaseResources'.

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
G:\Users\ASUS\WebStormProjects\shootingv1\node_modules\react-native-thumbnail\android\build\intermediates\res\merged\release\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
G:\Users\ASUS\WebStormProjects\shootingv1\node_modules\react-native-thumbnail\android\build\intermediates\res\merged\release\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
G:\Users\ASUS\WebStormProjects\shootingv1\node_modules\react-native-thumbnail\android\build\intermediates\res\merged\release\values\values.xml:2713: error: resource android:attr/fontVariationSettings not found.
G:\Users\ASUS\WebStormProjects\shootingv1\node_modules\react-native-thumbnail\android\build\intermediates\res\merged\release\values\values.xml:2714: error: resource android:attr/ttcIndex not found.
error: failed linking references.`

How to get the first tick of frame?

My thumbnail is always the last frame on my video. How do I get the first frame for my video thumbnail?
I'm on android.
My video is only 3 secs long, and will always be like that, but I keep on getting the 2nd or 3rd sec frame.

Cannot read property 'get' of undefined

I building on android, with this info:
Environment: OS: Windows 10 Node: 8.10.0 Yarn: 1.5.1 npm: 5.8.0 Watchman: Not Found Xcode: N/A Android Studio: Version 3.0.0.0 AI-171.4443003

Packages: (wanted => installed) react: 16.3.0-alpha.1 => 16.3.0-alpha.1 react-native: 0.54.3 => 0.54.3 ,

Feature Request: Support setting the timestamp for the created thumbnail

Currently the thumbnail is generated from the start of the video. However it would be awesome if there was an option to specify the timestamp on which the thumbnail should be created via an option.

I could implement this for iOS.

The API could be designed like this:

import RNThumbnail from 'react-native-thumbnail';
const timestampInMilliseconds = 3000
RNThumbnail.get(filepath).then((result, { timestamp: timestampInMilliseconds }) => {
  console.log(result.path); // thumbnail path
})

Doesn't work on iOS version.

Hi, there.
I got the thumbnail as an image on Android version, but I didn't get it on iOS version well.
I got the path, but the width and height were 0.
What is wrong?

I am using RN 0.44.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.