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

Overview

Serverless WebRTC Android Kotlin

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 & Copyright

Copyright 2021 Masoud Khoshkam.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
Youtube Android Clone 🚀an Android Youtube Clone made out of XML and Kotlin
Youtube Android Clone 🚀an Android Youtube Clone made out of XML and Kotlin

Youtube Android Clone 🚀 This app consumes The Youtube Api to fetch and display a list of popular videos, The app uses MVVM design pattern to allow se

 Music Player - This is a basic music player built with Android Studio and Kotlin
Music Player - This is a basic music player built with Android Studio and Kotlin

Music Player Made by Jenny Cárdenas This is a basic music player built with Android Studio and Kotlin, it shows two views in the UI, the user can play

iOS(iPhone & iPad) and Android Radio/Podcast Streaming Apps built in Kotlin Multiplatform Mobile (KMM) with SwiftUI & Jetpack Compose
iOS(iPhone & iPad) and Android Radio/Podcast Streaming Apps built in Kotlin Multiplatform Mobile (KMM) with SwiftUI & Jetpack Compose

iOS(iPhone & iPad) and Android Radio/Podcast Streaming Apps built in Kotlin Multiplatform Mobile (KMM) with SwiftUI & Jetpack Compose

这是一个由 kotlin 、C++ 编写的 RTMP 推流项目

AVRtmpPushSDK 欢迎关注 AVRtmpPushSDK 直播开源项目,这是一个由 kotlin 、C++ 编写的项目。整个项目完成了采集、 视音频处理、编码、数据发送前处理、数据发送的功能。整个项目支持 flv 封包,rtmp 上传,当然也向外面提供了封包和上传的相关接口。 整个项目均由个

A Custom Video Player with Controls in Kotlin
A Custom Video Player with Controls in Kotlin

UNT-Video-Player A Custom Video Player with Controls in Kotlin Hello folks, Here is the custom video player built in Kotlin; with SeekBar, fast forwar

Autodownload MP3 API With Kotlin

Autodownload MP3 API Overview This project leverages Spring Boot, Google's YouTube API, and youtube-dl to provide an API to download videos and conver

SpotiFlyer - Kotlin Multiplatform Music Downloader ,supports Spotify, Youtube, Gaana, Jio-Saavn and SoundCloud
SpotiFlyer - Kotlin Multiplatform Music Downloader ,supports Spotify, Youtube, Gaana, Jio-Saavn and SoundCloud

SpotiFlyer Kotlin Multiplatform Music Downloader ,supports Spotify, Youtube, Gaa

Youtube-dl UI - Youtube-dl ui built with kotlin and jetpack compose
Youtube-dl UI - Youtube-dl ui built with kotlin and jetpack compose

youtube-dl_UI youtube-dl ui built with kotlin and jetpack compose.

Sample HLS Video player in Kotlin with mvvm

HLSVideoPlayer Sample HLS Video player in Kotlin with mvvm Note: mvvm is partially implemented due to time constraint, so here is a scope for improvem

Owner
Masoud Khoshkam
Passionate developer with 5+ years of experience in android development. Experienced in building high-quality, secure, and performant applications.
Masoud Khoshkam
TensorFlow Lite Object Detection Android Demo

GSoC Project 2021 - TensorFlow Description This repository contains the project where I contributed to the TensorFlow Team during GSoC in the year 202

Sayan Nath 6 Dec 31, 2022
Google's ML-Kit-Vision demo (android) for pre encoded video.

Google's ML-Kit-Vision demo (android) for pre encoded video. Demos for camera preview and still image are also included. This project is actually extension of Google's own sample.

null 17 Dec 29, 2022
This is a basic demo application for exoplayer library.

ExoPlayer Demo Application This is a basic demo application for exoplayer library. It can stream these types of file: MP3 MP4 DASH HLS You can minimiz

Soumik 1 Apr 8, 2022
Echo is a lightweight and minimal music player for Android, built with Android Studio and written in Kotlin

Echo - Echo, A light-weight, minimal music player for Android, with shuffle, favorites and audio visualization

Divins Mathew 0 Feb 7, 2022
SocyMusic is an open-source Android music player written in Java with the aim of creating an easy-to-use app for exchanging and listening to top-quality music. Help us create it!

SocyMusic SocyMusic is an open-source Android music player written entirely in Java. It's objectives are to provide top-quality music to everyone for

Benji 23 Dec 26, 2022
Video/Audio Downloader for Android, written with Jetpack Compose.

Seal Video/Audio Downloader for Android, written with Jetpack Compose.

junkfood 2.1k Dec 29, 2022
Toedoe - A To-do app that made using Kotlin

Toedoe Android Study Jam It is a To-do app that I made using Kotlin in this app

Abhishek Kumar Yadav 0 Jan 7, 2022
Chess Kotlin Tornadofx - 2 player Chess using Forsyth edwards notation (Fen)

Chess_Kotlin_Tornadofx 2 player Chess using Forsyth edwards notation (Fen) , Sta

null 1 Jan 30, 2022
A modern front-end for YouTube built using Kotlin compose

A modern front-end for YouTube built using Kotlin compose, with Material You theming and many more features.

Nick 379 Jan 5, 2023
Convert your YouTube channel into a native Android app using YouTube Data API v3.

Convert your YouTube channel into an app. Screenshots • Description • Features • Configuration • Documentation Screenshots Description Channelify is a

Aculix Technologies LLP 121 Dec 26, 2022