mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 10:58:40 +00:00
fix camera position
This commit is contained in:
parent
0177bf2a11
commit
3cab405ec3
3 changed files with 12 additions and 10 deletions
|
|
@ -727,6 +727,9 @@ Future<bool> compressVideoIfExists(int mediaUploadId) async {
|
|||
return false;
|
||||
}
|
||||
|
||||
Stopwatch stopwatch = Stopwatch();
|
||||
stopwatch.start();
|
||||
|
||||
MediaInfo? mediaInfo;
|
||||
try {
|
||||
mediaInfo = await VideoCompress.compressVideo(
|
||||
|
|
@ -737,7 +740,9 @@ Future<bool> compressVideoIfExists(int mediaUploadId) async {
|
|||
true, // https://github.com/jonataslaw/VideoCompress/issues/184
|
||||
);
|
||||
|
||||
if (mediaInfo!.filesize! >= 30 * 1000 * 1000) {
|
||||
Log.info("Video has now size of ${mediaInfo!.filesize} bytes.");
|
||||
|
||||
if (mediaInfo.filesize! >= 30 * 1000 * 1000) {
|
||||
// if the media file is over 20MB compress it with low quality
|
||||
mediaInfo = await VideoCompress.compressVideo(
|
||||
videoOriginalFile.path,
|
||||
|
|
@ -749,6 +754,8 @@ Future<bool> compressVideoIfExists(int mediaUploadId) async {
|
|||
} catch (e) {
|
||||
Log.error("during video compression: $e");
|
||||
}
|
||||
stopwatch.stop();
|
||||
Log.info("It took ${stopwatch.elapsedMilliseconds}ms to compress the video");
|
||||
|
||||
if (mediaInfo == null) {
|
||||
Log.error("could not compress video.");
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ class _HomeViewCameraPreviewState extends State<HomeViewCameraPreview> {
|
|||
!HomeViewState.cameraController!.value.isInitialized) {
|
||||
return Container();
|
||||
}
|
||||
bool isFront = HomeViewState.cameraController?.description.lensDirection ==
|
||||
CameraLensDirection.front;
|
||||
return Positioned.fill(
|
||||
child: MediaViewSizing(
|
||||
child: Screenshot(
|
||||
|
|
@ -38,10 +36,6 @@ class _HomeViewCameraPreviewState extends State<HomeViewCameraPreview> {
|
|||
HomeViewState.cameraController!.value.previewSize!.height,
|
||||
height:
|
||||
HomeViewState.cameraController!.value.previewSize!.width,
|
||||
child: Transform(
|
||||
alignment: Alignment.center,
|
||||
transform: Matrix4.rotationY(
|
||||
(isFront && Platform.isAndroid) ? 3.14 : 0),
|
||||
child: CameraPreview(HomeViewState.cameraController!),
|
||||
),
|
||||
),
|
||||
|
|
@ -49,7 +43,6 @@ class _HomeViewCameraPreviewState extends State<HomeViewCameraPreview> {
|
|||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -497,7 +497,9 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
|
|||
width: 20,
|
||||
height: 20,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 1, color: context.color.primary),
|
||||
strokeWidth: 1,
|
||||
color: context.color.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (!sharePreviewIsShown &&
|
||||
|
|
|
|||
Loading…
Reference in a new issue