Giter Site home page Giter Site logo

simplewebrtcexample_ios's Introduction

SimpleWebRTCExample

This is simple WebRTC Exmaple project for iOS written in Swift. result

Feature

  • Super simple WebRTC example project written in Swift.
  • Example command lines to build WebRTC.framework.here
  • Includes prebuild WebRTC.framework here. (This is for TEST ONLY.) THIS IS REMOVED.
  • Datachannel implementation (text and bytes).
  • File Source implementation.
  • Camera position switching(tap local camera view.)
  • Includes super simple signaling server written in node.js.

Dependency

Setup

  • You need to add WebRTC.framework to your xcode project. see how_to_add If you want to build WebRTC.framework and use it, see how_to_add. Currently, this project uses GoogleWebRTC installed via pod.
  • pod install
  • You need to setup signaling server.
    This project includes simple one at SimpleWebRTCExample_iOS/SignalingServer/.
    You can setup node.js as folows.
    • cd SimpleWebRTCExample_iOS/SignalingServer
    • npm install

Usage

  • Firstly, run the signaling server as folows.
    • cd SimpleWebRTCExample_iOS/SignalingServer
    • node server.js node.js server will start at 8080 port.
  • Change signaling server url ( the ipAddress String vallue) to your case in ViewController.swift. You can find your signaling server url in signaling server log.
  • Then, run SinmpleWebRTC on your device or simulator. This example need totaly two devices(simulator & simulator is OK)
  • Check websocket connection state on your device. If it is connected, you can tap call button. WebRTC will be connected.
  • You can send like with like button. You can send plain messages with message button.
  • Enjoy.

Licence

This software is released under the MIT License, see LICENSE.

simplewebrtcexample_ios's People

Contributors

lasernite avatar tkmn0 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

simplewebrtcexample_ios's Issues

Hello ! Thanks for your project, little questions here !

Hello,

First of all thanks a lot for your project ! It helped us a lot, we are touching WebRTC for the first time !
But I have some questions, we actually have a drone (DJI Spark) and we have a Data (Array Buffer) variable.

We have the websocket server, and we actually did a call with your source code. ๐Ÿ”ฅ

So we have something like this

func videoFeed(_ videoFeed: DJIVideoFeed, didUpdateVideoData videoData: Data) {
        if !webRTCClient.isConnected {
            webRTCClient.connect(onSuccess: { (offerSDP: RTCSessionDescription) -> Void in
                self.sendSDP(sessionDescription: offerSDP)
            })
        }

        videoData.withUnsafeBytes { (bytes:UnsafePointer<UInt8>) in
           videoPreview?.push(UnsafeMutablePointer(mutating: bytes), length: Int32(videoData.count))
        }
}

But during the init of WebRTC, You are doing the creation of videoPreview with setupDataChannel. How can I change this to my videoData my videoSource with another source ?

Arigato gozaimasu !
(Trying to learn some nihongo )

Won't allow me to add WebRTC.framework

I have no idea but I am following your way but it wont allow me to add WebRTC.framwork. Obviously its the simple thing but no success.

using swift 5 & Xcode 11.3 (recently updated to) Mac OS Catalina

Authentication

Hi - thank you so much for sharing your hard work. This has helped me so much.

Do you know I could add in a simple password option so both people need to know a simple password before they are able to join?

Thanks

Server side websocket is not connected

Thanks for the good work. In local host worked perfectly. But i tried to move live server websocket is not connected. So please guide me the installation from server.

can this example run multiples devices at once ?

Hi , thank you for this project it saved me a lot of time,
i'm trying to run the example on 3 iphones to make a streaming but there only 2 that can communicate at the same time, can we make an update to make it like a chat room where they all connect to the same room to chat ?
if you just can confirm me and just give me an idea i'm still reading and trying to understand the code and how the whole application is working.
Best regards

Mix call audio with locally playing video

The more I look through your code and the project the more I love it!

Quick question - is it possible to mix the audio of the caller with a locally playing video (AVPlayer)?

Thanks again

Add Configs

  • server address
  • enabled channels (video, audio, data)

By using "GoogleWebRTC", How can we avoid NOISE SUPRESSION and ECHO CANCELLATION

Hello,

Android Platform used following stuff to avoid Noise Suppression


WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(true);
WebRtcAudioUtils.setWebRtcBasedAutomaticGainControl(true);
WebRtcAudioUtils.setWebRtcBasedNoiseSuppressor(true);

For iOS Platform


Please let me know, what to use to avoid Noise Suppression and Echo Cancellation

Thanks

Crash on call button , after web socket connected

Thanks for the code.!

I am able to run the code and run on my device and simulator. Everything works fine up to connect.

After that, When I click call button on the phone, the simulator will crash and throwing an error

No factory registered for id <CFUUID 0x60000093ff20> F8BB1C28-BAE8-11D6-9C31-00039315CD46
succeed to set local answer SDP

Simulator Screen Shot - iPhone 11 - 2020-01-17 at 20 01 41
Screen Shot 2020-01-17 at 8 02 01 PM

Error executing: gn gen out/ios_64....

Excellent instructions to generate WebRTC framework... thanks! I am trying to build the framework on a iMac with OS: 10.15.4 (I think is beta 4) and Xcode 11.4 (released)... I am very unfamiliar with the google tools and I hope to not have to learn; I prefer to be able to build my own framework.

after downloading m79 and "sync -D" I am trying to generate the 64 bit version and I get the following error:

aurel@Gaon src % gn gen out/ios_64 --args='target_os="ios" target_cpu="arm64" is_debug=false ios_enable_code_signing=false'
ERROR at //build/config/ios/ios_sdk.gni:94:21: Script returned non-zero exit code.
_ios_sdk_result = exec_script(script_name, ios_sdk_info_args, "scope")
^----------
Current dir: /Volumes/nev/webRTC/webrtc_build/src/out/ios_64/
Command: python /Volumes/nev/webRTC/webrtc_build/src/build/config/mac/sdk_info.py --get_sdk_info iphoneos
Returned 1.
stderr:

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Traceback (most recent call last):
File "/Volumes/nev/webRTC/webrtc_build/src/build/config/mac/sdk_info.py", line 106, in
FillXcodeVersion(settings, args.developer_dir)
File "/Volumes/nev/webRTC/webrtc_build/src/build/config/mac/sdk_info.py", line 57, in FillXcodeVersion
lines = subprocess.check_output(['xcodebuild', '-version']).splitlines()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 223, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['xcodebuild', '-version']' returned non-zero exit status 1

See //build/config/sysroot.gni:67:3: whence it was imported.
import("//build/config/ios/ios_sdk.gni")
^--------------------------------------
See //build/config/linux/pkg_config.gni:5:1: whence it was imported.
import("//build/config/sysroot.gni")
^----------------------------------
See //BUILD.gn:15:1: whence it was imported.
import("//build/config/linux/pkg_config.gni")
^-------------------------------------------
aurel@Gaon src %

any suggestion on how to fix? thanks!

Capture only audio

i want implement to peerconnection with audio only. But the audio it work after start capture video.

Does anyone know how to do this?

Problem With video settings please help me.

I am using your demo in my application for webrtc.. now client want tensorflow in webrtc. I am done with tensorflow but the problem with camera video settings.

if i am changing Camera Session video settings then video display like below.

IMG_E3BAD6864DB5-1

I change This code for tensor flow layout. if I am using your video type then working fine. but for tensoflow It need RGB format so I change video format. it works when I change video format.. but camera showing orange lines.

Screenshot 2022-05-01 at 1 30 54 PM

this is tansorflow layout code if i use video type "kCVPixelFormatType_420YpCbCr8BiPlanarFullRange" then it crash selected line in tensor flow

Screenshot 2022-05-01 at 1 42 28 PM

Please help on this.

WebSocket disconnects immediately

Hello,

First of all thanks a lot for your project! It helped us a lot. But I am facing WebSocket disconnect issue as soon as I launch the app. Please help, I am kind of stuck here from days

Add example of peers client

Currently, this project can only establish peer to peer connection.
And, there are some question that how to establish multiple connection. #30 #29 #27 ...

So, I created peers to handle multiple connection(signaling) for WebRTC full-mesh topology (you can try multiple connection here).

I will add peers-ios example in this project. Then everyone can play with multiple connection, I think :)

Room Concept for production

Hello,

I'm not clear how it will work for production.
So everyone will join in same server and there is no room concept as of now.
Also how will handle group video call ?
Could you please help me with these two issues ?

How to Filter local video and send to remote side?

Hello I am Implemented Using webrtc using your demo.. I like your demo..main thing in your demo is filtering. but filter work on remote side but local side red vide is display.

Can you help me Local video filter is display on local and remoter side.

Storyboard!

How I can use your project with storyboard I am not familiar with create view with code :(
98% your code :) https://github.com/saroar/WebRTCBeta.git but trying to add storyboard but can't see remote user video :( could you please help a little bit
this git use same signal server as your git use

Websocket disconnect

If i pressed hangup button websocket is disconnected. then i ll connect via server side then only websocket is connected. I can't able to connect via my app.

Adaptive front camera view for all iphone models

I noticed that the front camera view was set manually. However, I think this screen should be different size for each model, because the camera view is stuck in this view. Or can aspect fit be applied for camera container view?

Audio Quality issue

Hi ,

I have implement audio call. But in background having some noise. Please explain how to fix it.

Voice Issue

Did you notice when you talk from iPhone you listen to your own voice? i just notice when i was trying to voice all only

Simple and powerful code :)

hi try it but does work sound? do you know why?
I am using this pod > 'GoogleWebRTC', '=1.1.24717' is that reason the audio sound does not work?
do you know also who to work with callKit and PushKit?
thanks for code

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.