Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:io';
import 'package:flutter/foundation.dart'
show debugDefaultTargetPlatformOverride;

Expand All @@ -11,8 +10,9 @@ import 'src/callscreen.dart';
import 'src/about.dart';

void main() {
if (WebRTC.platformIsDesktop)
if (WebRTC.platformIsDesktop) {
debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;
}
runApp(MyApp());
}

Expand Down
20 changes: 10 additions & 10 deletions example/lib/src/callscreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class _MyCallScreenWidget extends State<CallScreenWidget>
}

void _handelStreams(CallState event) async {
var stream = event.stream;
MediaStream stream = event.stream;
if (event.originator == 'local') {
if (_localRenderer != null) {
_localRenderer.srcObject = stream;
Expand Down Expand Up @@ -238,16 +238,16 @@ class _MyCallScreenWidget extends State<CallScreenWidget>
return AlertDialog(
title: Text('Enter target to transfer.'),
content: TextField(
onChanged: (String text) {
setState(() {
_tansfer_target = text;
});
},
decoration: InputDecoration(
hintText: 'URI or Username',
),
textAlign: TextAlign.center,
onChanged: (String text) {
setState(() {
_tansfer_target = text;
});
},
decoration: InputDecoration(
hintText: 'URI or Username',
),
textAlign: TextAlign.center,
),
actions: <Widget>[
FlatButton(
child: Text('Ok'),
Expand Down
12 changes: 12 additions & 0 deletions example/lib/src/utils/dart_html_dummy.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Theses classes simply serve to remove compile errors
* when building for a flutter environment
*/
class Storage {
Map<String, String> store = Map();

String operator [](String key) => store[key];
operator []=(String key, String value) => store[key] = value;
}

dynamic window;
2 changes: 1 addition & 1 deletion example/lib/src/utils/key_value_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class KeyValueStore {
KeyValueStore();
SharedPreferences _preferences;

init() async {
void init() async {
_preferences = await SharedPreferences.getInstance();
}

Expand Down
6 changes: 3 additions & 3 deletions example/lib/src/utils/key_value_store_web.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import 'dart:async';
import 'dart:convert';
import 'dart:html';
import 'dart_html_dummy.dart' if (dart.library.js) 'dart:html';

class KeyValueStore {
KeyValueStore();
Storage _storage;

init() async {
_storage = window.localStorage;
void init() async {
_storage = window.localStorage as Storage;
}

String getString(String key) => _storage[key];
Expand Down
2 changes: 1 addition & 1 deletion lib/src/dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class Dialog {
} else if (request.cseq > this._remote_seqnum) {
this._remote_seqnum = request.cseq;
}
EventManager eventHandlers = request.server_transaction as EventManager;
EventManager eventHandlers = request.server_transaction;
// RFC3261 14.2 Modifying an Existing Session -UAS BEHAVIOR-.
if (request.method == SipMethod.INVITE ||
(request.method == SipMethod.UPDATE && request.body != null)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/logger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class MyLogPrinter extends LogPrinter {
for (Stackframe frame in frames.frames) {
i++;
var path2 = frame.sourceFile.path;
if (!path2.contains(Log._localPath)) {
if (!path2.contains(Log._localPath) && !path2.contains("logger.dart")) {
depth = i - 1;
break;
}
Expand Down
29 changes: 29 additions & 0 deletions lib/src/web_socket_dummy.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Theses classes simply serve to remove compile errors
* when building for a flutter environment
*/

class WebSocket {
static var OPEN;
static var CONNECTING;

WebSocket(String url, String s);

get onOpen => null;

get onMessage => null;

get onClose => null;

get readyState => null;

void send(data) {}

void close() {}
}

class Blob {}

dynamic callMethod(var a, var b, var c) {}

Future<dynamic> promiseToFuture(var promise) {}
3 changes: 2 additions & 1 deletion lib/src/websocket_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ class WebSocketInterface implements Socket {
this._ws.close();
}
} catch (error) {
logger.error('close() | error closing the WebSocket: ' + error);
logger
.error('close() | error closing the WebSocket: ' + error.toString());
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/src/websocket_web_impl.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'dart:html';
import 'dart:js_util' as JSUtils;
import 'web_socket_dummy.dart' if (dart.library.js) 'dart:html';
import 'web_socket_dummy.dart' if (dart.library.js) 'dart:js_util' as JSUtils;
import 'logger.dart';

typedef void OnMessageCallback(dynamic msg);
Expand Down