Restrict video send duration.

This commit is contained in:
Alan Evans
2020-11-17 17:13:46 -04:00
committed by Alex Hart
parent 95468c85a8
commit 6e7858e00f
9 changed files with 84 additions and 41 deletions

View File

@@ -14,11 +14,13 @@ import androidx.annotation.RequiresApi;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.logging.Log;
import org.thoughtcrime.securesms.mms.VideoSlide;
import org.thoughtcrime.securesms.media.DecryptableUriMediaInput;
import org.thoughtcrime.securesms.mms.VideoSlide;
import org.thoughtcrime.securesms.video.VideoUtil;
import org.thoughtcrime.securesms.video.videoconverter.VideoThumbnailsRangeSelectorView;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
/**
* The HUD (heads-up display) that contains all of the tools for editing video.
@@ -69,6 +71,8 @@ public final class VideoEditorHud extends LinearLayout {
return;
}
videoTimeLine.setTimeLimit(VideoUtil.getMaxVideoUploadDurationInSeconds(), TimeUnit.SECONDS);
videoTimeLine.setInput(DecryptableUriMediaInput.createForUri(getContext(), uri));
videoTimeLine.setOnRangeChangeListener(new VideoThumbnailsRangeSelectorView.OnRangeChangeListener() {