Giter Site home page Giter Site logo

webrtc-kmp's Introduction

WebRTC KMP Maven Central

WebRTC Kotlin Multiplatform SDK is a comprehensive toolkit for integrating WebRTC functionality into your multiplatform projects. It supports Android, iOS, JS. Other platforms - PRs are welcome.

API implementation map

API Android iOS JS
Audio/Video
Data channel
Screen Capture

WebRTC revision

Current revision: M114

Installation

The library is published to Maven Central.

Shared module build.gradle.kts

kotlin {
  cocoapods {
    version = "1.0.0"
    summary = "Shared module"
    homepage = "not published"
    ios.deploymentTarget = "11.0"
   
    pod("WebRTC-SDK") {
      version = "114.5735.02"
      linkOnly = true
    }
  
    podfile = project.file("../iosApp/Podfile")
  
    framework {
      baseName = "shared"
      export("com.shepeliev:webrtc-kmp:$webRtcKmpVersion")
      transitiveExport = true
    }
  
    xcodeConfigurationToNativeBuildType["CUSTOM_DEBUG"] = NativeBuildType.DEBUG
    xcodeConfigurationToNativeBuildType["CUSTOM_RELEASE"] = NativeBuildType.RELEASE
  }
 
  android()
  
  ios()
  iosSimulatorArm64()
 
  js {
   useCommonJs()
   browser()
  }
  
  sourceSets {
      val commonMain by getting {
          dependencies {
              api("com.shepeliev:webrtc-kmp:$webRtcKmpVersion")
          }
      }

      val iosMain by getting
      val iosSimulatorArm64Main by getting
      iosSimulatorArm64Main.dependsOn(iosMain)
  }
}

Also add the following to your Podfile in the target section:

use_frameworks!
pod 'shared', :path => '../shared'

Usage

Please refer to sample.

Screen Share in Android

// Set MediaProjection permission intent using `MediaProjectionIntentHolder`
val mediaProjectionPermissionLauncher = rememberLauncherForActivityResult(
    contract = ActivityResultContracts.StartActivityForResult()
) { activityResult ->
    activityResult.data?.also {
        MediaProjectionIntentHolder.intent = it
    }
}

webrtc-kmp's People

Contributors

shepeliev avatar jamshedalamqaderi avatar mihai1voicescu avatar kanawish avatar renaudmathieu avatar wh173d3v11 avatar

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.