Skip to content

Commit e861032

Browse files
authored
fix issue 730. (#732)
1 parent fa3802b commit e861032

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

example/lib/pages/connect.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class _ConnectPageState extends State<ConnectPage> {
3838
bool _busy = false;
3939
bool _e2ee = false;
4040
bool _multiCodec = false;
41-
String _preferredCodec = 'Preferred Codec';
41+
String _preferredCodec = 'VP8';
4242

4343
@override
4444
void initState() {

lib/src/support/platform.dart

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import 'dart:io';
16-
1715
import 'platform/io.dart' if (dart.library.js_interop) 'platform/web.dart';
1816

1917
// Returns the current platform which works for both web and devices.
@@ -29,12 +27,12 @@ bool lkPlatformIsWebMobile() => lkPlatformIsWebMobileImplementation();
2927
bool lkPlatformIsDesktop() => [
3028
PlatformType.macOS,
3129
PlatformType.windows,
32-
PlatformType.linux
30+
PlatformType.linux,
3331
].contains(lkPlatform());
3432

3533
bool lkPlatformSupportsE2EE() => lkE2EESupportedImplementation();
3634

37-
bool lkPlatformIsTest() => Platform.environment.containsKey('FLUTTER_TEST');
35+
bool lkPlatformIsTest() => lkPlatformIsTestImplementation();
3836

3937
BrowserType lkBrowser() => lkBrowserImplementation();
4038

@@ -47,15 +45,7 @@ bool skipStopForTrackMute() =>
4745
(lkPlatformIs(PlatformType.web) &&
4846
[BrowserType.firefox].contains(lkBrowser()));
4947

50-
enum PlatformType {
51-
web,
52-
windows,
53-
linux,
54-
macOS,
55-
android,
56-
fuchsia,
57-
iOS,
58-
}
48+
enum PlatformType { web, windows, linux, macOS, android, fuchsia, iOS }
5949

6050
enum BrowserType {
6151
chrome,

lib/src/support/platform/io.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ bool lkPlatformIsWebMobileImplementation() {
3030
return false;
3131
}
3232

33+
bool lkPlatformIsTestImplementation() =>
34+
Platform.environment.containsKey('FLUTTER_TEST');
35+
3336
bool lkE2EESupportedImplementation() {
3437
return [
3538
PlatformType.windows,

lib/src/support/platform/web.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ bool lkE2EESupportedImplementation() {
3232
return isInsertableStreamSupported() || isScriptTransformSupported();
3333
}
3434

35+
bool lkPlatformIsTestImplementation() => false;
36+
3537
bool isScriptTransformSupported() {
3638
return web.window
3739
.hasProperty('RTCRtpScriptTransform'.toJS)
@@ -40,8 +42,9 @@ bool isScriptTransformSupported() {
4042

4143
bool isInsertableStreamSupported() {
4244
return web.window.hasProperty('RTCRtpSender'.toJS).isDefinedAndNotNull &&
43-
((web.window.getProperty('RTCRtpSender'.toJS) as JSObject)
44-
.getProperty('prototype'.toJS) as JSObject)
45+
((web.window.getProperty('RTCRtpSender'.toJS) as JSObject).getProperty(
46+
'prototype'.toJS,
47+
) as JSObject)
4548
.getProperty('createEncodedStreams'.toJS)
4649
.isDefinedAndNotNull;
4750
}

0 commit comments

Comments
 (0)