Comments (19)
@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.
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.
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.
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));
}
from android-video-trimmer.
@a914-gowtham any ideas ?
from android-video-trimmer.
I'll try to reproduce it here
from android-video-trimmer.
@a914-gowtham Did you manage to reproduce this defect?
from android-video-trimmer.
@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.
com.github.a914-gowtham:Android-video-trimmer:1.6.1
from android-video-trimmer.
@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.
@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.
@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.
@a914-gowtham Could not find com.github.a914-gowtham:Android-video-trimmer:b6fe3a90f8.
from android-video-trimmer.
@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.
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.
@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.
@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.
@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. it
s 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.
@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)
- Android 12 and above version carsh HOT 3
- TrimVideo class is not found HOT 1
- Could not find com.crystal:crystalrangeseekbar:1.1.3. HOT 2
- Please add this trimmer as Separate entity, Make a copy of this trimmer without FFmpeg
- Getting this error after adding the dependenecy HOT 1
- problem with jniLibs and CMake; HOT 3
- Error after adding library
- Linking error when adding the library HOT 2
- app size is 45 MB HOT 1
- Crash on all android version HOT 2
- Fatal Exception: java.lang.IllegalArgumentException HOT 1
- HOW TO USE THIS LIB WITHOUT PICKING VIDEO FROM GALLERY HOT 2
- I am suresh, while I taken video from internalstorage video and start to edit but getting crash.please help me HOT 9
- Minor issue, facing error if video file name contains '?' or '#' HOT 1
- How do we set the output destination?
- android 13 cant trim video permission denied.WRITE_EXTERNAL_SORAGE -> READ_EXTERNAL_VIDEO HOT 7
- allow setDestination to Cache directory HOT 2
- protocol not found. "failed to trim" HOT 5
- Not able to see the video in Chrome web browser after trimming. HOT 5
- minify enabled app crashes HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-video-trimmer.