Giter VIP home page Giter VIP logo

Comments (19)

onaburalnyionseo avatar onaburalnyionseo commented on May 25, 2024 1

@a914-gowtham At first glance, everything is fine.
But i think you don't must copy video to app folder because app size very increase. I think the best solution is load video to preview from original video path and save to app folder only trimmed video. What do you think about this solution?
Video to edit will be open faster and dont increse app folder size.

from android-video-trimmer.

a914-gowtham avatar a914-gowtham commented on May 25, 2024 1

yes, you are right I tried to open a video with a size of 1Gb two times and the app size became 2gb. It needs to be fixed. I'll try to find the workaround

from android-video-trimmer.

a914-gowtham avatar a914-gowtham commented on May 25, 2024

did you pass video path TrimVideo.activity(String.valueOf(data.getData())) in this constructor. this error might happen if you pass videopath instead of videouri. Can you share the device details?

from android-video-trimmer.

onaburalnyionseo avatar onaburalnyionseo commented on May 25, 2024

My device is Google Pixel XL. Android 10 (QP1A.191005.007.A3)

I create intent and execute:
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
intent.setType("video/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, false);
fragment.startActivityForResult(intent, 2);

and in onActivityResult:
if (requestCode == 2 && data != null) {
if (data.getData() != null) {
TrimVideo.activity(String.valueOf(data.getData()))
.setTrimType(TrimType.MIN_MAX_DURATION)
.setMinToMax(5, 60).start(fragment);
} else {
Toast.makeText(fragment.getContext(), "video uri is null", Toast.LENGTH_SHORT).show();
}
} else if (requestCode == TrimVideo.VIDEO_TRIMMER_REQ_CODE && data != null) {
Uri TrimmedVideoUri = Uri.parse(TrimVideo.getTrimmedVideoPath(data));
}

image

from android-video-trimmer.

onaburalnyionseo avatar onaburalnyionseo commented on May 25, 2024

@a914-gowtham any ideas ?

from android-video-trimmer.

a914-gowtham avatar a914-gowtham commented on May 25, 2024

I'll try to reproduce it here

from android-video-trimmer.

onaburalnyionseo avatar onaburalnyionseo commented on May 25, 2024

@a914-gowtham Did you manage to reproduce this defect?

from android-video-trimmer.

a914-gowtham avatar a914-gowtham commented on May 25, 2024

@onaburalnyionseo I couldn't reproduce the issue. I tried the latest release with Pixel XL emulator android 10. can you share the library version you used

from android-video-trimmer.

onaburalnyionseo avatar onaburalnyionseo commented on May 25, 2024

com.github.a914-gowtham:Android-video-trimmer:1.6.1

from android-video-trimmer.

a914-gowtham avatar a914-gowtham commented on May 25, 2024

@onaburalnyionseo Really Sorry for late response.
You can use this implementation 'com.github.a914-gowtham:Android-video-trimmer:b6fe3a90f8' snapshot it will be available in the next release. now copyToInternalStorage method runs in background.

from android-video-trimmer.

onaburalnyionseo avatar onaburalnyionseo commented on May 25, 2024

@a914-gowtham Well thank you! I will try on this week and let you know the result. When I can expected marge this fix in the main branch?

from android-video-trimmer.

a914-gowtham avatar a914-gowtham commented on May 25, 2024

@onaburalnyionseo If you verify the fix. I can make a release within a day.

copyToInternelStorage is not the correct way when I try to trim a video from getExternalStorageDirectory() it throws fileNotFoundException. that's why I used copyToInternelStorage as a workaround. I will try to find any other solution instead of copyToInternelStorage.

from android-video-trimmer.

onaburalnyionseo avatar onaburalnyionseo commented on May 25, 2024

image

@a914-gowtham Could not find com.github.a914-gowtham:Android-video-trimmer:b6fe3a90f8.

from android-video-trimmer.

a914-gowtham avatar a914-gowtham commented on May 25, 2024

@onaburalnyionseo Make sure to add the jitpack maven in build.gradle(project)

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}

from android-video-trimmer.

onaburalnyionseo avatar onaburalnyionseo commented on May 25, 2024

As fast solution it's remove original video from app folder after edit and save only edited video. But this is not resolve long time copy original video

from android-video-trimmer.

a914-gowtham avatar a914-gowtham commented on May 25, 2024

@onaburalnyionseo Can you try this implementation 'com.github.a914-gowtham:Android-video-trimmer:83d2302d57' . In this snapshot CopiedVideoFile is deleted in onDestroy of the ActTrimmer .

If it works for you. I can make a release(1.7.0) with this fix and #49 fix

I have found a way to avoid doing copyToInternalStorage. So, there will be no needed to show progress.
It will be available in the 1.7.1 version.

from android-video-trimmer.

a914-gowtham avatar a914-gowtham commented on May 25, 2024

@onaburalnyionseo You will need this. I made a breaking change.

   //create a global variable
    ActivityResultLauncher<Intent> videoTrimResultLauncher = registerForActivityResult(
            new ActivityResultContracts.StartActivityForResult(),
            result -> {
                if (result.getResultCode() == Activity.RESULT_OK &&
                        result.getData() != null) {
                    Uri uri = Uri.parse(TrimVideo.getTrimmedVideoPath(result.getData()));
                    Log.d(TAG, "Trimmed path:: " + uri);
                   
                } else
                    LogMessage.v("videoTrimResultLauncher data is null");
            });
    TrimVideo.activity(data)
                    .setCompressOption(new CompressOption()) //pass empty constructor for default compress option
                    .start(this, videoTrimResultLauncher);

//for Kotlin

    val startForResult = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { 
    result: ActivityResult ->
        if (result.resultCode == Activity.RESULT_OK) {
            //handle data
        }
    }

TrimVideo.activity(data)
                    .setCompressOption(new CompressOption()) //pass empty constructor for default compress option
                    .start(this, videoTrimResultLauncher)

from android-video-trimmer.

onaburalnyionseo avatar onaburalnyionseo commented on May 25, 2024

@a914-gowtham Hi. yes its work, you can release this change to 1.7.0 but i think i still be wait your improvement ASAP. its about:
"I have found a way to avoid doing copyToInternalStorage. So, there will be no needed to show progress.
It will be available in the 1.7.1 version."

from android-video-trimmer.

a914-gowtham avatar a914-gowtham commented on May 25, 2024

@onaburalnyionseo I just made releases 1.7.0 and 1.7.1
implementation 'com.github.a914-gowtham:android-video-trimmer:1.7.1'

from android-video-trimmer.

Related Issues (20)

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.