Giter Club home page Giter Club logo

Comments (7)

shivanshtalwar0 avatar shivanshtalwar0 commented on July 28, 2024 1

Hmm, seems like a potential memory leak, will fix it soon in next release

from flutter_janus_client.

shivanshtalwar0 avatar shivanshtalwar0 commented on July 28, 2024 1

@aevzp can you please test and see if this issue is resolved or not? also audio bridge is supported now

from flutter_janus_client.

aevzp avatar aevzp commented on July 28, 2024 1

I fixed that.

Plugin.dart
In this method need to add await:

  Future prepareTranscievers(bool offer) async {
    RTCRtpTransceiver audioTransceiver;
    RTCRtpTransceiver videoTransceiver;
    // here
    var transceivers = **await** _webRTCHandle.pc.transceivers;

janus_client:
Need a little fix in two places. Method attach:

...
        event.track.onEnded = () async {
          if (webRTCHandle.remoteStream != null) {
            webRTCHandle.remoteStream.removeTrack(event.track);
            var mid = event.track.id;
            // ======> from this
            var transceiverRaw = await peerConnection.transceivers;
            var transceiver = transceiverRaw.firstWhere((element) => element.receiver.track == event.track);
            // ======> to this
            mid = transceiver.mid;
            plugin.onRemoteTrack(event.streams[0], event.track, mid, false);
          }
        };
        event.track.onMute = () async {
          if (webRTCHandle.remoteStream != null) {
            webRTCHandle.remoteStream.removeTrack(event.track);
            var mid = event.track.id;
            // ======> from this
            var transceiverRaw = await peerConnection.transceivers;
            var transceiver = transceiverRaw.firstWhere((element) => element.receiver.track == event.track);
            // ======> to this
            mid = transceiver.mid;
            plugin.onRemoteTrack(event.streams[0], event.track, mid, false);
          }
        };
...

from flutter_janus_client.

aevzp avatar aevzp commented on July 28, 2024 1

Method destroy totally work for now! =)
Thank you.

from flutter_janus_client.

shivanshtalwar0 avatar shivanshtalwar0 commented on July 28, 2024 1

About the issue on flutter webrtc you should open issue on their repository they can give you better insights about the problem under observation
Closing this issue for now in future if you encounter any other issues related to memory leak feel free to open it again

from flutter_janus_client.

aevzp avatar aevzp commented on July 28, 2024

Great! Thank you for update!

I have some trouble with lunch library with flutter_webrtc-0.5.7:

../../Library/flutter/.pub-cache/git/flutter_janus_client-ca276fd4942bf2e533883699a1a32e0aaeed2f08/lib/Plugin.dart:308:46: Error: The getter 'length' isn't defined for the class 'Future<List<RTCRtpTransceiver>>'.
 - 'Future' is from 'dart:async'.
 - 'List' is from 'dart:core'.
 - 'RTCRtpTransceiver' is from 'package:flutter_webrtc/src/interface/rtc_rtp_transceiver.dart' ('../../Library/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.5.7/lib/src/interface/rtc_rtp_transceiver.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'length'.
    if (transceivers != null && transceivers.length > 0) {

from flutter_janus_client.

shivanshtalwar0 avatar shivanshtalwar0 commented on July 28, 2024

Hmm actually I haven't got time to test and improve streaming with unified plan if you think changes proposed by you will work with other plugins aswell in Unified plan then you are welcome to open a pull request

from flutter_janus_client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.