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