Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding library to my project and making a simple interop fails #13

Open
reduxdj opened this issue Dec 2, 2023 · 0 comments
Open

Adding library to my project and making a simple interop fails #13

reduxdj opened this issue Dec 2, 2023 · 0 comments

Comments

@reduxdj
Copy link

reduxdj commented Dec 2, 2023

Flutter 3.17.0-1.0.pre.3 • channel beta • https://github.com/flutter/flutter.git
Framework • revision 12b47270b7 (4 days ago) • 2023-11-27 17:21:11 -0600
Engine • revision dff66925dc ^^^^^^^^^^^

../../../.pub-cache/hosted/pub.dev/typings-0.0.4/lib/src/d/core/lib.dom.d.dart:136048:41: Error: Method not found: 'getProperty'.
static _i2.num get uniformType => _i4.getProperty(
^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/typings-0.0.4/lib/src/d/core/lib.dom.d.dart:136052:41: Error: Method not found: 'getProperty'.
static _i2.num get uniformSize => _i4.getProperty(
^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/typings-0.0.4/lib/src/d/core/lib.dom.d.dart:136056:47: Error: Method not found: 'getProperty'.
static _i2.num get uniformBlockIndex => _i4.getProperty(
^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/typings-0.0.4/lib/src/d/core/lib.dom.d.dart:136060:43: Error: Method not found: 'getProperty'.
static _i2.num get uniformOffset => _i4.getProperty(

import 'package:typings/core.dart' as js;
import 'package:dart_webrtc/src/media_stream_track_impl.dart';
import 'package:universal_html/html.dart' as html;
import 'package:flutter_webrtc/flutter_webrtc.dart';

@JS()
class AudioContext {
  external MediaStreamAudioDestinationNode createMediaStreamDestination();
  external createMediaStreamSource(MediaStream stream);
  // ... other needed methods and properties
}

@JS()
class MediaStream {
  external List<MediaStreamTrack> getTracks();
}

@JS()
class MediaStreamAudioDestinationNode {
  external MediaStream get stream;
}

// Your JsAudioContext class using typings
class JsAudioContext {
  AudioContext? audioContext;
  MediaStreamAudioDestinationNode? destinationNode;

  JsAudioContext() {
    audioContext = AudioContext();
  }

  void createMediaStreamDestination() {
    destinationNode = audioContext?.createMediaStreamDestination();
  }

  void connect(MediaStreamTrack? trackWeb) {
    // Ensure proper handling of trackWeb to MediaStream conversion
    // ...
  }

  MediaStreamTrack getMixedTrack() {
    List<dynamic> outputTrack = MediaStream().getTracks();
    MediaStreamTrack rtcTrack = MediaStreamTrackWeb(outputTrack.toList()[0] as html.MediaStreamTrack);
    return rtcTrack;
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant