Skip to content

Commit

Permalink
Merge pull request #6 from flutter-webrtc/refactor/use-webrtc-interface
Browse files Browse the repository at this point in the history
Refactor/use webrtc interface
  • Loading branch information
cloudwebrtc authored Nov 25, 2021
2 parents 96708c3 + b3f218b commit d39592d
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 31 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog

--------------------------------------------
[1.0.1] - 2021-11-25

* Bump interface version to 1.0.1
* Reduce code.

1.0.0

* Refactor using webrtc_interface.
Expand Down
4 changes: 2 additions & 2 deletions lib/dart_webrtc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ library dart_webrtc;
export 'package:webrtc_interface/webrtc_interface.dart'
hide MediaDevices, MediaRecorder, Navigator;

export 'src/factory_impl.dart';
export 'src/media_devices.dart';
export 'src/media_recorder.dart';
export 'src/rtc_peerconnection_factory.dart';
export 'src/video_element.dart';
export 'src/rtc_video_element.dart';
21 changes: 21 additions & 0 deletions lib/src/factory_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,24 @@ class RTCFactoryWeb extends RTCFactory {
@override
Navigator get navigator => NavigatorWeb();
}

Future<RTCPeerConnection> createPeerConnection(
Map<String, dynamic> configuration,
[Map<String, dynamic>? constraints]) {
return RTCFactoryWeb.instance
.createPeerConnection(configuration, constraints);
}

Future<MediaStream> createLocalMediaStream(String label) {
return RTCFactoryWeb.instance.createLocalMediaStream(label);
}

MediaRecorder mediaRecorder() {
return RTCFactoryWeb.instance.mediaRecorder();
}

VideoRenderer videoRenderer() {
return RTCFactoryWeb.instance.videoRenderer();
}

Navigator get navigator => RTCFactoryWeb.instance.navigator;
2 changes: 1 addition & 1 deletion lib/src/media_devices.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:webrtc_interface/webrtc_interface.dart';
import '../dart_webrtc.dart';
import 'rtc_peerconnection_factory.dart';
import 'factory_impl.dart';

class MediaDevices {
@Deprecated(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/media_recorder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:webrtc_interface/src/media_recorder.dart' as _interface;
import 'package:webrtc_interface/webrtc_interface.dart';

import '../dart_webrtc.dart';
import 'rtc_peerconnection_factory.dart';
import 'factory_impl.dart';

class MediaRecorder extends _interface.MediaRecorder {
MediaRecorder() : _delegate = mediaRecorder();
Expand Down
25 changes: 0 additions & 25 deletions lib/src/rtc_peerconnection_factory.dart

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: dart_webrtc
description: Use the dart/js library to re-wrap the webrtc js interface of the browser, to adapted common browsers.
version: 1.0.0
version: 1.0.1
homepage: https://github.com/flutter-webrtc/dart-webrtc

environment:
sdk: '>=2.13.0 <3.0.0'

dependencies:
webrtc_interface: ^1.0.0
webrtc_interface: ^1.0.1

dev_dependencies:
build_runner: ^1.10.0
Expand Down

0 comments on commit d39592d

Please sign in to comment.