Coder Social home page Coder Social logo

no-server-webrtc-android's Introduction

serverless-webrtc-android

CircleCI

A demo of using WebRTC with no signaling server. But for Android written in Kotlin.

Compatible and inspired by this project written for JavaScript by Chris Ball:

What is WebRTC?

It's technology for real time peer to peer comunication. Especially useful for transfering audio and video - teleconference apps, but can be used for ordinary data as in this example. WebRTC is supported in recent Chrome browser, Node.js and also on Android/iOS.

How it works?

WebRTC requires two data payloads to be transferred between parties, it's called SDP (sesssion description protocol). One is called offer and the second is answer.

You can either create an offer and send it to other party or wait for an offer to be delivered to you. Usually SDP handshakes are done by special signalling server, but in this case we are not using any, so you'll need to pass SDPs manually by e.g. e-mail.

If it's running IPv4, it's very unlikely that both parties will have a public IP address or it will be on the same network. SDP requires that you'll need to pass external IP address there, this is done automatically by process called ICE gathering. It uses two types of external servers - STUN and TURN. We are using only STUN here, but it should work with TURN as well (and even better). It can even punch through some NAT mechanisms.

It uses libjingle library, it's a native library for WebRTC that comes with Chromium. There is also JNI wrapper for use in Java. You can compile it by yourself but it's extremely tricky. You can use already build dependency in your build.gradle. This helped me a lot:

Usage

Known issues

  • There is no renegotiation of connection, it doesn't make much sense without signalling server.
  • If you paste offer in the app, answer is created but after while it goes with 'icegathering failed'. You must be fast to pass the answer to the other side. I'm not sure what causes this.

License

You can do whatever you want with this code.

no-server-webrtc-android's People

Contributors

mwarning avatar wojta 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

no-server-webrtc-android's Issues

Not working after passing the other's offer as your own answer, could you please update it?

Don't know how to work.

Pass via email one device's offer to the other as an answer, not working: error message is invalid
Pass via email each other's offer and then paste as the other's answer, still not working: error message the same

Is this working for remote devices without inside a private router?

If possible, please pack it as module so that the video calling can be placed anywhere on the screen any size as needed.

Thanks for your great job!

Compiled project crashes on startup

Currently don't know why. But it seems that the code is not compiling properly with newer Android SDKs or for some other reason. Crash happens in native code. Still investigating that...
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 06-07 14:23:27.300 307-307/? A/DEBUG: Build fingerprint: 'asus/WW_Z00A/Z00A:6.0.1/MMB29P/4.21.40.223_20161216_7766_user:user/release-keys' 06-07 14:23:27.300 307-307/? A/DEBUG: Revision: '0' 06-07 14:23:27.300 307-307/? A/DEBUG: ABI: 'x86' 06-07 14:23:27.300 307-307/? A/DEBUG: pid: 16198, tid: 16292, name: worker_thread >>> cz.sazel.android.serverlesswebrtcandroid <<< 06-07 14:23:27.300 307-307/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4 06-07 14:23:27.320 307-307/? A/DEBUG: eax 00000000 ebx de8d9cb0 ecx f223da90 edx 00000004 06-07 14:23:27.320 307-307/? A/DEBUG: esi de150148 edi eec9c000 06-07 14:23:27.320 307-307/? A/DEBUG: xcs 00000023 xds 0000002b xes 0000002b xfs 00000007 xss 0000002b 06-07 14:23:27.320 307-307/? A/DEBUG: eip de2b2ae8 ebp de632da8 esp de150130 flags 00210286 06-07 14:23:27.330 307-307/? A/DEBUG: backtrace: 06-07 14:23:27.330 307-307/? A/DEBUG: #00 pc 00161ae8 /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #01 pc 0027925f /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #02 pc 0027868c /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #03 pc 002788c2 /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #04 pc 00240e1b /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #05 pc 001586c2 /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #06 pc 00158904 /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #07 pc 00141d27 /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #08 pc 0044cb1d /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #09 pc 0044cdc4 /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #10 pc 000b3c17 /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #11 pc 000b3c5c /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #12 pc 000a2214 /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #13 pc 000b3d88 /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #14 pc 000b3dec /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #15 pc 000b43d8 /data/app/cz.sazel.android.serverlesswebrtcandroid-1/lib/x86/libjingle_peerconnection_so.so 06-07 14:23:27.330 307-307/? A/DEBUG: #16 pc 000946f9 /system/lib/libc.so (_ZL15__pthread_startPv+57) 06-07 14:23:27.330 307-307/? A/DEBUG: #17 pc 0003132a /system/lib/libc.so (__start_thread+26) 06-07 14:23:27.330 307-307/? A/DEBUG: #18 pc 00017606 /system/lib/libc.so (__bionic_clone+70) 06-07 14:23:27.730 307-307/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_02

CircleCI

Add automatic building using CircleCI.

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.