{"_id":"555-webrtc","_rev":"7-915946f26e1fa563ce35fd910487652b","name":"555-webrtc","dist-tags":{"latest":"1.75.3"},"versions":{"1.75.3":{"name":"555-webrtc","version":"1.75.3","keywords":["react-component","react-native","ios","android","webrtc"],"author":"","_id":"555-webrtc@1.75.3","maintainers":[{"name":"harishgupta01","email":"harish.28gupta@gmail.com"}],"homepage":"https://github.com/555platform/react-native-555-webrtc","dist":{"shasum":"80966c8786c1a539d152f867b7fc2aaf665379d3","tarball":"https://registry.npmjs.org/555-webrtc/-/555-webrtc-1.75.3.tgz","fileCount":162,"integrity":"sha512-MQXSWX8F8EgjXNzTFVgh6nA/+3KSV5+JCWP19v/xS4ncdhBgZfJLMWMOAlFFQ2VRMsvz/1ULl0FDWnPZY/mjuw==","signatures":[{"sig":"MEYCIQCI+EOSvfyfZ1wW+S0WxRW52Y0LFfswQH4cIGbzhlF5mwIhAP2mutqMspOfq+NvqdgFOEWH+dAk/gJdabEYFTPiLKp5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75019137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZRN7CRA9TVsSAnZWagAAYqsP/RLHMlnbItB16p1yEXDa\nB2BjcQZMV2SXBOcX0OsToeQ7pwEU3f5ATq8LkrIx1LGLkiMgS1hFCutCrg0n\nSbLlWsHS7USrJyssbH1OKaWTO7n6B94ervOAqDqUKyXurjhRyMOYGWxwI3O8\nMhvlCCdqCDgqJH5Xl0wuHMIsr0qNxvicyNJp4rp6u/TAo2whiybaEvrFlWEz\nByUaFZTlBmkD0COWSfoFKdB2l2UhJzjvA1wkmW+Rko+Ecc2RQIYCLG/BtgYs\ntN6im8MjOOJRQ2emI27UxRRIJGrJ/2IeKWUwT1x/IaOaNEwIPClJRmnN3efK\n1ZDZtk1qNJWnn6LX+Fm8/hfnwBkWluVBnt1Qkb34CmxeuX8hI1xHq4WTA7p3\n6aDxD0z4qzKXcp8DliUosuCJzKF8y/TDRx+G4C6l2uh0E4OplFnM3vFjFLcG\nx9cjD5k3LsEsIUz9Z5fD5Eb8eIxQuc8woP4LuDpGqpFeJejYpeQgB0oDzwH7\n5LrJ+aOy+tWqsiIcs5rBRTcmriSFDL66fqQrrLu9IModU01FV70J5A/qw1/Q\nuOzQWAtV8IxnV0kqdt6fM/NnJfKm3dPYN3m5SzyH2RMRx8jYfQzQKJ/1tklJ\ny5QX3DQ/X9qqRijrlqahwbLyM6tBIsseiHkP13oAO+VHw/bkNR9mDinI8G55\nfxJg\r\n=fM1I\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"736242b79cd9b0726f0a518855d9caf9cebcba9e","_npmUser":{"name":"harishgupta01","email":"harish.28gupta@gmail.com"},"_npmVersion":"6.13.4","description":"WebRTC for 555 Rtc React Native Sdk","directories":{},"_nodeVersion":"12.15.0","dependencies":{"uuid":"^3.3.2","base64-js":"^1.1.2","prop-types":"^15.5.10","event-target-shim":"^1.0.5"},"nativePackage":true,"_hasShrinkwrap":false,"peerDependencies":{"react-native":">=0.40.0"},"_npmOperationalInternal":{"tmp":"tmp/555-webrtc_1.75.3_1600459642192_0.779564258854603","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-09-18T20:07:22.192Z","modified":"2025-04-11T16:17:24.810Z","1.75.3":"2020-09-18T20:07:22.969Z"},"homepage":"https://github.com/555platform/react-native-555-webrtc","keywords":["react-component","react-native","ios","android","webrtc"],"description":"WebRTC for 555 Rtc React Native Sdk","maintainers":[{"email":"ayan_chakraborty@comcast.com","name":"ayan_comcast"},{"email":"vikram_singh5@comcast.com","name":"vikram_singh5"}],"readme":"# react-native-webrtc\n\n[![npm version](https://badge.fury.io/js/react-native-webrtc.svg)](https://badge.fury.io/js/react-native-webrtc)\n[![npm downloads](https://img.shields.io/npm/dm/react-native-webrtc.svg?maxAge=2592000)](https://img.shields.io/npm/dm/react-native-webrtc.svg?maxAge=2592000)\n\nA WebRTC module for React Native.\n- Support iOS / Android.\n- Support Video / Audio / Data Channels.\n\n**NOTE** for Expo users: this plugin doesn't work unless you eject.\n\n## Community\n\nEveryone is welcome to our [Discourse community](https://react-native-webrtc.discourse.group/) to discuss any React Native and WebRTC related topics.\n\n## WebRTC Revision\n\n| react-native-webrtc | WebRTC Version | arch(ios) | arch(android)  | npm published | notes |\n| :-------------: | :-------------:| :-----: | :-----: | :-----: | :-----: |\n| 1.75.2 | [M75](https://github.com/jitsi/webrtc/commit/0cd6ce4de669bed94ba47b88cb71b9be0341bb81) | x86_64<br>i386<br>armv7<br>arm64 | armeabi-v7a<br>arm64-v8a<br>x86<br>x86_64 | :heavy_check_mark: | |\n| 1.75.1 | [M75](https://github.com/jitsi/webrtc/commit/0cd6ce4de669bed94ba47b88cb71b9be0341bb81) | x86_64<br>i386<br>armv7<br>arm64 | armeabi-v7a<br>arm64-v8a<br>x86<br>x86_64 | :heavy_check_mark: | |\n| 1.75.0 | [M75](https://github.com/jitsi/webrtc/commit/0cd6ce4de669bed94ba47b88cb71b9be0341bb81) | x86_64<br>i386<br>armv7<br>arm64 | armeabi-v7a<br>arm64-v8a<br>x86<br>x86_64 | :heavy_check_mark: | |\n| 1.69.2 | [M69](https://github.com/jitsi/webrtc/tree/cb536cf7a368e77ec29a6779de7fbebf2c300b70) | x86_64<br>i386<br>armv7<br>arm64 | armeabi-v7a<br>arm64-v8a<br>x86<br>x86_64 | :heavy_check_mark: |  |\n| 1.69.1 | [M69](https://chromium.googlesource.com/external/webrtc/+/branch-heads/69)<br>[commit](https://chromium.googlesource.com/external/webrtc/+/9110a54a60d9e0c69128338fc250319ddb751b5a)<br>(24012)<br>(+16-24348) | x86_64<br>i386<br>armv7<br>arm64 | armeabi-v7a<br>arm64-v8a<br>x86<br>x86_64 | :heavy_check_mark: |  |\n| 1.69.0 | [M69](https://chromium.googlesource.com/external/webrtc/+/branch-heads/69)<br>[commit](https://chromium.googlesource.com/external/webrtc/+/9110a54a60d9e0c69128338fc250319ddb751b5a)<br>(24012)<br>(+16-24348) | x86_64<br>i386<br>armv7<br>arm64 | armeabi-v7a<br>x86 | :heavy_check_mark: |  |\n| master | [M75](https://github.com/jitsi/webrtc/commit/0cd6ce4de669bed94ba47b88cb71b9be0341bb81) | x86_64<br>i386<br>armv7<br>arm64 | armeabi-v7a<br>arm64-v8a<br>x86<br>x86_64 | :warning: | Please test! |\n\nPlease see [wiki page](https://github.com/react-native-webrtc/react-native-webrtc/wiki) about revision history.\n\n## Installation\n\n- [iOS](https://github.com/react-native-webrtc/react-native-webrtc/blob/master/Documentation/iOSInstallation.md)\n- [Android](https://github.com/react-native-webrtc/react-native-webrtc/blob/master/Documentation/AndroidInstallation.md)\n\n## Usage\nNow, you can use WebRTC like in browser.\nIn your `index.ios.js`/`index.android.js`, you can require WebRTC to import RTCPeerConnection, RTCSessionDescription, etc.\n\n```javascript\nimport {\n  RTCPeerConnection,\n  RTCIceCandidate,\n  RTCSessionDescription,\n  RTCView,\n  MediaStream,\n  MediaStreamTrack,\n  mediaDevices,\n  registerGlobals\n} from 'react-native-webrtc';\n```\nAnything about using RTCPeerConnection, RTCSessionDescription and RTCIceCandidate is like browser.\nSupport most WebRTC APIs, please see the [Document](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection).\n\n```javascript\nconst configuration = {\"iceServers\": [{\"url\": \"stun:stun.l.google.com:19302\"}]};\nconst pc = new RTCPeerConnection(configuration);\n\nlet isFront = true;\nmediaDevices.enumerateDevices().then(sourceInfos => {\n  console.log(sourceInfos);\n  let videoSourceId;\n  for (let i = 0; i < sourceInfos.length; i++) {\n    const sourceInfo = sourceInfos[i];\n    if(sourceInfo.kind == \"videoinput\" && sourceInfo.facing == (isFront ? \"front\" : \"environment\")) {\n      videoSourceId = sourceInfo.deviceId;\n    }\n  }\n  mediaDevices.getUserMedia({\n    audio: true,\n    video: {\n      mandatory: {\n        minWidth: 500, // Provide your own width, height and frame rate here\n        minHeight: 300,\n        minFrameRate: 30\n      },\n      facingMode: (isFront ? \"user\" : \"environment\"),\n      optional: (videoSourceId ? [{sourceId: videoSourceId}] : [])\n    }\n  })\n  .then(stream => {\n    // Got stream!\n  })\n  .catch(error => {\n    // Log error\n  });\n});\n\npc.createOffer().then(desc => {\n  pc.setLocalDescription(desc).then(() => {\n    // Send pc.localDescription to peer\n  });\n});\n\npc.onicecandidate = function (event) {\n  // send event.candidate to peer\n};\n\n// also support setRemoteDescription, createAnswer, addIceCandidate, onnegotiationneeded, oniceconnectionstatechange, onsignalingstatechange, onaddstream\n\n```\n\n### RTCView\n\nHowever, render video stream should be used by React way.\n\nRendering RTCView.\n\n```javascript\n<RTCView streamURL={this.state.stream.toURL()}/>\n```\n\n| Name                           | Type             | Default                   | Description                                                                                                                                |\n| ------------------------------ | ---------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\n| mirror                         | boolean          | false               | Indicates whether the video specified by \"streamURL\" should be mirrored during rendering. Commonly, applications choose to mirror theuser-facing camera.                                                                                                                       |\n| objectFit                      | string           | 'contain'           | Can be contain or cover                                                                                                | \n| streamURL                      | string           | ''                  | This is mandatory                                                                                                                      |\n| zOrder                         | number           | 0                   | Similarly to zIndex                                                                                              |\n\n\n### Custom APIs\n\n#### registerGlobals()\n\nBy calling this method the JavaScript global namespace gets \"polluted\" with the following additions:\n\n* `navigator.mediaDevices.getUserMedia()`\n* `navigator.mediaDevices.enumerateDevices()`\n* `window.RTCPeerConnection`\n* `window.RTCIceCandidate`\n* `window.RTCSessionDescription`\n* `window.MediaStream`\n* `window.MediaStreamTrack`\n\nThis is useful to make existing WebRTC JavaScript libraries (that expect those globals to exist) work with react-native-webrtc.\n\n\n#### MediaStreamTrack.prototype._switchCamera()\n\nThis function allows to switch the front / back cameras in a video track\non the fly, without the need for adding / removing tracks or renegotiating.\n\n#### VideoTrack.enabled\n\nStarting with version 1.67, when setting a local video track's enabled state to\n`false`, the camera will be closed, but the track will remain alive. Setting\nit back to `true` will re-enable the camera.\n\n## Related projects\n\n### react-native-incall-manager\n\nUse [react-native-incall-manager](https://github.com/react-native-webrtc/react-native-incall-manager) to keep screen on, mute microphone, etc.\n\n### react-native-callkeep\n\nUse [react-native-callkeep](https://github.com/react-native-webrtc/react-native-callkeep) to use callkit on iOS or connection service on Android to have native dialer with your webrtc application.\n\n## Sponsorship\nThis repository doesn't have a plan to get sponsorship.(This can be discussed afterwards by collaborators). If you would like to pay bounty to fix some bugs or get some features, be free to open a issue that adds `[BOUNTY]` category in title. Add other bounty website link like [this](https://www.bountysource.com) will be better.\n\n## Creator\nThis repository is originally created by [Wan Huang Yang](https://github.com/oney/).\n","readmeFilename":"README.md"}