8000 Add more pub point. · minorlab/flutter-webrtc@018d0e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 018d0e7

Browse files
committed
Add more pub point.
1 parent 5702341 commit 018d0e7

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

example/lib/src/get_display_media_sample.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class _GetDisplayMediaSampleState extends State<GetDisplayMediaSample> {
5252
final mediaConstraints = <String, dynamic>{'audio': true, 'video': true};
5353

5454
try {
55-
var stream = await navigator.getDisplayMedia(mediaConstraints);
55+
var stream = await navigator.mediaDevices.getDisplayMedia(mediaConstraints);
5656
stream.getVideoTracks()[0].onEnded = () {
5757
print(
5858
'By adding a listener on onEnded you can: 1) catch stop video sharing on Web');

example/lib/src/get_user_media_sample.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ class _GetUserMediaSampleState extends State<GetUserMediaSample> {
101101
_mediaRecorder = MediaRecorder();
102102
setState(() {});
103103

104-
await _localStream!.getMediaTracks();
105104
final videoTrack = _localStream!
106105
.getVideoTracks()
107106
.firstWhere((track) => track.kind == 'video');
@@ -141,7 +140,7 @@ class _GetUserMediaSampleState extends State<GetUserMediaSample> {
141140
final videoTrack = _localStream!
142141
.getVideoTracks()
143142
.firstWhere((track) => track.kind == 'video');
144-
await videoTrack.switchCamera();
143+
await Helper.switchCamera(videoTrack);
145144
}
146145

147146
void _captureFrame() async {

example/lib/src/get_user_media_sample_web.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class _GetUserMediaSampleState extends State<GetUserMediaSample> {
123123
builder: (context) => AlertDialog(
124124
content: Image.network(frame, height: 720, width: 1280),
125125
actions: <Widget>[
126-
FlatButton(
126+
TextButton(
127127
child: Text('OK'),
128128
onPressed: Navigator.of(context, rootNavigator: true).pop,
129129
)

example/pubspec.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ environment:
55
sdk: '>=2.12.0 <3.0.0'
66

77
dependencies:
8-
flutter:
9-
sdk: flutter
10-
118
# The following adds the Cupertino Icons font to your application.
129
# Use with the CupertinoIcons class for iOS style icons.
1310
cupertino_icons: ^1.0.2
11+
flutter:
12+
sdk: flutter
1413
flutter_foreground_plugin: ^0.8.0
1514
flutter_webrtc:
1615
path: ../
17-
1816
# Required for MediaRecorder example
1917
path_provider: ^2.0.1
2018

lib/src/web/media_stream_impl.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class MediaStreamWeb extends MediaStream {
5555
@override
5656
Future<void> dispose() async {
5757
getTracks().forEach((element) {
58-
element.dispose();
58+
element.stop();
5959
});
6060
return super.dispose();
6161
}

0 commit comments

Comments
 (0)
0