Giter Club home page Giter Club logo

flutterjanus / flutter_janus_client Goto Github PK

View Code? Open in Web Editor NEW
130.0 15.0 76.0 19.52 MB

A plugin that allows the flutter app to communicate with a Janus server using different transport mechanisms, such as WebSocket and HTTP(rest). It features a developer-friendly api to interact with various WebRTC Janus Plugins. Hence, it can be considered as a swiss-knife for WebRTC solutions.

License: MIT License

Java 0.04% Swift 0.40% Objective-C 0.01% Dart 86.94% HTML 0.97% CMake 4.80% C++ 5.68% C 0.38% Ruby 0.75% Shell 0.03%
janus-gateway flutter videoroom audiocall sip chat screen-capture flutter-apps webrtc videocall

flutter_janus_client's People

Contributors

allcontributors[bot] avatar baihua666 avatar chu06 avatar clon1998 avatar gitter-badger avatar kzawadi avatar lifenow avatar mazen930 avatar musagil avatar ngoluuduythai avatar sakshamgupta05 avatar shivanshtalwar avatar shivanshtalwar0 avatar usersense avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter_janus_client's Issues

Trying to create live stream using video_room

Hi @shivanshtalwar0 , So i took your advice on rtp forwarding the video room for live streaming. But I hit a snag. I am probably not using the flutter_janus_client properly. But here's what I am trying to do. Setting up the RTP forwarding needs room id and user id as seen here https://ans.disi.unitn.it/redmine/projects/peerstreamer-ng/wiki/Few_notes_on_Janus_and_its_streaming_plugin , Now the room id is already known, since i created the room with id 5555, but user id is proving problematic. I tried this piece of code

var users ={"request": "listparticipants", "room": 5555};
plugin.send(message: users, onSuccess: (){print("MILADMIN list participants");});

But I keep getting this error at backend saying Invalid request on unconfigured participant. After some searching I think i am placing the above code in the wrong place. I have tried placing it inside different 'onSuccess(){}' but keep getting same error.

So where should I place the above code, so that it runs after I have joined the room as publisher ? Also where should I place the code for streaming ? I am currently placing it inside the j.connect after the j.plugin(videoroom) ends. Do I need a new j.connect for j.plugin(streaming) ? Thanks in advance.

Close streaming session

Hi!

I faced with some problem when I want to close the stream session.
After some interval I keep recive this messages:

I/flutter ( 7607): keep live ping from rest client
I/flutter ( 7607): keep live ping from rest client
I/flutter ( 7607): {"janus": "error", "transaction": "dd39899f-6321-4c19-b586-867912e139e1", "error": {"code": 457, "reason": "Unhandled request 'keepalive' at this path"}}
I/flutter ( 7607): {"janus": "error", "transaction": "8a6786a4-08da-4c42-8c15-051a78f620e1", "error": {"code": 457, "reason": "Unhandled request 'keepalive' at this path"}}

But the "destroy" or "hangup" event on JanusClient has already been called.
What can I be missing?

Thank you

Creating and Viewing Live stream

Hi @shivanshtalwar0 , this isn't an issue with the repository itself. Need some help with setting up a live stream. I have tried using your video room example and modified it to create a live stream on one end and view it on another, so two files. Sadly on the viewing end, for some reason the stream isn't getting listed. So I tried using the pre existing Janus Id 1 stream. Still didn't work, no video received.
I think this might be due to my lack of understanding on streaming using webrtc and Janus. Can you please give me a rough idea on how to proceed. Any help would be much appreciated. Thank you.

How to get video width and height from Local Renderer and Remote Renderer?

Hello,

Thanks for this wonderful work. I've tried the example and got it working, but little confused about how to get specific width / height from the renderer inside RTCVideoView?

What I want to achieve is to make Local Renderer video box appear always on most bottom-right of the screen (the example will have some empty space on the right side because Container has fixed width and not respecting video aspect ratio.

sip call example

I'm trying to create a sip client app and I cannot find an example on the latest version. Is there a particular reason that is missing?

getDisplayMedia, getDisplayMedia error (android 12)

afbeelding

  1. One calls initializeMediaDevices with useDisplayMediaDevice set to true
  2. This will trigger an adhoc permission request, which can be denied by the user.
  3. If the user denies the permission request, getDisplayMedia will fail

This is not catched within the function, resulting in a crash.

I guess the same holds if permissions for getUserMedia are not granted, most apps check these at startup. With mediaprojection/screenshare this is not possible on newer android versions.

Two solutions:

  1. Adjusting the function
  2. Placing the initializeMediaDevices call in a try catch (Examples should use try catch as well).

The second solution could be the better one, as it enables the developer to catch the exception, but it needs to be documented.

Could not find or use auto-linked framework 'WebRTC'

I'm using Flutter on top of the native iOS application. According to this documentation, I'm inserting it like "Embed frameworks in Xcode".

Next error xCode throws: https://prnt.sc/zu7pbq
Only happens when AppDelegate.swift file has next code: GeneratedPluginRegistrant.register(with: self.flutterEngine);
https://prnt.sc/zu7vhh

Also I'm able to solve it with WebRTC from Cocoapods dependency, but this looks like not good way.

Android is fine.

Also iOS works fine until it's not integrated to native code (another app)

Problem to build video_room sample V2

Hi all,

I tried to run video_room example for Android and Ios. In Android system, my sample build, however in Ios, but I get this error:

Xcode's output:
↳
    warning: [CP] Unable to find matching .xcframework slice in 'ios-x86_64-simulator ios-arm64' for the current build architectures (arm64 x86_64 i386).
    Command CompileSwiftSources failed with a nonzero exit code
    /Users/renanprata/Projects/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.6.10+hotfix.1/ios/Classes/FlutterRTCMediaStream.m:3:9: fatal error: 'WebRTC/WebRTC.h'
    file not found
    #import <WebRTC/WebRTC.h>
            ^~~~~~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order
    warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in
    the Runner editor. (in target 'Runner' from project 'Runner')
    /Users/<>/Projects/poc_flutter_janus/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range
    of supported deployment target versions is 9.0 to 15.2.99. (in target 'Libyuv' from project 'Pods')

Follow my commands steps:

rm -rf ios
flutter clean
flutter create .
flutter pub get
flutter run

I also uncomment line platform :ios, '9.0' and update to version 10. Then I ran pod install. This problems still happen :(

In videoroom v2 example, with 3 users, only 2 videos displayed per device.

@shivanshtalwar0 I was trying out the videoroom v2 example, and kept facing the following problem:

  1. when using 3 virtual phones on my pc, each device only shows 2 videos, one from localrenderer, and another from one of the two other devices. Sometimes one of the device is only showing the local video.
  2. when using 2 virtual device, and 1 physical device, one of the virtual device shows all 3 streams, but the other virtual device and physical device only show localrenderer.

The only change to the example code I have made is the Janus url, which points to my gcp server, which hosts janus, and the username while registering so all three devices have different usernames.

My understanding of Janus and webrtc isn't really that deep, so do I need change or add something else in the example code ?

how to receive calls when app is close or background?

hello @shivanshtalwar0
I have implemented the Janus plugin for the audio and video call feature. All the feature is working fine but I want to add one more feature when the application is closed or the background incoming call is not working what I do. have you implemented anything else for this.

Build error around `RTCRtpTransceiver`

Hi, I've been trying to use this plugin on iOS and then I got error like shown below.
Even when I run example code, I got same error.

Are there any solutions for this??

How to reproduce

Run example code of the repo.

What I tried, but it didn't work

  • Delete caches
    • Delete .pub-cache/hosted folder
    • flutter clean
    • Delete Pod folder and Podfile.lock

Error

Xcode's output:
↳
    /Library/flutter/.pub-cache/git/flutter_janus_client-00ce6cd96969ee654b9aaa9e2dbfaa54ca4eb384/lib/janus_client.dart:334:18: Error: The method 'firstWhere' 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.8/lib/src/interface/rtc_rtp_transceiver.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'firstWhere'.
                    .firstWhere((element) => element.receiver.track == event.track);
                     ^^^^^^^^^^
    /Library/flutter/.pub-cache/git/flutter_janus_client-00ce6cd96969ee654b9aaa9e2dbfaa54ca4eb384/lib/janus_client.dart:344:18: Error: The method 'firstWhere' 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.8/lib/src/interface/rtc_rtp_transceiver.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'firstWhere'.
                    .firstWhere((element) => element.receiver.track == event.track);
                     ^^^^^^^^^^
    /Library/flutter/.pub-cache/git/flutter_janus_client-00ce6cd96969ee654b9aaa9e2dbfaa54ca4eb384/lib/Plugin.dart:321:50: 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.8/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) {
                                                     ^^^^^^
    /Library/flutter/.pub-cache/git/flutter_janus_client-00ce6cd96969ee654b9aaa9e2dbfaa54ca4eb384/lib/Plugin.dart:322:24: Error: The method 'forEach' 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.8/lib/src/interface/rtc_rtp_transceiver.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'forEach'.
              transceivers.forEach((t) {
                           ^^^^^^^
    /Library/flutter/.pub-cache/git/flutter_janus_client-00ce6cd96969ee654b9aaa9e2dbfaa54ca4eb384/lib/Plugin.dart:385:52: 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.8/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) {
                                                       ^^^^^^
    /Library/flutter/.pub-cache/git/flutter_janus_client-00ce6cd96969ee654b9aaa9e2dbfaa54ca4eb384/lib/Plugin.dart:386:41: Error: The type 'Future<List<RTCRtpTransceiver>>' used in the 'for' loop must implement 'Iterable<dynamic>'.
     - '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.8/lib/src/interface/rtc_rtp_transceiver.dart').
     - 'Iterable' is from 'dart:core'.
                for (RTCRtpTransceiver t in transceivers) {

Environment

flutter doctor -v

    • Flutter version 2.0.0 at /Library/flutter
    • Framework revision 60bd88df91 (13 hours ago), 2021-03-03 09:13:17 -0800
    • Engine revision 40441def69
    • Dart version 2.12.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/wakkihaya/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.53.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • iPhone SE (2nd generation) (mobile) • DB2D7F50-F4A9-4D90-819E-76BBC6BB51C4 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
    • Chrome (web)                        • chrome                               • web-javascript • Google Chrome 89.0.4389.72

Unified Plan

Great project!!

Are you planning to support unified plan?

Janus srtp

Hi @shivanshtalwar0 , I had a doubt with regards to Janus gateway, while reading the whatsapp security whitepaper. Is the video room secure or does it need some kind of additional encryption ? I tried searching for srtp in the janus documentation but it is available only for rtp_forward, and not for creating video room.
I am not really well versed in either Janus webrtc or srtp, and am using your example code as the basis of my project. Does Janus use srtp internally or is secured in some other way ? I am trying to make it end-to-end encrypted.

How to gain already created session id and handle id?

Hi,
This is not an issue but info request.
I have an application that works with freepbx voice central. everything works fine while app is in foreground. now I want to add voip notifications so that app can receive even if app is totaly closed.
in janus gateway I dont kill session and its active. when I call reconnect function when new call from other extension and its in ringing state; this function claims session but reconnect function creates new handle id and new call cant be received by app.
I just wonder if any logic to receive current call when app starts. any idea will be appriciated.
thanks.

Use of part of, should be avoided

Although this construction is present in the Dart language, it is not recommended for linking/importing files within the same library.

Also, it does not allow intellisense to check properly, potentially resulting in poorer code.

part of is actually nothing more than a placeholder construction, equivalent to putting everything in one file.

https://dart.dev/guides/libraries/create-library-packages

I guess should restructure according to the guidline.

A big advantage is that a developer using the plugin will only have to include the code regaring the janus plugin it is using. Resulting in a smaller appsize. Currently all janus plugins are included.

This potential breaking for current implementations. So propably something for a next major version.

How to test in a local network without stun and turn?

Hello,
First of all, @shivanshtalwar0, thank you for taking the initiative to bring the Janus to flutter!
A quick question: I'm trying to run some tests locally and at this moment I don't own a turn or a stun server. Once 'iceServers' are mandatory, is it possible to use JanusClient constructor like this:
JanusClient(iceServers: [], server: [
'https://my _local_ip/janus'
], withCredentials: false);
?
Another question: I'm using an Android phone to debug and I'm also experiencing what was mentioned here:
flutter-webrtc/flutter-webrtc#126
Can this being happening because the connection to the server is failing? If not, what other problems may cause this?

Thanks in advance!

Unified API Integration

Support is almost ready to be tested examples still need lot of polishing but library is working great so far
Potential issue is with flutter_webrtc we need to introduce RTCAudioRenderer for playing audio track independently

Need help with multistream

I am having some trouble with multistream. Are the steps the same as normal streaming ? I want to broadcast the streams from videoroom with 3-6 members . So I need to rtp_forward the the room to a multistream mountpoint ? How exactly should I go about it ? I have tried creating a multistream mountpoint with both audio and video in media, but it doesn't show up in the drop-down in the streaming example, only showing the default 3. Need some help with implementing.

VideoRoom: RoomId wrong type

Janus VideoRoom does not require that the roomId is of type int. It is allowed to use strings instead if the option: string_ids is set to true.

Holds also for all participants uuid.

Development

Hey, so great work on getting this far. I'm having a bit of trouble getting the project going or importing it in to a new one. I am on flutter master channel.

What's curious, I can see you are running it on Android. So I install.the app. Give the permissions manually to the camera and mic from the app settings. And then hit the call button. Nothing happens.

When I run it from iOS. I get a websocket connection. Can see the session /.IDs all created. But the app crashes.

So just wondering if I'm doing something specifically wrong. My server is already setup and running electron / browser peers via Websockets / HTTPS API

I'd like to help or fork from this project. So any insight would be awesome.

Thanks
Jay

PublishMedia in janus_video_room_plugin.dart

The createOffer method within the publishMedia gets audioRecv: false, audioSend: true, videoRecv: false, videoSend: true as input.

This should not be fixed value, but dynamic, based on the provided media. It is common to send only a videotrack during a screen share.

Audio input not working on iOS devices

Tested on Example app and implement in my App too.

When trying Android to Any Platform -> Audio input and output both are working fine.

When trying iPhone to Any Platform -> Audio input is not working but output is working fine.

null safe library

Non-nullable instance field 'publishVideo' must be initialized.
Try adding an initializer expression, or a generative constructor that initializes it

The library 'package:janus_client/Plugin.dart' is legacy, and should not be imported into a null safe library.

Audio in remote feed

Can you please help me to mute audio in remote feed. When I use getAudioTracks()[0] and I set enabled = false, I get error:
"You're trying to mute a remote track, this is not supported"
Any idea how to do it?

Destroy method

Firstly. Thank you for this huge work which you did!

I use this library for stream and when I want close my session I call janusClient.destroy() method, but still get a messages:

I/flutter (13515): polling active
I/flutter (13515): _eventHandler
I/flutter (13515): [{janus: keepalive}]
I/flutter (13515): handle event called
I/flutter (13515): {janus: keepalive}
I/flutter (13515): Got a keepalive on session 6432391342667273
I/flutter (13515): Long poll...

Am I missed something?

Could not build the application for the simulator.

`Error output from Xcode build:

** BUILD FAILED **

Xcode's output:

In file included from /Users/osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.6.3/ios/Classes/FlutterRTCVideoRenderer.m:9:
In file included from /Users/osama/Developer/wpzag/ios/Pods/Libyuv/headers/libyuv.h:16:
In file included from /Users/osama/Developer/wpzag/ios/Pods/Headers/Public/libyuv/convert.h:21:
/Users/osama/Developer/wpzag/ios/Pods/Headers/Public/libyuv/planar_functions.h:563:26: warning: this function declaration is not a prototype [-Wstrict-prototypes]
ARGBBlendRow GetARGBBlend();
^
void
1 warning generated.
/Users/osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.6.3/ios/Classes/FlutterRTCMediaStream.m:172:18: warning: unused variable 'requestAccessForVideo' [-Wunused-variable]
BOOL requestAccessForVideo
^
/Users/osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.6.3/ios/Classes/FlutterRTCMediaStream.m:369:29: warning: 'devicesWithMediaType:' is deprecated: first deprecated in iOS 10.0 - Use AVCaptureDeviceDiscoverySession instead. [-Wdeprecated-declarations]
&& [AVCaptureDevice devicesWithMediaType:mediaType].count == 0) {
^
In module 'WebRTC' imported from /Users/osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.6.3/ios/Classes/FlutterRTCMediaStream.m:3:
In module 'AVFoundation' imported from /Users/osama/Developer/wpzag/ios/Pods/GoogleWebRTC/Frameworks/frameworks/WebRTC.framework/Headers/RTCVideoFrame.h:11:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h:103:1: note: 'devicesWithMediaType:' has been explicitly marked deprecated here
+ (NSArray<AVCaptureDevice *> *)devicesWithMediaType:(AVMediaType)mediaType API_DEPRECATED("Use AVCaptureDeviceDiscoverySession instead.", ios(4.0, 10.0), macos(10.7, 10.15));
^
/Users/osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.6.3/ios/Classes/FlutterRTCMediaStream.m:451:24: warning: incompatible pointer types assigning to 'RTCCameraVideoCapturer *' from 'FlutterRPScreenRecorder *' [-Wincompatible-pointer-types]
self.videoCapturer = screenCapturer;
^ ~~~~~~~~~~~~~~
/Users/osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.6.3/ios/Classes/FlutterRTCMediaStream.m:479:44: warning: 'devicesWithMediaType:' is deprecated: first deprecated in iOS 10.0 - Use AVCaptureDeviceDiscoverySession instead. [-Wdeprecated-declarations]
NSArray *videoDevices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
^
In module 'WebRTC' imported from /Users/osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.6.3/ios/Classes/FlutterRTCMediaStream.m:3:
In module 'AVFoundation' imported from /Users/osama/Developer/wpzag/ios/Pods/GoogleWebRTC/Frameworks/frameworks/WebRTC.framework/Headers/RTCVideoFrame.h:11:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h:103:1: note: 'devicesWithMediaType:' has been explicitly marked deprecated here
+ (NSArray<AVCaptureDevice *> *)devicesWithMediaType:(AVMediaType)mediaType API_DEPRECATED("Use AVCaptureDeviceDiscoverySession instead.", ios(4.0, 10.0), macos(10.7, 10.15));
^
/Users/osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.6.3/ios/Classes/FlutterRTCMediaStream.m:488:44: warning: 'devicesWithMediaType:' is deprecated: first deprecated in iOS 10.0 - Use AVCaptureDeviceDiscoverySession instead. [-Wdeprecated-declarations]
NSArray *audioDevices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeAudio];
^
In module 'WebRTC' imported from /Users/osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.6.3/ios/Classes/FlutterRTCMediaStream.m:3:
In module 'AVFoundation' imported from /Users/osama/Developer/wpzag/ios/Pods/GoogleWebRTC/Frameworks/frameworks/WebRTC.framework/Headers/RTCVideoFrame.h:11:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h:103:1: note: 'devicesWithMediaType:' has been explicitly marked deprecated here
+ (NSArray<AVCaptureDevice *> *)devicesWithMediaType:(AVMediaType)mediaType API_DEPRECATED("Use AVCaptureDeviceDiscoverySession instead.", ios(4.0, 10.0), macos(10.7, 10.15));
^
5 warnings generated.
In file included from /Users/osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.6.3/ios/Classes/FlutterRTCFrameCapturer.m:10:
In file included from /Users/osama/Developer/wpzag/ios/Pods/Libyuv/headers/libyuv.h:16:
In file included from /Users/osama/Developer/wpzag/ios/Pods/Headers/Public/libyuv/convert.h:21:
/Users/osama/Developer/wpzag/ios/Pods/Headers/Public/libyuv/planar_functions.h:563:26: warning: this function declaration is not a prototype [-Wstrict-prototypes]
ARGBBlendRow GetARGBBlend();
^
void
1 warning generated.
Command CompileSwift failed with a nonzero exit code
/Users/osama/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/janus_client-2.0.0-beta/ios/Classes/FlutterJanusClientPlugin.m:8:9: fatal error: 'flutter_janus_client-Swift.h' file not found
#import "flutter_janus_client-Swift.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'FMDB' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'AppAuth' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'GoogleSignIn' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Libyuv' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flutter' from project 'Pods')
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')

Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.`

Sound output

When we start a stream, the sound goes to the "in-call" volume control.
Is it possible to route audio to the "media" volume control? Interested in such an opportunity on Android devices.

Thank you

WEBSOCKET

I have this weird problem....when I use HTTP everything goes well the keep alive is pinging and fine But when I use websocket....i connect and everything goes well but after 60 seconds (Defualt janus timeout) the session get terminated..(session timeout)...

if i switch to HTTP everything is fine so i think and i can HTTP sending those keepalive packets....is anything wrong

Pod install fails

I am trying to build an example for iPhone the Pod Install fails. The output of flutter run is enclosed:

Running pod install...                                              3.8s
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `flutter_webrtc` from `.symlinks/plugins/flutter_webrtc/ios`
    -> Fetching podspec for `janus_client` from `.symlinks/plugins/janus_client/ios`
    -> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`

    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
    [!] CocoaPods could not find compatible versions for pod "flutter_webrtc":
      In Podfile:
        flutter_webrtc (from `.symlinks/plugins/flutter_webrtc/ios`)

    Specs satisfying the `flutter_webrtc (from `.symlinks/plugins/flutter_webrtc/ios`)` dependency were found, but they required a higher minimum deployment target.

    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254:in `process_topmost_state'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/resolver.rb:94:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1065:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1063:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:410:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:235:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:234:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:156:in `install!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command/install.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'

Error output from CocoaPods:
↳

    [!] Automatically assigning platform `iOS` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See
    `https://guides.cocoapods.org/syntax/podfile.html#platform`.

Exception: Error running pod install

The output of pod install inside the example/ios

Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "flutter_webrtc":
  In Podfile:
    flutter_webrtc (from `.symlinks/plugins/flutter_webrtc/ios`)

Specs satisfying the `flutter_webrtc (from `.symlinks/plugins/flutter_webrtc/ios`)` dependency were found, but they required a higher minimum deployment target.

[!] Automatically assigning platform `iOS` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

Able to get pass by providing minimum version 10.0

issue with print EglRenderer logs after end call how to stop?

I Have to use Janus client for audio and video calls when I disconnect the call I have cleared all the objects and disposed of video rendering but logs are always shown in consol how to fix that

EglRenderer: Duration: 4003 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.

pin field missing in joinPublisher, videoroom plugin

A field called pin is missing as optional field in joinPublisher. Is required if a room has been created with a pin.

[ERR] [plugins/janus_videoroom.c:janus_videoroom_access_room:3955] Missing mandatory element (pin)

I will try to provide a PR later this week.

peerConnectionAddStreamFailed, peerConnection is null

Hi @shivanshtalwar0 , I am getting the following error when running the videocall and videoRoom example on android device. However on making the call, the call doesn't reach the other device. This is the error I am getting :

videocall:

2020-09-24 06:07:22.825 30773-30845/social.openbook.app.dev E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(171)] Unhandled Exception: PlatformException(peerConnectionAddStreamFailed, peerConnectionAddStream() peerConnection is null, null, null)
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:582:7)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:18)

#2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
#3 RTCPeerConnection.addStream (package:flutter_webrtc/src/rtc_peerconnection.dart:243:20)
#4 Plugin.initializeMediaDevices (package:janus_client/Plugin.dart:107:24)

#5 _VideoCallExampleState.makeCall (package:Okuna/pages/home/pages/channel_chat/janus_video_call.dart:51:24)

#6 _VideoCallExampleState.makeCallDialog.. (package:Okuna/pages/home/pages/channel_chat/janus_video_call.dart:133:21)
#7 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:993:19)
#8 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:1111:38)
#9 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:183:24)
#10 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:598:11)
#11 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:287:5)
#12 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:222:7)
#13 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:476:9)
#14 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:77:12)
#15 PointerRouter._dispatchEventToRoutes. (package:flutter/src/gestures/pointer_router.dart:122:9)
#16 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
#17 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:120:18)
#18 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:106:7)
#19 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:358:19)
#20 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:338:22)
#21 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:267:11)
#22 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:295:7)
#23 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:240:7)
#24 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:213:7)
#25 _rootRunUnary (dart:async/zone.dart:1206:13)
#26 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#27 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
#28 _invoke1 (dart:ui/hooks.dart:265:10)
#29 _dispatchPointerDataPacket (dart:ui/hooks.dart:174:5)
2020-09-24 06:07:22.829 30773-30845/social.openbook.app.dev E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(171)] Unhandled Exception: Unable to RTCPeerConnection::createOffer: peerConnection is null
#0 RTCPeerConnection.createOffer (package:flutter_webrtc/src/rtc_peerconnection.dart:220:7)

#1 Plugin.createOffer (package:janus_client/Plugin.dart:238:32)
#2 _VideoCallExampleState.makeCall (package:Okuna/pages/home/pages/channel_chat/janus_video_call.dart:61:60)
#3 _rootRunUnary (dart:async/zone.dart:1198:47)
#4 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#5 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#6 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#7 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#8 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#9 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#10 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#11 Plugin.initializeMediaDevices (package:janus_client/Plugin.dart)
#12 _rootRunUnary (dart:async/zone.dart:1198:47)
#13 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#14 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#15 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#16 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#17 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#18 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#19 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#20 MediaDevices.getUserMedia (package:flutter_webrtc/src/get_user_media.dart)
#21 _rootRunUnary (dart:async/zone.dart:1198:47)
#22 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#23 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#24 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#25 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#26 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#27 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#28 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#29 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart)
#30 _rootRunUnary (dart:async/zone.dart:1198:47)
#31 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#32 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#33 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#34 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#35 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#36 Future._asyncCompleteWithValue. (dart:async/future_impl.dart:567:7)
#37 _rootRun (dart:async/zone.dart:1190:13)
#38 _CustomZone.run (dart:async/zone.dart:1093:19)
#39 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#40 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1037:23)
#41 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#42 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)

videoroom:

2020-09-24 06:53:19.461 6265-6326/social.openbook.app.dev E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(171)] Unhandled Exception: PlatformException(peerConnectionAddStreamFailed, peerConnectionAddStream() peerConnection is null, null, null)
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:582:7)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:18)

#2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
#3 RTCPeerConnection.addStream (package:flutter_webrtc/src/rtc_peerconnection.dart:243:20)
#4 Plugin.initializeMediaDevices (package:janus_client/Plugin.dart:107:24)

#5 _VideoRoomState.initPlatformState... (package:Okuna/pages/home/pages/channel_chat/group_video.dart:130:49)
#6 JanusClient.attach (package:janus_client/janus_client.dart:364:25)
#7 _rootRunUnary (dart:async/zone.dart:1198:47)
#8 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#9 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#10 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#11 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#12 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#13 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#14 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#15 JanusClient._postRestClient (package:janus_client/janus_client.dart)
#16 _rootRunUnary (dart:async/zone.dart:1198:47)
#17 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#18 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#19 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#20 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#21 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#22 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#23 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#24 _withClient (package:http/http.dart)
#25 _rootRunUnary (dart:async/zone.dart:1198:47)
#26 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#27 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#28 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#29 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#30 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#31 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#32 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#33 Response.fromStream (package:http/src/response.dart)
#34 _rootRunUnary (dart:async/zone.dart:1198:47)
#35 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#36 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#37 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#38 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#39 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#40 Future._asyncCompleteWithValue. (dart:async/future_impl.dart:567:7)
#41 _rootRun (dart:async/zone.dart:1190:13)
#42 _CustomZone.run (dart:async/zone.dart:1093:19)
#43 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#44 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1037:23)
#45 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#46 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)

I think it might be related to the fact that jsep is null as seen from here:
print('publisheronmsg : $msg, jsep : $jsep');

publisheronmsg : {videoroom: joined, room: 1234, description: Demo Room, id: 5268502155221207, private_id: 2581568118, publishers: []}, jsep : null

Can you please help out with this ?

Web platform streams issues on Chrome/Safari browsers

1. CHROME

Demo the link https://flutterjanus.github.io/flutter_janus_client/example/build/web/#/streaming_v2 fails with next error:

  Uncaught Error: Failed to construct 'RTCPeerConnection': Plan B SDP semantics is a legacy version of the Session Description Protocol that has severe compatibility issues on modern browsers and is no longer supported. See https://www.chromestatus.com/feature/5823036655665152 for more details, including the possibility of registering for a Deprecation Trial in order to extend the Plan B deprecation deadline for a limited amount of time.
    at new WrappedRTCPeerConnection (<anonymous>:275:28)
    at Object.avJ (main.dart.js:18986)
    at main.dart.js:64533
    at adx.a (main.dart.js:13242)
    at adx.$2 (main.dart.js:32413)
    at Object.B (main.dart.js:13228)
    at a_2.a7_ (main.dart.js:64539)
    at a_2.AY (main.dart.js:64522)
    at main.dart.js:65231
    at adx.a (main.dart.js:13242)

Unified stream works fine
https://flutterjanus.github.io/flutter_janus_client/example/build/web/#/streaming_v2_unified

Chome info:
Version 96.0.4664.110 (Official Build) (x86_64)

So, should we all now switch Janus settings to Unified plan? According to this link Plan-B wouldn't be supported by Chrome.

2. On Firefox both kinds of streams work fine.

3. On Safari Streams doesn't work at all.

apiSecret not working

version: janus_client: 2.2.1
line 155 of file janus_client.dart ,
constructor of JanusClient
change
_apiSecret = _apiSecret;
to
_apiSecret = apiSecret;

Janus version

There is a small question.

What version of Janus JS was this module ported from?

Need help : Not received video

I use v0.4 with success.
I try to implement v2.2.0 in new app but i successfully send my video/sound but i never received the video/sound from it.

  _newRemoteFeed(int feed) async {
    debugPrint('[VideoRoom] New Remote Feed : ' + feed.toString());

    if (renderers.containsKey(feed)) { return; }

    // Add a new Plugin for the user
    var plugin = await session.attach<JanusVideoRoomPlugin>();
    setState(() { plugins[feed] = plugin; });

    // Prepare Video
    setState(() { renderers[feed] = RTCVideoRenderer(); });
    await renderers[feed]?.initialize();

    // Register to user
    var register = {
      "request": "join",
      "room": widget.roomNumber,
      "ptype": "subscriber",
      "feed": feed,
    };
    await plugins[feed]!.send(data: register);

    // Listen potential stream for the user
    plugins[feed]!.remoteStream!.listen((MediaStream stream) async {

      debugPrint("[VideoRoom] Stream received for $feed");

      setState(() { renderers[feed]?.srcObject = stream; });

      await _waitUntilVideoNotLoad(renderers[feed]!); // Wait for MediaStream setup ok

      setState(() { indicatorVisibility = false; });
    },
      onError: (e) { debugPrint('[VideoRoom] Listen Stream onError ' + e.toString()); },
      onDone: () { debugPrint('[VideoRoom] Listen Stream onDone'); },
    );

    // Listen messages about the user
    plugins[feed]!.messages!.listen((msg) async {
      debugPrint('[VideoRoom] New message for feed : ' + feed.toString() +
          '. Message : ' + msg.toString());

      if (msg.event['janus'] == 'event') {
        if (msg.jsep != null) {
          debugPrint('[VideoRoom] Handling sdp for feed : ' + feed.toString());
          debugPrint('[VideoRoom] RTCSessionDescription = sdp : ' + msg.jsep!.sdp! + ' || type : ' + msg.jsep!.type!);
          await plugins[feed]?.handleRemoteJsep(msg.jsep);

          var body = {"request": "start", "room": widget.roomNumber};
          await plugins[feed]?.send(
              data: body,
              jsep: await plugins[feed]?.createAnswer(
                  audioRecv: true,
                  videoRecv: true,
                  audioSend: false,
                  videoSend: false));
        }

        var pluginData = msg.event['plugindata'];
        if (pluginData != null) {
          Map<String, dynamic> data = pluginData['data'];
          if (data['videoroom'] == 'attached') {
            debugPrint('[VideoRoom] Plugin attached for feed ' + feed.toString());
          }
        }
      }
    },
      onError: (e) { debugPrint('[VideoRoom] Listen Message onError ' + e.toString()); },
      onDone: () { debugPrint('[VideoRoom] Listen Message onDone'); },);
  }
Future<void> initPlatformState() async {
    //Create Janus Client
    j = JanusClient(iceServers: [
      RTCIceServer(urls: "XXX", username: "XXX", credential: "XXX"),
      RTCIceServer(urls: "XXX", username: "XXX", credential: "XXX")
    ],
        transport: RestJanusTransport(url: 'XXX'),
        isUnifiedPlan: false,
        withCredentials: false);

    debugPrint('[VideoRoom] Try to connect to Janus Server');

    session = await j.createSession();
    plugins[0] = await session.attach<JanusVideoRoomPlugin>();

    var mediaConstraints = {
      "audio": true,
      "video": {
        "mandatory": {
          "minWidth": '640',
          "minHeight": '480',
          "minFrameRate": '60',
        },
        "facingMode": "user",
        "optional": [],
      }
    };

    var stream = await plugins[0]?.initializeMediaDevices(mediaConstraints: mediaConstraints);

    setState(() {
      renderers[0] = RTCVideoRenderer();
    });

    await renderers[0]?.initialize();

    setState(() {
      renderers[0]?.srcObject = stream;
    });

    // Join room as publisher
    var register = {
      "request": "join",
      "room": widget.roomNumber,
      "ptype": "publisher",
      "display": widget.username
    };
    await plugins[0]?.send(data: register);

    plugins[0]?.messages?.listen((msg) async {
      debugPrint('[VideoRoom] Message received : ' + msg.toString());

      if (msg.event['janus'] == 'event') {
        if (msg.jsep != null) {
          debugPrint('[VideoRoom] Handling sdp');
          debugPrint('[VideoRoom] RTCSessionDescription = sdp : ' + msg.jsep!.sdp! + ' || type : ' + msg.jsep!.type!);
          await plugins[0]?.handleRemoteJsep(msg.jsep);
        }
        var pluginData = msg.event['plugindata'];
        if (pluginData != null) {
          var data = pluginData['data'];
          if (data != null) {
            if (data["publishers"] != null) {
              List<dynamic> list = data["publishers"];
              debugPrint('[VideoRoom] Got publishers : ' + list.toString());
              for (var element in list) {
                _newRemoteFeed(element['id']);
              }
            }
            if (data['videoroom'] == 'event' &&
                data.containsKey('unpublished') ||
                data.containsKey('leaving')) {
              if (renderers.containsKey(data['unpublished'])) {
                RTCVideoRenderer? renderer;
                setState(() {
                  renderer = renderers.remove(data['unpublished']);
                });
                renderer?.srcObject = null;
              }
              if (renderers.containsKey(data['leaving'])) {
                RTCVideoRenderer? renderer;
                setState(() {
                  renderer = renderers.remove(data['leaving']);
                });
                renderer?.srcObject = null;
              }
              if (plugins.containsKey(data['unpublished'])) {
                await plugins[data['unpublished']]?.dispose();
                plugins.remove(data['unpublished']);
              }
            }
            if (data['videoroom'] == 'joined') {
              var publish = {"request": "publish", "bitrate": 10000000};
              RTCSessionDescription offer = await plugins[0]!.createOffer(
                  videoRecv: false,
                  audioRecv: false,
                  videoSend: true,
                  audioSend: true);
              await plugins[0]?.send(data: publish, jsep: offer);
            }
          }
        }
      }
    });
  }

My video/sound works for me and other users of the room.
But i never received video or sound from anyone...

Do you have an idea ? Do you see that before ?

THANKS ! :D

is there flutter sdk for janus?

i am trying to deploy own janus SFU for flutter video conference app.... i want to use my own plugin instead of janus_client flutter plugin by building own fluter sdk.. so is there any reference of flutter sdk for janus?

crash

I/org.webrtc.Logging(14526): EglRenderer: Duration: 4014 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.
I/org.webrtc.Logging(14526): EglRenderer: Duration: 4008 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.
I/FlutterWebRTCPlugin(14526): getUserMedia(audio): mandatory: [], optional: [googNoiseSuppression: true, googEchoCancellation: true, echoCancellation: true, googEchoCancellation2: true, googDAEchoCancellation: true]
E/rtc (14526): #
E/rtc (14526): # Fatal error in: ../../../../usr/local/google/home/sakal/code/webrtc-aar-release/src/pc/peer_connection.cc, line 1989
E/rtc (14526): # last system error: 0
E/rtc (14526): # Check failed: IsUnifiedPlan()
E/rtc (14526): # GetTransceivers is only supported with Unified Plan SdpSemantics.
F/libc (14526): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 14599 (signaling_threa), pid 14526 (_client_example)


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.