Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Navaron Bracke
2023-12-29 13:13:47 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5568383d21dfd4ead9dc2755cbb625929f57d240
5568383d
1 parent
3b7ef82a
add get constraints method
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
lib/src/web/media_track_constraints_delegate.dart
lib/src/web/media_track_constraints_delegate.dart
View file @
5568383
...
...
@@ -8,6 +8,19 @@ final class MediaTrackConstraintsDelegate {
/// Constructs a [MediaTrackConstraintsDelegate] instance.
const
MediaTrackConstraintsDelegate
();
/// Get the constraints for the given [mediaStream].
MediaTrackConstraints
?
getConstraints
(
MediaStream
?
mediaStream
)
{
final
List
<
JSAny
?>
tracks
=
mediaStream
?.
getVideoTracks
().
toDart
??
const
[];
if
(
tracks
.
isEmpty
)
{
return
null
;
}
final
MediaStreamTrack
?
track
=
tracks
.
first
as
MediaStreamTrack
?;
return
track
?.
getConstraints
();
}
/// Returns a list of supported flashlight modes for the given [mediaStream].
///
/// The [TorchState.off] mode is always supported, regardless of the return value.
...
...
Please
register
or
login
to post a comment