8000 update. · next-coder/flutter-webrtc@3e1ed88 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3e1ed88

Browse files
committed
update.
1 parent 31f8d59 commit 3e1ed88

File tree

4 files changed

+18
-21
lines changed

4 files changed

+18
-21
lines changed

example/lib/main.dart

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'dart:core';
33
import 'package:flutter/foundation.dart'
44
show debugDefaultTargetPlatformOverride;
55
import 'package:flutter/material.dart';
6-
// import 'package:flutter_foreground_plugin/flutter_foreground_plugin.dart';
6+
import 'package:flutter_foreground_plugin/flutter_foreground_plugin.dart';
77
import 'package:flutter_webrtc/flutter_webrtc.dart';
88

99
import 'src/data_channel_sample.dart';
@@ -24,20 +24,20 @@ void main() {
2424
}
2525

2626
Future<bool> startForegroundService() async {
27-
// await FlutterForegroundPlugin.setServiceMethodInterval(seconds: 5);
28-
// await FlutterForegroundPlugin.setServiceMethod(globalForegroundService);
29-
// await FlutterForegroundPlugin.startForegroundService(
30-
// holdWakeLock: false,
31-
// onStarted: () {
32-
// print('Foreground on Started');
33-
// },
34-
// onStopped: () {
35-
// print('Foreground on Stopped');
36-
// },
37-
// title: 'Tcamera',
38-
// content: 'Tcamera sharing your screen.',
39-
// iconName: 'ic_stat_mobile_screen_share',
40-
// );
27+
await FlutterForegroundPlugin.setServiceMethodInterval(seconds: 5);
28+
await FlutterForegroundPlugin.setServiceMethod(globalForegroundService);
29+
await FlutterForegroundPlugin.startForegroundService(
30+
holdWakeLock: false,
31+
onStarted: () {
32+
print('Foreground on Started');
33+
},
34+
onStopped: () {
35+
print('Foreground on Stopped');
36+
},
37+
title: 'Tcamera',
38+
content: 'Tcamera sharing your screen.',
39+
iconName: 'ic_stat_mobile_screen_share',
40+
);
4141
return true;
4242
}
4343

example/lib/src/get_user_media_sample.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class _GetUserMediaSampleState extends State<GetUserMediaSample> {
6161
};
6262

6363
try {
64-
var stream = await navigator.getUserMedia(mediaConstraints);
64+
var stream = await navigator.mediaDevices.getUserMedia(mediaConstraints);
6565
_mediaDevicesList = await navigator.mediaDevices.enumerateDevices();
6666
_localStream = stream;
6767
_localRenderer.srcObject = _localStream;

example/pubspec.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ dependencies:
1111
# The following adds the Cupertino Icons font to your application.
1212
# Use with the CupertinoIcons class for iOS style icons.
1313
cupertino_icons: ^1.0.2
14-
15-
# flutter_foreground_plugin: ^0.6.0
16-
17-
14+
flutter_foreground_plugin: ^0.8.0
1815
flutter_webrtc:
1916
path: ../
2017

lib/src/interface/rtc_peerconnection.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ abstract class RTCPeerConnection {
8181

8282
Future<void> addCandidate(RTCIceCandidate candidate);
8383

84-
Future<List<StatsReport>> getStats([MediaStreamTrack track]);
84+
Future<List<StatsReport>> getStats([MediaStreamTrack? track]);
8585

8686
List<MediaStream> getLocalStreams();
8787

0 commit comments

Comments
 (0)
0