Open LudinaReema opened 3 years ago
Thats great, @LudinaReema thank you. I never got the android side working and had to take care of other projects. You can make a PR with your changes if you like and I can merge in your updates, or I can update it myself later this week.
Hello,
There are some syntax errors in the latest commit. As I'm not a native developer, have modified some code to /node_modules/react-native-video-watermarker/android/src/main/java/com/vyoo/VideoWatermarkModule.java through which I'm able to get the watermark image perfectly. Thanks for this library. Below code is FYR:
package me.vyoo;
import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.Callback;
import com.daasuu.mp4compose.composer.Mp4Composer; import com.daasuu.mp4compose.filter.GlWatermarkFilter;
import java.io.File; import java.io.FileNotFoundException; import java.io.IOException;
import android.net.Uri; import android.util.Log; import android.graphics.BitmapFactory;
public class VideoWatermarkModule extends ReactContextBaseJavaModule {
private final ReactApplicationContext reactContext;
public VideoWatermarkModule(ReactApplicationContext reactContext) { super(reactContext); this.reactContext = reactContext; }
@Override public String getName() { return "VideoWatermark"; }
@ReactMethod public void convert(String videoPath, String imagePath, String watermarkPosition, Callback callback) { watermarkVideoWithImage(videoPath, imagePath, watermarkPosition, callback); }
public void watermarkVideoWithImage(String videoPath, String imagePath, String watermarkPosition, final Callback callback) { File destFile = new File(this.getReactApplicationContext().getFilesDir(), "converted.mp4"); if (!destFile.exists()) { try { destFile.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } final String destinationPath = destFile.getPath(); // private Position wtrkMrkPos; // switch(watermarkPosition) {
} }