-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathmedia_stream_track.dart
More file actions
126 lines (97 loc) · 3.66 KB
/
Copy pathmedia_stream_track.dart
File metadata and controls
126 lines (97 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import 'dart:typed_data';
typedef StreamTrackCallback = Function();
abstract class MediaStreamTrack {
MediaStreamTrack();
/// Returns the unique identifier of the track
String? get id;
/// This may label audio and video sources (e.g., "Internal microphone" or
/// "External USB Webcam").
///
/// Returns the label of the object's corresponding source, if any.
/// If the corresponding source has or had no label, returns an empty string.
String? get label;
/// Returns the string 'audio' if this object represents an audio track
/// or 'video' if this object represents a video track.
String? get kind;
/// Callback for onmute event
StreamTrackCallback? onMute;
/// Callback for unmute event
StreamTrackCallback? onUnMute;
/// Callback for onChange event that is called when the track is enabled or disabled
StreamTrackCallback? onChange;
/// Callback for onCameraOn event that is called when the camera is enabled
StreamTrackCallback? onCameraOn;
/// Callback for onCameraOff event that is called when the camera is disabled
StreamTrackCallback? onCameraOff;
/// Callback foronended event
StreamTrackCallback? onEnded;
/// Returns the enable state of [MediaStreamTrack]
bool get enabled;
/// Set the enable state of [MediaStreamTrack]
///
/// Note: After a [MediaStreamTrack] has ended, setting the enable state
/// will not change the ended state.
set enabled(bool b);
/// Returns true if the track is muted, and false otherwise.
bool? get muted;
/// Returns a map containing the set of constraints most recently established
/// for the track using a prior call to applyConstraints().
///
/// These constraints indicate values and ranges of values that the Web site
/// or application has specified are required or acceptable for the included
/// constrainable properties.
Map<String, dynamic> getConstraints() {
throw UnimplementedError();
}
/// Applies a set of constraints to the track.
///
/// These constraints let the Web site or app establish ideal values and
/// acceptable ranges of values for the constrainable properties of the track,
/// such as frame rate, dimensions, echo cancelation, and so forth.
Future<void> applyConstraints([Map<String, dynamic>? constraints]) {
throw UnimplementedError();
}
// TODO(wermathurin): This ticket is related to the implementation of jsTrack.getCapabilities(),
// https://github.com/dart-lang/sdk/issues/44319.
//
// MediaTrackCapabilities getCapabilities() {
// throw UnimplementedError();
// }
// MediaStreamTrack clone();
Future<void> stop();
//
// https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/getSettings
//
Map<String, dynamic> getSettings() => throw UnimplementedError();
/// Throws error if switching camera failed
@Deprecated('use Helper.switchCamera() instead')
Future<bool> switchCamera() {
throw UnimplementedError();
}
@deprecated
Future<void> adaptRes(int width, int height) {
throw UnimplementedError();
}
void enableSpeakerphone(bool enable) {
throw UnimplementedError();
}
Future<ByteBuffer> captureFrame() {
throw UnimplementedError();
}
Future<bool> hasTorch() {
throw UnimplementedError();
}
Future<void> setTorch(bool torch) {
throw UnimplementedError();
}
@Deprecated('use stop() instead')
Future<void> dispose();
@override
String toString() {
return 'Track(id: $id, kind: $kind, label: $label, enabled: $enabled, muted: $muted)';
}
}
// TODO(wermathurin): Need to implement missing API
// readonly attribute MediaStreamTrackState readyState;
// MediaTrackCapabilities getCapabilities();
// MediaTrackSettings getSettings();