organize video types
This commit is contained in:
+9
-5
@@ -1,8 +1,9 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
@@ -14,7 +15,10 @@ import 'logger.dart';
|
||||
import 'options.dart';
|
||||
import 'support/platform.dart';
|
||||
import 'track/options.dart';
|
||||
import 'types.dart';
|
||||
import 'types/other.dart';
|
||||
import 'types/video_dimensions.dart';
|
||||
import 'types/video_encoding.dart';
|
||||
import 'types/video_parameters.dart';
|
||||
|
||||
extension UriExt on Uri {
|
||||
@internal
|
||||
@@ -189,15 +193,15 @@ class Utils {
|
||||
required bool isScreenShare,
|
||||
required VideoDimensions dimensions,
|
||||
}) {
|
||||
if (isScreenShare) return VideoParameters.presetsScreenShare;
|
||||
if (isScreenShare) return VideoParametersPresets.allScreenShare;
|
||||
|
||||
final double aspect = dimensions.width > dimensions.height
|
||||
? dimensions.width / dimensions.height
|
||||
: dimensions.height / dimensions.width;
|
||||
if ((aspect - 16.0 / 9.0).abs() < (aspect - 4.0 / 3.0).abs()) {
|
||||
return VideoParameters.presets169;
|
||||
return VideoParametersPresets.all169;
|
||||
}
|
||||
return VideoParameters.presets43;
|
||||
return VideoParametersPresets.all43;
|
||||
}
|
||||
|
||||
static VideoEncoding _findAppropriateEncoding({
|
||||
|
||||
Reference in New Issue
Block a user