diff --git a/example/lib/main.dart b/example/lib/main.dart index 7b677df..2b7af20 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -5,8 +5,6 @@ import 'package:logging/logging.dart'; import 'package:intl/intl.dart'; import 'package:responsive_builder/responsive_builder.dart'; -//import 'src/utils.dart'; - void main() { final format = DateFormat('HH:mm:ss'); // configure logs for debugging @@ -48,9 +46,6 @@ class MyHomePage extends StatelessWidget { print('Joining room: name=$name, roomName=$roomName'); } try { - //final details = await fetchConnectionDetails(name, roomName); - //await roomCtx.connect( - // url: details.serverUrl, token: details.participantToken); await roomCtx.connect( url: url, token: token, diff --git a/example/lib/src/utils.dart b/example/lib/src/utils.dart deleted file mode 100644 index 863f874..0000000 --- a/example/lib/src/utils.dart +++ /dev/null @@ -1,37 +0,0 @@ -import 'package:http/http.dart' as http; -import 'dart:convert'; - -class ConnectionDetails { - final String serverUrl; - final String roomName; - final String participantToken; - final String participantName; - - ConnectionDetails({ - required this.serverUrl, - required this.roomName, - required this.participantToken, - required this.participantName, - }); - - factory ConnectionDetails.fromJson(Map json) { - return ConnectionDetails( - serverUrl: json['serverUrl'], - roomName: json['roomName'], - participantToken: json['participantToken'], - participantName: json['participantName'], - ); - } -} - -Future fetchConnectionDetails( - String name, String roomName) async { - final response = await http.get(Uri.parse( - 'https://meet.staging.livekit.io/api/connection-details?roomName=$roomName&participantName=$name')); - if (response.statusCode == 200) { - return ConnectionDetails.fromJson( - const JsonDecoder().convert(response.body)); - } else { - throw Exception('Failed to load connection details'); - } -}