├── .gitignore ├── .npmrc ├── 404.md ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── _TODO.md ├── __who-uses-mediasoup.md ├── _art ├── favicon-dark-theme.png ├── favicon-dark-theme.svg ├── favicon-light-theme.png ├── favicon-light-theme.svg ├── logo-light-theme.png ├── mediasoup-dark-theme.png ├── mediasoup-dark-theme.svg ├── mediasoup-light-theme.png └── mediasoup-light-theme.svg ├── _compass ├── _anchor.scss ├── _api_toc.scss ├── _breadcrumbs.scss ├── _default.scss ├── _fonts.scss ├── _home.scss ├── _menu.scss ├── _mixins.scss ├── _rouge_theme.scss └── mediasoup.scss ├── _config.yml ├── _data └── compass.yml ├── _includes ├── breadcrumbs.html ├── documentation │ ├── v2 │ │ ├── mediasoup-client │ │ │ ├── api │ │ │ │ ├── Consumer.md │ │ │ │ ├── Peer.md │ │ │ │ ├── Producer.md │ │ │ │ ├── Room.md │ │ │ │ ├── Transport.md │ │ │ │ └── mediasoupClient.md │ │ │ └── index.md │ │ └── mediasoup │ │ │ ├── api │ │ │ ├── ActiveSpeakerDetector.md │ │ │ ├── Consumer.md │ │ │ ├── Peer.md │ │ │ ├── PlainRtpTransport.md │ │ │ ├── Producer.md │ │ │ ├── Room.md │ │ │ ├── RtpStreamer.md │ │ │ ├── Server.md │ │ │ ├── Transport.md │ │ │ ├── WebRtcTransport.md │ │ │ ├── errors.md │ │ │ └── mediasoup.md │ │ │ └── index.md │ └── v3 │ │ ├── libmediasoupclient │ │ ├── api │ │ │ ├── Consumer.md │ │ │ ├── ConsumerListener.md │ │ │ ├── DataConsumer.md │ │ │ ├── DataConsumerListener.md │ │ │ ├── DataProducer.md │ │ │ ├── DataProducerListener.md │ │ │ ├── Device.md │ │ │ ├── Logger.md │ │ │ ├── LoggerLogHandlerInterface.md │ │ │ ├── Producer.md │ │ │ ├── ProducerListener.md │ │ │ ├── RecvTransport.md │ │ │ ├── RecvTransportListener.md │ │ │ ├── SendTransport.md │ │ │ ├── SendTransportListener.md │ │ │ ├── Transport.md │ │ │ ├── TransportListener.md │ │ │ ├── mediasoupclient.md │ │ │ └── nlohmann-json.md │ │ └── index.md │ │ ├── mediasoup-client │ │ ├── api │ │ │ ├── Consumer.md │ │ │ ├── DataConsumer.md │ │ │ ├── DataProducer.md │ │ │ ├── Device.md │ │ │ ├── Producer.md │ │ │ ├── Transport.md │ │ │ ├── mediasoupClient.md │ │ │ └── observer-api.md │ │ └── index.md │ │ └── mediasoup │ │ ├── api │ │ ├── ActiveSpeakerObserver.md │ │ ├── AudioLevelObserver.md │ │ ├── Consumer.md │ │ ├── DataConsumer.md │ │ ├── DataProducer.md │ │ ├── DirectTransport.md │ │ ├── PipeTransport.md │ │ ├── PlainTransport.md │ │ ├── Producer.md │ │ ├── Router.md │ │ ├── RtpObserver.md │ │ ├── Transport.md │ │ ├── WebRtcServer.md │ │ ├── WebRtcTransport.md │ │ ├── Worker.md │ │ ├── mediasoup.md │ │ └── observer-api.md │ │ └── index.md ├── header.html └── menu.html ├── _layouts └── layout.html ├── _plugins ├── breadcrumbs.rb └── drops │ └── breadcrumb_item.rb ├── about.md ├── documentation ├── examples.md ├── index.md ├── overview.md ├── publications.md ├── v1 │ └── index.md ├── v2 │ ├── glossary.md │ ├── index.md │ ├── mediasoup-client │ │ ├── api.md │ │ ├── debugging.md │ │ ├── index.md │ │ └── installation.md │ ├── mediasoup-protocol.md │ ├── mediasoup │ │ ├── api.md │ │ ├── debugging.md │ │ ├── index.md │ │ └── installation.md │ └── rtc-stats.md └── v3 │ ├── communication-between-client-and-server.md │ ├── differences-between-v2-and-v3.md │ ├── index.md │ ├── libmediasoupclient │ ├── api.md │ ├── debugging.md │ ├── design.md │ ├── index.md │ └── installation.md │ ├── mediasoup-client │ ├── api.md │ ├── debugging.md │ ├── design.md │ ├── index.md │ ├── installation.md │ └── react-native.md │ ├── mediasoup │ ├── api.md │ ├── debugging.md │ ├── design.md │ ├── garbage-collection.md │ ├── index.md │ ├── installation.md │ ├── rtc-statistics.md │ ├── rtp-parameters-and-capabilities.md │ ├── sctp-parameters.md │ └── srtp-parameters.md │ ├── scalability.md │ └── tricks.md ├── faq.md ├── favicons-dark-theme ├── android-chrome-192x192.png ├── android-chrome-512x512.png ├── apple-touch-icon.png ├── browserconfig.xml ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── mstile-150x150.png ├── safari-pinned-tab.svg └── site.webmanifest ├── favicons-light-theme ├── android-chrome-192x192.png ├── android-chrome-512x512.png ├── apple-touch-icon.png ├── browserconfig.xml ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── mstile-144x144.png ├── mstile-150x150.png ├── mstile-310x150.png ├── mstile-310x310.png ├── mstile-70x70.png ├── safari-pinned-tab.svg └── site.webmanifest ├── fonts ├── Monaco.ttf ├── PoiretOne.ttf ├── PoiretOne.woff ├── Roboto-Black.ttf ├── Roboto-BlackItalic.ttf ├── Roboto-Bold.ttf ├── Roboto-BoldItalic.ttf ├── Roboto-Italic.ttf ├── Roboto-Light.ttf ├── Roboto-LightItalic.ttf ├── Roboto-Medium.ttf ├── Roboto-MediumItalic.ttf ├── Roboto-Regular.ttf ├── Roboto-Thin.ttf ├── Roboto-ThinItalic.ttf └── embed.c ├── github.md ├── gulpfile.mjs ├── images ├── arrow-up.svg ├── checkbox-off-white.svg ├── checkbox-on.svg ├── close.svg ├── diagram.svg ├── ibc.jpg ├── icon-bug.svg ├── icon-github.svg ├── icon-help.svg ├── icon-linkedin.svg ├── icon-twitter.svg ├── icon-upwork.svg ├── icon-website.svg ├── jmillan.jpg ├── mediasoup-banner.png ├── mediasoup-v3-architecture-01.svg ├── menu-white.svg ├── menu.svg ├── nazar.jpg └── toc.svg ├── index.html ├── lib ├── anchors.js ├── apiToc.js ├── arrowUp.js ├── index.js ├── loading.js ├── menu.js ├── piwik.js └── shields.js ├── license.md ├── package-lock.json ├── package.json ├── resources └── CoSMo_ComparativeStudyOfWebrtcOpenSourceSfusForVideoConferencing.pdf ├── robots.txt ├── sponsor.md └── support.md /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /js/site.js 3 | /_site 4 | /.sass-cache 5 | /.jekyll-metadata 6 | /.bundle/config 7 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=true 2 | -------------------------------------------------------------------------------- /404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : 404 3 | permalink : 404.html 4 | --- 5 | 6 | 7 | # Page not found 8 | 9 | Redirecting to the [homepage](/)... 10 | 11 | 18 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'jekyll', '~> 3.6.3' 4 | gem 'jekyll-compass', '~> 2.0.1' 5 | gem 'kramdown', '~> 1.14.0' 6 | gem 'breakpoint', '~>2.7.1' 7 | gem 'rouge', '~>2.2.1' 8 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | addressable (2.8.5) 5 | public_suffix (>= 2.0.2, < 6.0) 6 | breakpoint (2.7.1) 7 | sass (~> 3.3) 8 | sassy-maps (< 1.0.0) 9 | chunky_png (1.4.0) 10 | colorator (1.1.0) 11 | compass (1.0.3) 12 | chunky_png (~> 1.2) 13 | compass-core (~> 1.0.2) 14 | compass-import-once (~> 1.0.5) 15 | rb-fsevent (>= 0.9.3) 16 | rb-inotify (>= 0.9) 17 | sass (>= 3.3.13, < 3.5) 18 | compass-core (1.0.3) 19 | multi_json (~> 1.0) 20 | sass (>= 3.3.0, < 3.5) 21 | compass-import-once (1.0.5) 22 | sass (>= 3.2, < 3.5) 23 | ffi (1.15.5) 24 | forwardable-extended (2.6.0) 25 | jekyll (3.6.3) 26 | addressable (~> 2.4) 27 | colorator (~> 1.0) 28 | jekyll-sass-converter (~> 1.0) 29 | jekyll-watch (~> 1.1) 30 | kramdown (~> 1.14) 31 | liquid (~> 4.0) 32 | mercenary (~> 0.3.3) 33 | pathutil (~> 0.9) 34 | rouge (>= 1.7, < 3) 35 | safe_yaml (~> 1.0) 36 | jekyll-compass (2.0.1) 37 | compass (~> 1.0) 38 | jekyll (~> 3.0) 39 | jekyll-sass-converter (1.5.2) 40 | sass (~> 3.4) 41 | jekyll-watch (1.5.1) 42 | listen (~> 3.0) 43 | kramdown (1.14.0) 44 | liquid (4.0.4) 45 | listen (3.8.0) 46 | rb-fsevent (~> 0.10, >= 0.10.3) 47 | rb-inotify (~> 0.9, >= 0.9.10) 48 | mercenary (0.3.6) 49 | multi_json (1.15.0) 50 | pathutil (0.16.2) 51 | forwardable-extended (~> 2.6) 52 | public_suffix (5.0.3) 53 | rb-fsevent (0.11.2) 54 | rb-inotify (0.10.1) 55 | ffi (~> 1.0) 56 | rouge (2.2.1) 57 | safe_yaml (1.0.5) 58 | sass (3.4.25) 59 | sassy-maps (0.4.0) 60 | sass (~> 3.3) 61 | 62 | PLATFORMS 63 | arm64-darwin-23 64 | ruby 65 | x86_64-darwin-21 66 | x86_64-darwin-22 67 | 68 | DEPENDENCIES 69 | breakpoint (~> 2.7.1) 70 | jekyll (~> 3.6.3) 71 | jekyll-compass (~> 2.0.1) 72 | kramdown (~> 1.14.0) 73 | rouge (~> 2.2.1) 74 | 75 | BUNDLED WITH 76 | 2.4.1 77 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | WEBSITE LICENSE 2 | 3 | Copyright © 2015, Iñaki Baz Castillo , All Rights Reserved. 4 | -------------------------------------------------------------------------------- /_TODO.md: -------------------------------------------------------------------------------- 1 | # TODO website 2 | 3 | ## mediasoup-client 4 | 5 | * `PlainRtpParameters` defined in `Transport.ts`. Document it. 6 | -------------------------------------------------------------------------------- /__who-uses-mediasoup.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Who uses mediasoup 3 | anchors : false 4 | --- 5 | 6 | 7 | # Who uses mediasoup 8 | 9 |
10 | * Just production ready applications are listed. 11 | * We, mediasoup authors, are aware of many other companies and products using mediasoup. However they prefer not to disclosure it so we cannot list them below. 12 |
13 | 14 | 15 | ### Around / [around.co](https://around.co) 16 | 17 | ❝ _Quick, high-impact video calls for a new era of work._ ❞ 18 | 19 | ### Daily.co / [daily.co](https://daily.co) 20 | 21 | ❝ _Ship 1-click video chat faster and smarter._ ❞ 22 | 23 | 28 | 29 | ### PornHub / [pornhub.com](https://pornhub.com) 30 | 31 | Not within public domain, but figured out [here](https://mediasoup.discourse.group/t/pornhub-uses-mediasoup/685). 32 | -------------------------------------------------------------------------------- /_art/favicon-dark-theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/_art/favicon-dark-theme.png -------------------------------------------------------------------------------- /_art/favicon-dark-theme.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 24 | 49 | 51 | 52 | 54 | image/svg+xml 55 | 57 | 58 | 59 | 60 | 65 | 73 | 80 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /_art/favicon-light-theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/_art/favicon-light-theme.png -------------------------------------------------------------------------------- /_art/favicon-light-theme.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 24 | 46 | 48 | 49 | 51 | image/svg+xml 52 | 54 | 55 | 56 | 57 | 58 | 63 | 71 | 78 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /_art/logo-light-theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/_art/logo-light-theme.png -------------------------------------------------------------------------------- /_art/mediasoup-dark-theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/_art/mediasoup-dark-theme.png -------------------------------------------------------------------------------- /_art/mediasoup-light-theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/_art/mediasoup-light-theme.png -------------------------------------------------------------------------------- /_compass/_anchor.scss: -------------------------------------------------------------------------------- 1 | .anchorjs-link { 2 | opacity: 0; 3 | text-decoration: none !important; 4 | font-size: 120%; 5 | } 6 | *:hover > .anchorjs-link, 7 | .anchorjs-link:focus { 8 | /* To fade links as they appear, change transition-property from 'color' to 'all' */ 9 | opacity: 1; 10 | @include transition(color .16s linear); 11 | } 12 | 13 | .anchorjs-link:link { color: $color-text; } 14 | .anchorjs-link:visited { color: $color-text; } 15 | .anchorjs-link:hover { color: $color-highlight-2; } 16 | .anchorjs-link:active { color: $color-highlight-2; } 17 | -------------------------------------------------------------------------------- /_compass/_api_toc.scss: -------------------------------------------------------------------------------- 1 | .api-toc-button { 2 | position: fixed; 3 | z-index: 50; 4 | background: center url(/images/toc.svg) no-repeat; 5 | background-size: 50%; 6 | background-color: lighten($color-white-2, 15%); 7 | border-right: none; 8 | @include box-shadow(0px 0px 3px 0px rgba(#111, 0.35)); 9 | cursor: pointer; 10 | overscroll-behavior: contain; 11 | -webkit-tap-highlight-color: transparent; 12 | 13 | @include breakpoint($computer) { 14 | $height: 110px; 15 | $width: 56px; 16 | 17 | right: 0; 18 | top: 50%; 19 | margin-top: -$height / 2; 20 | height: $height; 21 | width: $width; 22 | } 23 | 24 | @include breakpoint($mobile) { 25 | $height: 50px; 26 | $width: 30px; 27 | 28 | right: 0; 29 | top: 50%; 30 | margin-top: -$height / 2; 31 | height: $height; 32 | width: $width; 33 | } 34 | } 35 | 36 | .api-toc-wrapper { 37 | position: fixed; 38 | z-index: 10; 39 | bottom: 0; 40 | top: 0; 41 | background-color: lighten($color-white-2, 15%); 42 | @include box-shadow(-3px 0px 8px 0px rgba(#fff, 0.25)); 43 | border-color: transparent; 44 | border-style: solid; 45 | border-width: 8px 0; 46 | font-size: 0.95rem; 47 | @include transition-duration(0.2s); 48 | overflow-y: auto; 49 | overscroll-behavior: contain; 50 | 51 | @include breakpoint($computer) { 52 | right: -500px; 53 | width: 480px; 54 | padding: 2rem 1rem; 55 | } 56 | 57 | @include breakpoint($mobile) { 58 | right: -290px; 59 | width: 260px; 60 | padding: 1rem 0.25rem; 61 | } 62 | 63 | &.visible { 64 | right: 0px; 65 | } 66 | 67 | ul { 68 | margin: 0; 69 | padding: 0; 70 | list-style: none; 71 | } 72 | 73 | a { 74 | display: inline-block; 75 | text-decoration: none; 76 | color: inherit; 77 | font-weight: inherit; 78 | text-overflow: ellipsis; 79 | white-space: nowrap; 80 | overflow: hidden; 81 | max-width: 100%; 82 | 83 | &:hover { 84 | text-decoration: underline; 85 | } 86 | } 87 | 88 | > ul { 89 | // First level. 90 | > li { 91 | display: block; 92 | margin: 1.5em 0.75em 0.25em 0.75em; 93 | font-weight: 400; 94 | color: $color-dark-2; 95 | 96 | &:first-child { 97 | margin-top: 0.75em; 98 | } 99 | 100 | // Second level. 101 | > ul { 102 | margin-left: 0.5em; 103 | 104 | > li { 105 | margin: 0 0 0.5em 0; 106 | font-size: 0.95em; 107 | font-weight: 400; 108 | color: darken($color-highlight-2, 10%); 109 | 110 | // Third level (API). 111 | > ul { 112 | > li { 113 | font-family: 'Monaco', 'Consolas', 'Andale Mono', monospace; 114 | letter-spacing: -0.04em; 115 | font-size: 0.9em; 116 | line-height: 1.3em; 117 | color: darken($color-text, 25%); 118 | } 119 | } 120 | } 121 | } 122 | } 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /_compass/_breadcrumbs.scss: -------------------------------------------------------------------------------- 1 | [data-content='breadcrumbs'] { 2 | position: absolute; 3 | 4 | @include breakpoint($computer) { 5 | top: 20px; 6 | font-size: 0.9rem; 7 | } 8 | 9 | @include breakpoint($mobile) { 10 | top: 40px; 11 | font-size: 0.65rem; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /_compass/_fonts.scss: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Monaco'; 3 | font-style: normal; 4 | src: url('/fonts/Monaco.ttf') format('truetype'); 5 | } 6 | 7 | @font-face { 8 | font-family: 'Poiret One'; 9 | font-style: normal; 10 | font-weight: 400; 11 | src: 12 | url('/fonts/PoiretOne.ttf') format('truetype'), 13 | url('/fonts/PoiretOne.woff') format('woff'); 14 | } 15 | 16 | @font-face { 17 | font-family: 'Roboto'; 18 | font-style: normal; 19 | font-weight: 300; 20 | src: 21 | local('Roboto Light'), 22 | local('Roboto-Light'), 23 | url('/fonts/Roboto-Light.ttf') format('truetype'); 24 | } 25 | @font-face { 26 | font-family: 'Roboto'; 27 | font-style: normal; 28 | font-weight: 400; 29 | src: 30 | local('Roboto'), 31 | local('Roboto-Regular'), 32 | url('/fonts/Roboto-Regular.ttf') format('truetype'); 33 | } 34 | @font-face { 35 | font-family: 'Roboto'; 36 | font-style: normal; 37 | font-weight: 500; 38 | src: 39 | local('Roboto Medium'), 40 | local('Roboto-Medium'), 41 | url('/fonts/Roboto-Medium.ttf') format('truetype'); 42 | } 43 | @font-face { 44 | font-family: 'Roboto'; 45 | font-style: normal; 46 | font-weight: 500; 47 | src: 48 | local('Roboto Bold'), 49 | local('Roboto-Bold'), 50 | url('/fonts/Roboto-Bold.ttf') format('truetype'); 51 | } 52 | -------------------------------------------------------------------------------- /_compass/_menu.scss: -------------------------------------------------------------------------------- 1 | > .menu { 2 | $width: 250px; 3 | 4 | position: fixed; 5 | z-index: 100; 6 | top: 0; 7 | // Hide the lateral shadow. 8 | right: -$width - 5px; 9 | width: $width; 10 | // Trick to avoid menu flash effect in mobile. 11 | height: 110%; 12 | padding-bottom: 10%; 13 | overflow: auto; 14 | overscroll-behavior: contain; 15 | background-color: lighten($color-white-2, 15%); 16 | @include box-shadow(-3px 0px 8px 0px rgba(#fff, 0.25)); 17 | @include transition-property(right); 18 | @include transition-duration(0.15s); 19 | 20 | &.visible { 21 | right: 0; 22 | 23 | > .container > .close { 24 | @include transition-delay(0.25s); 25 | @include transform(scale(1)); 26 | } 27 | } 28 | 29 | > .container { 30 | @include breakpoint($computer) { 31 | padding: 64px 8px 8px 8px; 32 | } 33 | 34 | @include breakpoint($mobile) { 35 | padding: 48px 6px 6px 6px; 36 | } 37 | 38 | > .close { 39 | position: absolute; 40 | top: 12px; 41 | right: 16px; 42 | height: 32px; 43 | width: 32px; 44 | background-size: 24px; 45 | background-image: url('/images/close.svg'); 46 | background-position: center; 47 | background-repeat: no-repeat; 48 | cursor: pointer; 49 | opacity: 0.9; 50 | @include transform(scale(0)); 51 | @include transition-property(opacity, transform); 52 | @include transition-duration(0.25s); 53 | -webkit-tap-highlight-color: transparent; 54 | 55 | &:hover { 56 | @include transition-delay(0s); 57 | opacity: 1; 58 | } 59 | } 60 | 61 | > a { 62 | display: block; 63 | padding: 0.7em 1em; 64 | color: rgba($color-dark-2, 0.75); 65 | text-align: left; 66 | text-decoration: none; 67 | border-radius: 4px; 68 | @include transition-property(color, background-color); 69 | @include transition-duration(0.05s); 70 | 71 | @include breakpoint($computer) { 72 | font-size: 1.1rem; 73 | font-weight: 400; 74 | } 75 | 76 | @include breakpoint($mobile) { 77 | font-size: 1rem; 78 | font-weight: 400; 79 | } 80 | 81 | &:hover { 82 | color: $color-dark-2; 83 | background-color: rgba(#fff, 1); 84 | } 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /_compass/_mixins.scss: -------------------------------------------------------------------------------- 1 | @mixin mediasoup-gradient() { 2 | @include background-image(linear-gradient( 3 | 0deg, $color-highlight-2 10%, 4 | $color-highlight-1 100%)); 5 | background-clip: text; 6 | -webkit-background-clip: text; 7 | text-fill-color: transparent; 8 | -webkit-text-fill-color: transparent; 9 | } 10 | 11 | @mixin mediasoup-logo($light: true) { 12 | font-family: 'Poiret One'; 13 | letter-spacing: -0.04em; 14 | @if ($light) { 15 | color: $color-white-2; 16 | } @else { 17 | color: $color-dark; 18 | } 19 | -webkit-tap-highlight-color: transparent; 20 | 21 | span.small { 22 | font-size: 0.85em; 23 | } 24 | 25 | span.merge { 26 | letter-spacing: -0.1em; 27 | } 28 | 29 | span.highlight { 30 | @include mediasoup-gradient(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /_compass/_rouge_theme.scss: -------------------------------------------------------------------------------- 1 | pre.highlight { 2 | overflow: auto; 3 | width: 100%; 4 | margin: 0 auto; 5 | padding: 1.2em; 6 | border-radius: 4px; 7 | background: $color-dark; 8 | border: 1px solid rgba($color-white-2, 0.15); 9 | font-size: 0.85em; 10 | font-family: 'Monaco', 'Andale Mono', monospace; 11 | text-align: left; 12 | white-space: pre; 13 | word-spacing: normal; 14 | word-break: normal; 15 | word-wrap: normal; 16 | line-height: 1.5; 17 | -moz-tab-size: 4; 18 | -o-tab-size: 4; 19 | tab-size: 4; 20 | @include hyphens(none); 21 | // Default color. 22 | color: #d7d7d7; 23 | opacity: 0.75; 24 | 25 | .hll { background-color: #49483e } 26 | .c { color: #908d7f; } /* comment */ 27 | .err { color: #960050; background-color: #1e0010; } /* error */ 28 | .k { color: #f9ee9a; } /* keyword */ 29 | .l { color: #ffe081; } /* literal */ 30 | .n { color: #f8f8f2; } /* name */ 31 | .o { color: #a1e075; } /* operator */ 32 | .p { color: rgba(#fff, 0.55); } /* punctuation */ 33 | .cm { color: #908d7f; } /* comment.multiline */ 34 | .cp { color: #908d7f; } /* comment.preproc */ 35 | .c1 { color: #908d7f; } /* comment.single */ 36 | .cs { color: #908d7f; } /* comment.special */ 37 | .ge { font-style: italic; } /* generic.emph */ 38 | .gs { font-weight: bold; } /* generic.strong */ 39 | .kc { color: #ff8d26; } /* keyword.constant */ 40 | .kd { color: #f9ee9a; } /* keyword.declaration */ 41 | .kn { color: #a1e075; } /* keyword.namespace */ 42 | .kp { color: #f9ee9a; } /* keyword.pseudo */ 43 | .kr { color: #ff8d26; } /* keyword.reserved */ 44 | .kt { color: #f9ee9a; } /* keyword.type */ 45 | .ld { color: #63d3f2; } /* literal.date */ 46 | .m { color: #ffe081; } /* literal.number */ 47 | .s { color: #63d3f2; } /* literal.string */ 48 | .na { color: #cccccc; } /* name.attribute */ 49 | .nb { color: #f8f8f2; } /* name.builtin */ 50 | .nc { color: #e5e5e5; } /* name.class */ 51 | .no { color: #f9ee9a; } /* name.constant */ 52 | .nd { color: #e5e5e5; } /* name.decorator */ 53 | .ni { color: #f8f8f2; } /* name.entity */ 54 | .ne { color: #e5e5e5; } /* name.exception */ 55 | .nf { color: #e5e5e5; } /* name.function */ 56 | .nl { color: #f8f8f2; } /* name.label */ 57 | .nn { color: #f8f8f2; } /* name.namespace */ 58 | .nx { color: #e5e5e5; } /* name.other */ 59 | .py { color: #f8f8f2; } /* name.property */ 60 | .nt { color: #a1e075; } /* name.tag */ 61 | .nv { color: #f8f8f2; } /* name.variable */ 62 | .ow { color: #a1e075; } /* operator.word */ 63 | .w { color: #f8f8f2; } /* text.whitespace */ 64 | .mf { color: #ffe081; } /* literal.number.float */ 65 | .mh { color: #ffe081; } /* literal.number.hex */ 66 | .mi { color: #ffe081; } /* literal.number.integer */ 67 | .mo { color: #ffe081; } /* literal.number.oct */ 68 | .sb { color: #63d3f2; } /* literal.string.backtick */ 69 | .sc { color: #63d3f2; } /* literal.string.char */ 70 | .sd { color: #63d3f2; } /* literal.string.doc */ 71 | .s2 { color: #63d3f2; } /* literal.string.double */ 72 | .se { color: #ffe081; } /* literal.string.escape */ 73 | .sh { color: #63d3f2; } /* literal.string.heredoc */ 74 | .si { color: #63d3f2; } /* literal.string.interpol */ 75 | .sx { color: #63d3f2; } /* literal.string.other */ 76 | .sr { color: #63d3f2; } /* literal.string.regex */ 77 | .s1 { color: #63d3f2; } /* literal.string.single */ 78 | .ss { color: #63d3f2; } /* literal.string.symbol */ 79 | .bp { color: #f8f8f2; } /* name.builtin.pseudo */ 80 | .vc { color: #f8f8f2; } /* name.variable.class */ 81 | .vg { color: #f8f8f2; } /* name.variable.global */ 82 | .vi { color: #f8f8f2; } /* name.variable.instance */ 83 | .il { color: #ffe081; } /* literal.number.integer.long */ 84 | 85 | .gh { } /* generic heading & diff header */ 86 | .gu { color: #908d7f; } /* generic.subheading & diff unified/comment? */ 87 | .gd { color: #a1e075; } /* generic.deleted & diff deleted */ 88 | .gi { color: #e5e5e5; } /* generic.inserted & diff inserted */ 89 | } 90 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # source: . 2 | 3 | exclude: 4 | - NO_GIT 5 | - Gemfile 6 | - Gemfile.lock 7 | - package.json 8 | - node_modules 9 | - lib 10 | - gulpfile.js 11 | - LICENSE 12 | 13 | markdown: kramdown 14 | 15 | kramdown: 16 | input: GFM 17 | auto_ids: false 18 | toc_levels: 2..4 19 | # Remove typographic single quotes (but allow typographic double quotes). 20 | smart_quotes: [ 'apos', 'apos', 'ldquo', 'rdquo' ] 21 | syntax_highlighter: rouge 22 | 23 | plugins: 24 | - jekyll-compass 25 | - breakpoint 26 | - rouge 27 | 28 | permalink: pretty 29 | 30 | defaults: 31 | - 32 | scope: 33 | path: '' 34 | values: 35 | layout: layout 36 | 37 | custom: 38 | canonicalUrl: 'https://mediasoup.org' 39 | -------------------------------------------------------------------------------- /_data/compass.yml: -------------------------------------------------------------------------------- 1 | --- 2 | require: 3 | - jekyll-compass 4 | project_path: './' 5 | http_path: '/' 6 | css_dir: css 7 | sass_dir: _compass 8 | images_dir: images 9 | javascripts_dir: js 10 | output_style: compressed 11 | --- 12 | -------------------------------------------------------------------------------- /_includes/breadcrumbs.html: -------------------------------------------------------------------------------- 1 |
2 | {% for crumb in breadcrumbs %} 3 | / 4 | {% if crumb.url == '/' %} 5 | home 6 | {% else %} 7 | {% if page.url != crumb.url %} 8 | {{ crumb.title }} 9 | {% else %} 10 | {{ crumb.title }} 11 | {% endif %} 12 | {% endif %} 13 | {% endfor %} 14 |
15 | -------------------------------------------------------------------------------- /_includes/documentation/v2/mediasoup-client/api/Peer.md: -------------------------------------------------------------------------------- 1 | ## Peer 2 | {: #Peer} 3 | 4 | A `peer` is the local representation of a remote `peer`. 5 | 6 | For more information, check the [Glossary](/documentation/v2/glossary/#Glossary-Peer) section. 7 | 8 | 9 | ### Properties 10 | {: #Peer-properties} 11 | 12 |
13 | 14 | #### peer.name 15 | {: #peer-name .code} 16 | 17 | * Read only 18 | 19 | The `name` (String) of the remote `peer`. 20 | 21 | #### peer.closed 22 | {: #peer-closed .code} 23 | 24 | * Read only 25 | 26 | A Boolean indicating whether the `peer` has been closed. 27 | 28 | #### peer.appData 29 | {: #peer-appData .code} 30 | 31 | * Read-write 32 | 33 | Custom data set by the remote application. 34 | 35 | #### peer.consumers 36 | {: #peer-consumers .code} 37 | 38 | * Read only 39 | 40 | An Array with the list of [Consumer](#Consumer) instances associated to the remote `peer` in the order in which they were created. 41 | 42 |
43 | 44 | 45 | ### Methods 46 | {: #Peer-methods} 47 | 48 |
49 | 50 | #### peer.getConsumerById(id) 51 | {: #peer-getConsumerById .code} 52 | 53 | Retrieves the [Consumer](#Consumer) with the given `id`, or `undefined` if not found. 54 | 55 |
56 | 57 | Argument | Type | Description | Required | Default 58 | ---------- | ------- | ----------- | -------- | ---------- 59 | `id` | Number | Consumer id. | Yes | 60 | 61 |
62 | 63 |
64 | 65 | 66 | ### Events 67 | {: #Peer-events} 68 | 69 | The `Peer` class inherits from [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter). 70 | 71 |
72 | 73 | #### peer.on("close", fn()) 74 | {: #peer-on-close .code} 75 | 76 | Emitted when the remote `peer` is closed or leaves the `room`. 77 | 78 | #### peer.on("newconsumer", fn(consumer)) 79 | {: #peer-on-notify .code} 80 | 81 | Emitted when a new `consumer` is created for receiving new media produced by the remote `peer`. 82 | 83 |
84 | 85 | Argument | Type | Description 86 | -------- | ------- | ---------------- 87 | `consumer` | [Consumer](#Consumer) | New `consumer`. 88 | 89 |
90 | 91 |
92 | -------------------------------------------------------------------------------- /_includes/documentation/v2/mediasoup-client/api/mediasoupClient.md: -------------------------------------------------------------------------------- 1 | ## mediasoupClient 2 | {: #mediasoupClient} 3 | 4 | The top-level module exported by the mediasoup-client library. 5 | 6 | ```typescript 7 | import * as mediasoupClient from "mediasoup-client"; 8 | ``` 9 | 10 | or 11 | 12 | ```javascript 13 | const mediasoupClient = require("mediasoup-client"); 14 | ``` 15 | 16 | 17 | ### Dictionaries 18 | {: #mediasoupClient-dictionaries} 19 | 20 |
21 | 22 | #### DeviceInfo 23 | {: #mediasoupClient-DeviceInfo .code} 24 | 25 |
26 | 27 | Field | Type | Description 28 | ----------- | ------- | ------------- 29 | `flag` | String | Browser/device identifier. 30 | `name` | String | Browser/device descriptive name (taken from `User-Agent`. 31 | `version` | String | Browser/device version. 32 | `bowser` | Object | Object produced by the `_detect()` method of the [bowser](https://www.npmjs.com/package/bowser) library. 33 | 34 |
35 | 36 |
37 | Current `flag` values can be: 38 | 39 | * "chrome" 40 | * "firefox" 41 | * "safari" 42 | * "msedge" 43 | * "opera" 44 | * `custom` (see [setDeviceHandler](#mediasoupClient-setDeviceHandler)) 45 |
46 | 47 |
48 | 49 | 50 | ### Properties 51 | {: #mediasoupClient-properties} 52 | 53 |
54 | 55 | #### mediasoupClient.internals 56 | {: #mediasoupClient-internals .code} 57 | 58 | Exposes the [internals](https://github.com/versatica/mediasoup-client/blob/v2/lib/internals.js) property. 59 | 60 |
61 | 62 | 63 | ### Functions 64 | {: #mediasoupClient-functions} 65 | 66 |
67 | 68 | #### mediasoupClient.setDeviceHandler(handler, metadata) 69 | {: #mediasoupClient-setDeviceHandler .code} 70 | 71 | Set a custom device handler that mediasoup-client will use instead of any builtin one. 72 | 73 |
74 | 75 | Argument | Type | Description | Required | Default 76 | ---------- | ------- | ----------- | -------- | ---------- 77 | `handler` | [DeviceHandler](https://github.com/versatica/mediasoup-client/blob/v2/lib/handlers) | Custom device handler. | Yes | 78 | `metadata` | [DeviceInfo](#mediasoupClient-DeviceInfo) | Custom device info. | Yes | 79 | 80 |
81 | 82 | #### mediasoupClient.isDeviceSupported() 83 | {: #mediasoupClient-isDeviceSupported .code} 84 | 85 | Returns a Boolean indicating if the current browser/device is supported by mediasoup-client. 86 | 87 | #### mediasoupClient.getDeviceInfo() 88 | {: #mediasoupClient-getDeviceInfo .code} 89 | 90 | Returns a [DeviceInfo](#mediasoupClient-DeviceInfo) Object with the browser/device information. 91 | 92 | #### mediasoupClient.checkCapabilitiesForRoom(roomRtpCapabilities) 93 | {: #mediasoupClient-checkCapabilitiesForRoom .code} 94 | 95 | Checks the audio/video capabilities of the current device/browser for the remote `room` given its RTP capabilities. 96 | 97 | It returns a Promise that resolves to an Object with `audio` and `video` Booleans, indicating whether sending and receiving audio/video is possible once joined in that `room`. 98 | 99 |
100 | 101 | Argument | Type | Description | Required | Default 102 | ---------- | ------- | ----------- | -------- | ---------- 103 | `roomRtpCapabilities` | [RTCRtpCapabilities](https://draft.ortc.org/#rtcrtpcapabilities*) | Room RTP capabilities. | Yes | 104 | 105 |
106 | 107 |
108 | This method is useful in the scenario in which the application wishes to request the user with mic/webcam permissions before joining the room. By running this method before, the application could avoid requesting webcam permission to the user if his browser does not support the video codec of the room. 109 |
110 | 111 |
112 | 113 | 114 | ### Classes 115 | {: #mediasoupClient-classes} 116 | 117 |
118 | 119 | #### mediasoupClient.Room 120 | {: #mediasoupClient-Room .code} 121 | 122 | Exposes the [Room](#Room) class. 123 | 124 |
125 | -------------------------------------------------------------------------------- /_includes/documentation/v2/mediasoup-client/index.md: -------------------------------------------------------------------------------- 1 | Client side JavaScript library. 2 | 3 | * [Installation](/documentation/v2/mediasoup-client/installation/) 4 | * [API](/documentation/v2/mediasoup-client/api/) 5 | * [Debugging](/documentation/v2/mediasoup-client/debugging/) 6 | -------------------------------------------------------------------------------- /_includes/documentation/v2/mediasoup/api/ActiveSpeakerDetector.md: -------------------------------------------------------------------------------- 1 | ## ActiveSpeakerDetector 2 | {: #ActiveSpeakerDetector} 3 | 4 | An `activeSpeakerDetector` provides the `room` with the highest audio volume level. 5 | 6 |
7 | The `ActiveSpeakerDetector` mechanism is based on the [`audiolevels`](#room-on-audiolevels) event of the `room`. 8 |
9 | 10 | 11 | ### Methods 12 | {: #ActiveSpeakerDetector-methods} 13 | 14 |
15 | 16 | #### activeSpeakerDetector.close() 17 | {: #activeSpeakerDetector-close .code} 18 | 19 | Closes the `activeSpeakerDetector` and triggers a [`close`](#activeSpeakerDetector-on-close) event. 20 | 21 |
22 | 23 | 24 | ### Events 25 | {: #ActiveSpeakerDetector-events} 26 | 27 | The `ActiveSpeakerDetector` class inherits from [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter). 28 | 29 |
30 | 31 | #### activeSpeakerDetector.on("close", fn()) 32 | {: #activeSpeakerDetector-on-close .code} 33 | 34 | Emitted when the `activeSpeakerDetector` is closed. 35 | 36 | #### activeSpeakerDetector.on("activespeakerchange", fn(peer, producer)) 37 | {: #activeSpeakerDetector-on-activespeakerchange .code} 38 | 39 | Emitted when a new active speaker is detected. 40 | 41 |
42 | 43 | Argument | Type | Description 44 | --------- | ------- | ---------------- 45 | `peer` | [Peer](#Peer) | Associated `peer`. 46 | `producer`| [Producer](#Producer) | Associated audio `producer`. 47 | 48 |
49 | 50 |
51 | Both `peer` and `producer` can be `undefined` when no active speaker is detected. 52 |
53 | 54 |
55 | -------------------------------------------------------------------------------- /_includes/documentation/v2/mediasoup/api/PlainRtpTransport.md: -------------------------------------------------------------------------------- 1 | ## PlainRtpTransport 2 | {: #PlainRtpTransport} 3 | 4 | A `plainRtpTransport` represents a network path negotiated on which plain RTP and RTCP (no ICE nor DTLS) is carried. 5 | 6 | 7 | ### Dictionaries 8 | {: #PlainRtpTransport-dictionaries} 9 | 10 |
11 | 12 | #### RemoteParameters 13 | {: #PlainRtpTransport-RemoteParameters .code} 14 | 15 |
16 | 17 | Field | Type | Description | Required | Default 18 | ------------ | ------- | ------------- | -------- | --------- 19 | `ip` | String | Destination IP. | Yes | 20 | `port` | Number | Destination port. | Yes | 21 | 22 |
23 | 24 |
25 | 26 | 27 | ### Properties 28 | {: #PlainRtpTransport-properties} 29 | 30 |
31 | 32 | #### plainRtpTransport.id 33 | {: #plainRtpTransport-id .code} 34 | 35 | * Read only 36 | 37 | Unique identifier (Number). 38 | 39 | #### plainRtpTransport.closed 40 | {: #plainRtpTransport-closed .code} 41 | 42 | * Read only 43 | 44 | A Boolean indicating whether the `plainRtpTransport` has been closed. 45 | 46 | #### plainRtpTransport.tuple 47 | {: #plainRtpTransport-tuple .code} 48 | 49 | * Read only 50 | 51 | The [5-Tuple](#Transport-IceSelectedTuple) indicating information about the connection. 52 | 53 | #### plainRtpTransport.localIP 54 | {: #plainRtpTransport-localIP .code} 55 | 56 | * Read only 57 | 58 | The `local IP address` (String) of the `transport`. 59 | 60 | #### plainRtpTransport.localPort 61 | {: #plainRtpTransport-localPort .code} 62 | 63 | * Read only 64 | 65 | The `local port` (Number) of the `transport`. 66 | 67 |
68 | 69 | 70 | ### Methods 71 | {: #PlainRtpTransport-methods} 72 | 73 |
74 | 75 | #### plainRtpTransport.close() 76 | {: #plainRtpTransport-close .code} 77 | 78 | Closes the `plainRtpTransport`. 79 | 80 | #### plainRtpTransport.setRemoteParameters(parameters) 81 | {: #plainRtpTransport-setRemoteParameters .code} 82 | 83 | Set the `remote IP address` and `port` for the `plainRtpTransport`. 84 | 85 |
86 | 87 | Argument | Type | Description | Required | Default 88 | ---------- | ------- | ----------- | -------- | ---------- 89 | `parameters` | [PlainRtpRemoteParameters](#PlainRtpTransport-RemoteParameters) | Remote parameters. | Yes | 90 | 91 |
92 | 93 |
94 | -------------------------------------------------------------------------------- /_includes/documentation/v2/mediasoup/api/RtpStreamer.md: -------------------------------------------------------------------------------- 1 | ## RtpStreamer 2 | {: #RtpStreamer} 3 | 4 | An `rtpStreamer` represents both a specialized [Consumer](#Consumer) and a [PlainRtpTransport](#PlainRtpTransport). It's created by calling the [`room.createRtpStreamer()`](#room-createRtpStreamer) by passing a [Producer](#Producer) and [RtpStreamOptions](#RtpStreamer-RtpStreamerOptions). 5 | 6 | The RTP and RTCP received by the `producer` will be relayed/mirrored to the given IP and port using plain RTP/RTCP. 7 | 8 | 9 | ### Dictionaries 10 | {: #RtpStreamer-dictionaries} 11 | 12 |
13 | 14 | #### RtpStreamerOptions 15 | {: #RtpStreamer-RtpStreamerOptions .code} 16 | 17 |
18 | 19 | Field | Type | Description | Required | Default 20 | ------------ | ------- | ------------- | -------- | --------- 21 | `remoteIP` | String | Destination IP. | Yes | 22 | `remotePort` | Number | Destination port. | Yes | 23 | `localIP` | String | Local IP. | No | `rtcIPv4` or `rtcIPv6` given in [ServerSettings](#Server-ServerSettings) 24 | 25 |
26 | 27 |
28 | If `localIP` is given, the RTP port range given in [ServerSettings](#Server-ServerSettings) (`rtcMinPort` - `rtcMaxPort`) is not honored and, instead, any available random port will be used. 29 |
30 | 31 | 32 |
33 | 34 | 35 | ### Properties 36 | {: #RtpStreamer-properties} 37 | 38 |
39 | 40 | #### rtpStreamer.consumer 41 | {: #rtpStreamer-consumer .code} 42 | 43 | * Read only 44 | 45 | The generated [Consumer](#Consumer) instance. 46 | 47 | #### rtpStreamer.transport 48 | {: #rtpStreamer-transport .code} 49 | 50 | * Read only 51 | 52 | The generated [PlainRtpTransport](#PlainRtpTransport) instance. 53 | 54 |
55 | 56 | 57 | ### Methods 58 | {: #RtpStreamer-methods} 59 | 60 |
61 | 62 | #### rtpStreamer.close() 63 | {: #rtpStreamer-close .code} 64 | 65 | Closes the `rtpStreamer`, including its `consumer` and `transport`, and triggers a [`close`](#rtpStreamer-on-close) event. 66 | 67 |
68 | 69 | 70 | ### Events 71 | {: #RtpStreamer-events} 72 | 73 | The `RtpStreamer` class inherits from [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter). 74 | 75 |
76 | 77 | #### rtpStreamer.on("close", fn()) 78 | {: #rtpStreamer-on-close .code} 79 | 80 | Emitted when the `rtpStreamer` is closed. 81 | 82 |
83 | -------------------------------------------------------------------------------- /_includes/documentation/v2/mediasoup/api/errors.md: -------------------------------------------------------------------------------- 1 | ## errors 2 | {: #errors} 3 | 4 | The `errors` module (exported via [`mediasoup.errors`](#mediasoup-errors)) holds custom [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) classes internally used by mediasoup. 5 | 6 | 7 | ### Classes 8 | {: #errors-classes} 9 | 10 |
11 | 12 | #### errors.InvalidStateError 13 | {: #errors-InvalidStateError .code} 14 | 15 | This error happens when an API method is called on an Object in invalid state (for example when such an Object is closed). 16 | 17 |
18 | -------------------------------------------------------------------------------- /_includes/documentation/v2/mediasoup/api/mediasoup.md: -------------------------------------------------------------------------------- 1 | ## mediasoup 2 | {: #mediasoup} 3 | 4 | The top-level module exported by the mediasoup module. 5 | 6 | ```javascript 7 | const mediasoup = require("mediasoup"); 8 | ``` 9 | 10 | 11 | ### Properties 12 | {: #mediasoup-properties} 13 | 14 |
15 | 16 | #### mediasoup.errors 17 | {: #mediasoup-errors .code} 18 | 19 | Provides access to the [errors](#errors) module. 20 | 21 |
22 | 23 | 24 | ### Functions 25 | {: #mediasoup-functions} 26 | 27 |
28 | 29 | #### mediasoup.Server(settings) 30 | {: #mediasoup-Server .code} 31 | 32 | Returns a new [Server](#Server) instance. 33 | 34 |
35 | 36 | Argument | Type | Description | Required | Default 37 | ---------- | ------- | ----------- | -------- | ---------- 38 | `settings` | [ServerSettings](#Server-ServerSettings) | Server settings. | No | 39 | 40 |
41 | 42 | Usage example: 43 | 44 | ```javascript 45 | const server = mediasoup.Server( 46 | { 47 | logLevel : "warn", 48 | rtcIPv4 : "1.2.3.4", 49 | rtcIPv6 : false, 50 | dtlsCertificateFile : "/home/foo/dtls-cert.pem", 51 | dtlsPrivateKeyFile : "/home/foo/dtls-key.pem" 52 | }); 53 | ``` 54 | 55 |
56 | -------------------------------------------------------------------------------- /_includes/documentation/v2/mediasoup/index.md: -------------------------------------------------------------------------------- 1 | C++ SFU and server side Node.js module. 2 | 3 | * [Installation](/documentation/v2/mediasoup/installation/) 4 | * [API](/documentation/v2/mediasoup/api/) 5 | * [Debugging](/documentation/v2/mediasoup/debugging/) 6 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/api/Consumer.md: -------------------------------------------------------------------------------- 1 | ## Consumer 2 | {: #Consumer} 3 | 4 |
5 | 6 | A consumer represents an audio or video remote source being transmitted from the mediasoup router to the client application through a WebRTC transport. 7 | 8 |
9 | 10 | 11 | ### Methods 12 | {: #Consumer-methods} 13 | 14 |
15 | 16 | #### consumer.GetId() 17 | {: #Consumer-GetId .code} 18 | 19 | Consumer identifier. 20 | 21 | > `@returns` const std::string& 22 | 23 | #### consumer.GetProducerId() 24 | {: #Consumer-GetProducerId .code} 25 | 26 | The associated producer identifier. 27 | 28 | > `@returns` const std::string& 29 | 30 | #### consumer.GetKind() 31 | {: #Consumer-GetKind .code} 32 | 33 | The media kind ("audio" or "video"). 34 | 35 | > `@returns` const std::string& [MediaKind](/documentation/v3/mediasoup/rtp-parameters-and-capabilities/#MediaKind) 36 | 37 | #### consumer.GetRtpParameters() 38 | {: #Consumer-GetRtpParameters .code} 39 | 40 | Consumer RTP parameters. 41 | 42 | > `@returns` const nlohmann::json& [RtpReceiveParameters](/documentation/v3/mediasoup/rtp-parameters-and-capabilities/#RtpReceiveParameters) 43 | 44 |
45 | Check the [Communication Between Client and Server](/documentation/v3/communication-between-client-and-server/) section for more details. 46 |
47 | 48 | #### consumer.GetTrack() 49 | {: #Consumer-GetTrack .code} 50 | 51 | The remote audio or video track. 52 | 53 | > `@returns` webrtc::MediaStreamTrackInterface\* 54 | 55 | #### consumer.GetStats() 56 | {: #Consumer-GetStats .code} 57 | 58 | Gets the local RTP receiver statistics by calling `getStats()` in the underlying `RTCRtpReceiver` instance. 59 | 60 | > `@async` blocks current thread 61 | > 62 | > `@returns` nlohmann::json [RTCStatsReport](https://w3c.github.io/webrtc-pc/#dom-rtcstatsreport) 63 | 64 | #### consumer.GetAppData() 65 | {: #Consumer-GetAppData .code} 66 | 67 | Custom data Object provided by the application in the consumer factory method. The app can modify its content at any time. 68 | 69 | > `@returns` const nlohmann::json& 70 | 71 | #### consumer.IsClosed() 72 | {: #Consumer-IsClosed .code} 73 | 74 | Whether the consumer is closed. 75 | 76 | > `@returns` bool 77 | 78 | #### consumer.IsPaused() 79 | {: #Consumer-IsPaused .code} 80 | 81 | Whether the consumer is paused. 82 | 83 | > `@returns` bool 84 | 85 | #### consumer.Close() 86 | {: #Consumer-Close .code} 87 | 88 | Closes the consumer. 89 | 90 |
91 | This method should be called when the server side consumer has been closed (and vice-versa). 92 |
93 | 94 | #### consumer.Pause() 95 | {: #Consumer-Pause .code} 96 | 97 | Pauses the consumer. Internally the library executes `track->set_enabled(false)` in the remote track. 98 | 99 |
100 | This method should be called when the server side consumer has been paused (and vice-versa). 101 |
102 | 103 | #### consumer.Resume() 104 | {: #Consumer-Resume .code} 105 | 106 | Resumes the consumer Internally the library executes `track->set_enabled(true)` in the remote track. 107 | 108 |
109 | This method should be called when the server side consumer has been resumed (and vice-versa). 110 |
111 | 112 |
113 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/api/ConsumerListener.md: -------------------------------------------------------------------------------- 1 | ## Consumer::Listener 2 | {: #ConsumerListener} 3 | 4 | 5 |
6 | 7 | > `@abstract` 8 | 9 | This is an abstract class which must be implemented and used according to the API. 10 | 11 |
12 | 13 | 14 | ### Events 15 | {: #ConsumerListener-events} 16 | 17 |
18 | 19 | #### ConsumerListener::OnTransportClose(consumer) 20 | {: #ConsumerListener-OnTransportClose .code} 21 | 22 | Executed when the transport this consumer belongs to is closed for whatever reason. The consumer itself is also closed. 23 | 24 |
25 | 26 | Argument | Type | Description | Required | Default 27 | --------------- | ------- | ----------- | -------- | ---------- 28 | `consumer` | [Consumer\*](#Consumer) | The consumer instance executing this method. | Yes | 29 | 30 |
31 | 32 | ```c++ 33 | void MyConsumerListener::OnTransportClose(mediasoupclient::Consumer* consumer) 34 | { 35 | std::cout << "transport closed" << std::endl; 36 | } 37 | ``` 38 | 39 |
40 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/api/DataConsumer.md: -------------------------------------------------------------------------------- 1 | ## DataConsumer 2 | {: #DataConsumer} 3 | 4 |
5 | 6 | A data consumer represents a data source being transmitted from the mediasoup router to the client application through a WebRTC transport. 7 | 8 |
9 | 10 | 11 | ### Methods 12 | {: #DataConsumer-methods} 13 | 14 |
15 | 16 | #### dataConsumer.GetId() 17 | {: #DataConsumer-GetId .code} 18 | 19 | Consumer identifier. 20 | 21 | > `@returns` const std::string& 22 | 23 | #### dataConsumer.GetDataProducerId() 24 | {: #DataConsumer-GetDataProducerId .code} 25 | 26 | The associated data producer identifier. 27 | 28 | > `@returns` const std::string& 29 | 30 | #### dataConsumer.GetSctpStreamParameters() 31 | {: #DataConsumer-GetSctpStreamParameters .code} 32 | 33 | The SCTP stream parameters. 34 | 35 | > `@returns` [const SctpStreamParameters](/documentation/v3/mediasoup/sctp-parameters/#SctpStreamParameters). 36 | 37 | #### dataConsumer.GetReadyState() 38 | {: #DataConsumer-GetReadyState .code} 39 | 40 | The DataChannel ready state. 41 | 42 | > `@type` webrtc::DataChannelInterface::DataState 43 | 44 | #### dataConsumer.GetLabel() 45 | {: #DataConsumer-GetLabel .code} 46 | 47 | The DataChannel label. 48 | 49 | > `@returns` std::string, read only 50 | 51 | #### dataConsumer.GetProtocol() 52 | {: #DataConsumer-GetProtocol .code} 53 | 54 | The DataChannel sub-protocol. 55 | 56 | > `@returns` std::string, read only 57 | 58 | #### dataConsumer.GetAppData() 59 | {: #DataConsumer-GetAppData .code} 60 | 61 | Custom data Object provided by the application in the consumer factory method. The app can modify its content at any time. 62 | 63 | > `@returns` const nlohmann::json& 64 | 65 | #### dataConsumer.IsClosed() 66 | {: #DataConsumer-IsClosed .code} 67 | 68 | Whether the consumer is closed. 69 | 70 | > `@returns` bool 71 | 72 | #### dataConsumer.Close() 73 | {: #DataConsumer-Close .code} 74 | 75 | Closes the dataConsumer. 76 | 77 |
78 | This method should be called when the server side consumer has been closed (and vice-versa). 79 |
80 | 81 |
82 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/api/DataConsumerListener.md: -------------------------------------------------------------------------------- 1 | ## DataConsumer::Listener 2 | {: #DataConsumerListener} 3 | 4 | 5 |
6 | 7 | > `@abstract` 8 | 9 | This is an abstract class which must be implemented and used according to the API. 10 | 11 |
12 | 13 | 14 | ### Events 15 | {: #DataConsumerListener-events} 16 | 17 |
18 | 19 | #### DataConsumerListener::OnConnecting(consumer) 20 | {: #DataConsumerListener-OnConnecting .code} 21 | 22 | Executed when the underlying DataChannel is connecting. 23 | 24 |
25 | 26 | Argument | Type | Description | Required | Default 27 | --------------- | ------- | ----------- | -------- | ---------- 28 | `producer` | [DataConsumer\*](#DataConsumer) | The producer instance executing this method. | Yes | 29 | 30 |
31 | 32 | #### DataConsumerListener::OnOpen(producer) 33 | {: #DataConsumerListener-OnOpen .code} 34 | 35 | Executed when the underlying DataChannel is open. 36 | 37 |
38 | 39 | Argument | Type | Description | Required | Default 40 | --------------- | ------- | ----------- | -------- | ---------- 41 | `producer` | [DataConsumer\*](#DataConsumer) | The producer instance executing this method. | Yes | 42 | 43 |
44 | 45 | #### DataConsumerListener::OnClosing(consumer) 46 | {: #DataConsumerListener-OnClosing .code} 47 | 48 | Executed when the underlying DataChannel is closing. 49 | 50 |
51 | 52 | Argument | Type | Description | Required | Default 53 | --------------- | ------- | ----------- | -------- | ---------- 54 | `producer` | [DataConsumer\*](#DataConsumer) | The producer instance executing this method. | Yes | 55 | 56 |
57 | 58 | #### DataConsumerListener::OnClose(producer) 59 | {: #DataConsumerListener-OnClose .code} 60 | 61 | Executed when the underlying DataChannel is closed for unknown reasons. 62 | 63 |
64 | 65 | Argument | Type | Description | Required | Default 66 | --------------- | ------- | ----------- | -------- | ---------- 67 | `producer` | [DataConsumer\*](#DataConsumer) | The producer instance executing this method. | Yes | 68 | 69 |
70 | 71 | #### DataConsumerListener::OnTransportClose(consumer) 72 | {: #DataConsumerListener-OnTransportClose .code} 73 | 74 | Executed when the transport this consumer belongs to is closed for whatever reason. The consumer itself is also closed. 75 | 76 |
77 | 78 | Argument | Type | Description | Required | Default 79 | --------------- | ------- | ----------- | -------- | ---------- 80 | `consumer` | [DataConsumer\*](#DataConsumer) | The consumer instance executing this method. | Yes | 81 | 82 |
83 | 84 | ```c++ 85 | void MyConsumerListener::OnTransportClose(mediasoupclient::DataConsumer* consumer) 86 | { 87 | std::cout << "transport closed" << std::endl; 88 | } 89 | ``` 90 | 91 | #### DataConsumerListener::OnMessage(dataConsumer, buffer) 92 | {: #DataConsumerListener-OnMessage .code} 93 | 94 | Executed when a DataChannel message is received. 95 | 96 |
97 | 98 | Argument | Type | Description | Required | Default 99 | --------------- | ------- | ----------- | -------- | ---------- 100 | `consumer` | [DataConsumer\*](#DataConsumer) | The consumer instance executing this method. | Yes | 101 | `buffer` | webrtc::DataBuffer& | Data message received. | No | 102 | 103 |
104 | 105 | ```c++ 106 | void MyConsumerListener::OnMessage(DataConsumer* dataConsumer, const webrtc::DataBuffer& buffer) 107 | { 108 | if (dataConsumer->GetLabel() == "chat") 109 | { 110 | std::string message = std::string(buffer.data.data(), buffer.data.size()); 111 | std::cout << "received chat message: " << message << std::endl; 112 | } 113 | } 114 | ``` 115 | 116 |
117 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/api/DataProducer.md: -------------------------------------------------------------------------------- 1 | ## DataProducer 2 | {: #DataProducer} 3 | 4 |
5 | 6 | A data producer represents a data source that will be transmitted to the mediasoup router through a WebRTC transport. 7 | 8 |
9 | 10 | 11 | ### Methods 12 | {: #DataProducer-methods} 13 | 14 |
15 | 16 | #### dataProducer.GetId() 17 | {: #DataProducer-GetId .code} 18 | 19 | Producer identifier. 20 | 21 | > `@returns` const std::string& 22 | 23 | #### dataProducer.GetSctpStreamParameters() 24 | {: #DataProducer-GetSctpStreamParameters .code} 25 | 26 | The SCTP stream parameters. 27 | 28 | > `@returns` [const SctpStreamParameters](/documentation/v3/mediasoup/sctp-parameters/#SctpStreamParameters). 29 | 30 | #### dataProducer.GetReadyState() 31 | {: #DataProducer-GetReadyState .code} 32 | 33 | The DataChannel ready state. 34 | 35 | > `@type` webrtc::DataChannelInterface::DataState 36 | 37 | #### dataProducer.GetLabel() 38 | {: #DataProducer-GetLabel .code} 39 | 40 | The DataChannel label. 41 | 42 | > `@returns` std::string, read only 43 | 44 | #### dataProducer.GetProtocol() 45 | {: #DataProducer-GetProtocol .code} 46 | 47 | The DataChannel sub-protocol. 48 | 49 | > `@returns` std::string, read only 50 | 51 | #### dataProducer.GetBufferedAmount() 52 | {: #DataProducer-GetBufferedAmount .code} 53 | 54 | The number of bytes of application data (UTF-8 text and binary data) that have been queued using `send()`. 55 | 56 | > `@returns` uint64_t, read only 57 | 58 | #### dataProducer.GetAppData 59 | {: #DataProducer-GetAppData .code} 60 | 61 | Custom data Object provided by the application in the data producer factory method. The app can modify its content at any time. 62 | 63 | > `@returns` const nlohmann::json& 64 | 65 | #### dataProducer.IsClosed() 66 | {: #DataProducer-IsClosed .code} 67 | 68 | Whether the data producer is closed. 69 | 70 | > `@returns` bool 71 | 72 | #### dataProducer.Close() 73 | {: #DataProducer-Close .code} 74 | 75 | Closes the data producer. No more data is transmitted. 76 | 77 |
78 | This method should be called when the server side producer has been closed (and vice-versa). 79 |
80 | 81 | #### dataProducer.Send(buffer) 82 | {: #DataProducer-Send .code} 83 | 84 | Sends the given data over the corresponding DataChannel. If the data can't be sent at the SCTP level (due to congestion control), it's buffered at the data channel level, up to a maximum of 16MB. If Send is called while this buffer is full, the data channel will be closed abruptly. 85 | 86 | So, it's important to use [GetBufferedAmount](#DataProducer-GetBufferedAmount) and [OnBufferedAmountChange](#DataProducerListener-OnBufferAmountChange) to ensure the data channel is used efficiently but without filling this buffer. 87 | 88 |
89 | 90 | Argument | Type | Description | Required | Default 91 | --------------- | ------- | ----------- | -------- | ---------- 92 | `buffer` | webrtc::DataBuffer& | Data message to be sent. | No | 93 | 94 |
95 | 96 |
97 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/api/DataProducerListener.md: -------------------------------------------------------------------------------- 1 | ## DataProducer::Listener 2 | {: #DataProducerListener} 3 | 4 | 5 |
6 | 7 | > `@abstract` 8 | 9 | This is an abstract class which must be implemented and used according to the API. 10 | 11 |
12 | 13 | 14 | ### Events 15 | {: #DataProducerListener-events} 16 | 17 |
18 | 19 | #### DataProducerListener::OnOpen(producer) 20 | {: #DataProducerListener-OnOpen .code} 21 | 22 | Executed when the underlying DataChannel is open. 23 | 24 |
25 | 26 | Argument | Type | Description | Required | Default 27 | --------------- | ------- | ----------- | -------- | ---------- 28 | `producer` | [DataProducer\*](#DataProducer) | The producer instance executing this method. | Yes | 29 | 30 |
31 | 32 | #### DataProducerListener::OnClose(producer) 33 | {: #DataProducerListener-OnClose .code} 34 | 35 | Executed when the underlying DataChannel is closed for unknown reasons. 36 | 37 |
38 | 39 | Argument | Type | Description | Required | Default 40 | --------------- | ------- | ----------- | -------- | ---------- 41 | `producer` | [DataProducer\*](#DataProducer) | The producer instance executing this method. | Yes | 42 | 43 |
44 | 45 | #### DataProducerListener::OnBufferAmountChange(producer, sentDataSize) 46 | {: #DataProducerListener-OnBufferAmountChange .code} 47 | 48 | Executed when the DataChannel buffered amount of bytes changes. 49 | 50 |
51 | 52 | Argument | Type | Description | Required | Default 53 | --------------- | ------- | ----------- | -------- | ---------- 54 | `producer` | [DataProducer\*](#DataProducer) | The producer instance executing this method. | Yes | 55 | `sentDataSize` | uint64_t | The amount of data sent. | Yes | 56 | 57 |
58 | 59 | #### DataProducerListener::OnTransportClose(producer) 60 | {: #DataProducerListener-OnTransportClose .code} 61 | 62 | Executed when the transport this producer belongs to is closed for whatever reason. The producer itself is also closed. 63 | 64 |
65 | 66 | Argument | Type | Description | Required | Default 67 | --------------- | ------- | ----------- | -------- | ---------- 68 | `producer` | [DataProducer\*](#DataProducer) | The producer instance executing this method. | Yes | 69 | 70 |
71 | 72 | ```c++ 73 | void MyProducerListener::OnTransportClose(mediasoupclient::Producer* producer) 74 | { 75 | std::cout << "transport closed" << std::endl; 76 | } 77 | ``` 78 | 79 |
80 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/api/Logger.md: -------------------------------------------------------------------------------- 1 | ## Logger 2 | {: #Logger} 3 | 4 |
5 | 6 | C++ namespace (within the `mediasoupclient` namespace) responsible for logging. 7 | 8 |
9 | 10 | 11 | ### Enums 12 | {: #Logger-dictionaries} 13 | 14 |
15 | 16 | #### LogLevel 17 | {: #LoggerLogLevel .code} 18 | 19 |
20 | 21 | Value | Description 22 | -------------- | ------------- 23 | "LOG_DEBUG" | Logs debug level and above. 24 | "LOG_WARN" | Logs warning level and above. 25 | "LOG_ERROR" | Logs error level. 26 | "LOG_NONE" | Logs nothing. 27 | 28 |
29 | 30 |
31 | * "LOG_DEBUG" only applies if libmediasoupclient [MEDIASOUPCLIENT_LOG_DEV](/documentation/v3/libmediasoupclient/installation/#Building-Flags) building flag is set. 32 | * Log trace only applies if libmediasoupclient [MEDIASOUPCLIENT_LOG_TRACE](/documentation/v3/libmediasoupclient/installation/#Building-Flags) building flag is set and `LogLevel` is "LOG_DEBUG". 33 |
34 | 35 |
36 | 37 | 38 | ### Classes 39 | {: #Logger-classes} 40 | 41 |
42 | 43 | #### Logger::LogHandlerInterface 44 | {: #Logger-LogHandlerInterface .code} 45 | 46 | See [LogHandlerInterface](#LoggerLogHandlerInterface). 47 | 48 |
49 | 50 | 51 | ### Functions 52 | {: #Logger-functions} 53 | 54 |
55 | 56 | #### Logger::SetLogLevel(level) 57 | {: #Logger-SetLogLevel .code} 58 | 59 | Sets log level. 60 | 61 |
62 | 63 | Argument | Type | Description | Required | Default 64 | ----------- | ------- | ----------- | -------- | ---------- 65 | `level` | [LogLevel](#LoggerLogLevel)| The log level to be used for logging. | Yes | 66 | 67 |
68 | 69 | #### Logger::SetHandler(handler) 70 | {: #Logger-SetHandler .code} 71 | 72 | Sets log handler. 73 | 74 |
75 | 76 | Argument | Type | Description | Required | Default 77 | -------- | ------- | ----------- | -------- | ---------- 78 | `level` | [LogHandlerInterface\*](#LoggerLogHandlerInterface) | The log handler to be used. | Yes | 79 | 80 |
81 | 82 | #### Logger::SetDefaultHandler() 83 | {: #Logger-SetDefaultHandler .code} 84 | 85 | Sets the default log handler, which prints all log messages to `stdout`. 86 | 87 |
88 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/api/LoggerLogHandlerInterface.md: -------------------------------------------------------------------------------- 1 | ## Logger::LogHandlerInterface 2 | {: #LoggerLogHandlerInterface} 3 | 4 |
5 | 6 | > `@abstract` 7 | 8 | This is an abstract class which can be implemented and provided to libmediasoupclient via [Logger::SetHandler()](#Logger-SetHandler). 9 | 10 |
11 | 12 | 13 | ### Events 14 | {: #LoggerLogHandlerInterface-events} 15 | 16 |
17 | 18 | #### LogHandlerInterface::OnLog(level, payload, len) 19 | {: #LoggerLogHandlerInterface-OnLog .code} 20 | 21 | Executed for every log. 22 | 23 |
24 | 25 | Argument | Type | Description | Required | Default 26 | ----------- | ------- | ----------- | -------- | ---------- 27 | `level` | [LogLevel](#LoggerLogLevel) | The level this log message belongs to. | Yes | 28 | `payload` | char\* | The log message. | Yes | 29 | `len` | size_t | The log message length. | Yes | 30 | 31 |
32 | 33 | ```c++ 34 | void MyLogHandler::OnLog(LogLevel level, char* payload, size_t len) 35 | { 36 | std::cout << payload << std::endl; 37 | } 38 | ``` 39 | 40 |
41 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/api/ProducerListener.md: -------------------------------------------------------------------------------- 1 | ## Producer::Listener 2 | {: #ProducerListener} 3 | 4 | 5 |
6 | 7 | > `@abstract` 8 | 9 | This is an abstract class which must be implemented and used according to the API. 10 | 11 |
12 | 13 | 14 | ### Events 15 | {: #ProducerListener-events} 16 | 17 |
18 | 19 | #### ProducerListener::OnTransportClose(producer) 20 | {: #ProducerListener-OnTransportClose .code} 21 | 22 | Executed when the transport this producer belongs to is closed for whatever reason. The producer itself is also closed. 23 | 24 |
25 | 26 | Argument | Type | Description | Required | Default 27 | --------------- | ------- | ----------- | -------- | ---------- 28 | `producer` | [Producer\*](#Producer) | The producer instance executing this method. | Yes | 29 | 30 |
31 | 32 | ```c++ 33 | void MyProducerListener::OnTransportClose(mediasoupclient::Producer* producer) 34 | { 35 | std::cout << "transport closed" << std::endl; 36 | } 37 | ``` 38 | 39 |
40 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/api/RecvTransport.md: -------------------------------------------------------------------------------- 1 | ## RecvTransport 2 | {: #RecvTransport} 3 | 4 |
5 | 6 | > `@inherits` [Transport](#Transport) 7 | 8 | A WebRTC receive transport connects a mediasoupclient [Device](#Device) with a mediasoup [Router](/documentation/v3/mediasoup/api/#Router) at media level and enables the reception of media (by means of [Consumer](#Consumer) instances). 9 | 10 | Internally, the transport holds a WebRTC [RTCPeerConnection](https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection) instance. 11 | 12 |
13 | 14 | 15 | ### Methods 16 | {: #Transport-methods} 17 | 18 |
19 | 20 | #### recvTransport.Consume(listener, id, producerId, kind, rtpParameters, appData) 21 | {: #transport-Consume .code} 22 | 23 | Instructs the transport to receive an audio or video track to the mediasoup router. 24 | 25 |
26 | 27 | Argument | Type | Description | Required | Default 28 | ----------- | ------- | ----------- | -------- | ---------- 29 | `listener` | [Consumer::Listener](#ConsumerListener) | Consumer listener. | Yes | 30 | `id` | const std::string& | The identifier of the server side consumer. | Yes | 31 | `producerId` | const std::string& | The identifier of the server side producer being consumed. | Yes | 32 | `kind` | const std::string& | Media kind ("audio" or "video"). | Yes | 33 | `rtpParameters` | const nlohmann::json\* [RtpReceiveParameters](/documentation/v3/mediasoup/rtp-parameters-and-capabilities/#RtpReceiveParameters) | Receive RTP parameters. | Yes | 34 | `appData` | nlohmann::json | Custom application data. | No | `{ }` 35 | 36 |
37 | 38 | > `@async` blocks current thread 39 | > 40 | > `@returns` [Consumer](#Consumer) 41 | 42 | ```c++ 43 | auto* consumerListener = new MyConsumerListener(); 44 | 45 | // This will block the current thread until completion. 46 | auto* consumer = recvTransport->Consume( 47 | consumerListener, 48 | id, 49 | producerId, 50 | kind, 51 | rtpParameters); 52 | ``` 53 | 54 | #### recvTransport.ConsumeData(listener, id, producerId, label, protocol, appData) 55 | {: #transport-ConsumeData .code} 56 | 57 | Instructs the transport to receive data via [DataChannel](https://www.w3.org/TR/webrtc/#rtcdatachannel) from the mediasoup router. 58 | 59 |
60 | 61 | Argument | Type | Description | Required | Default 62 | ----------- | ------- | ----------- | -------- | ---------- 63 | `listener` | [DataConsumer::Listener](#DataConsumerListener) | Consumer listener. | Yes | 64 | `id` | const std::string& | The identifier of the server side consumer. | Yes | 65 | `producerId` | const std::string& | The identifier of the server side producer being consumed. | Yes | 66 | `label` | const std::string& | A label which can be used to distinguish this DataChannel from others. | Yes | 67 | `protocol` | const std::string& | Name of the sub-protocol used by this DataChannel. | No | 68 | `appData` | nlohmann::json | Custom application data. | No | `{ }` 69 | 70 |
71 | 72 | > `@async` blocks current thread 73 | > 74 | > `@returns` [DataConsumer](#DataConsumer) 75 | 76 | ```c++ 77 | auto* consumerListener = new MyConsumerListener(); 78 | 79 | // This will block the current thread until completion. 80 | auto* consumer = recvTransport->Consume( 81 | consumerListener, 82 | id, 83 | "dataChannelLabel", 84 | "dataChannelProtocol"); 85 | ``` 86 | 87 |
88 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/api/RecvTransportListener.md: -------------------------------------------------------------------------------- 1 | ## RecvTransport::Listener 2 | {: #RecvTransportListener} 3 | 4 |
5 | 6 | > `@inherits` [Transport::Listener](#TransportListener) 7 | > 8 | > `@abstract` 9 | 10 | This is an abstract class which must be implemented and used according to the API. 11 | 12 |
13 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/api/Transport.md: -------------------------------------------------------------------------------- 1 | ## Transport 2 | {: #Transport} 3 | 4 |
5 | 6 | A `Transport` instance in libmediasoupclient represents the local side of a [WebRtcTransport](/documentation/v3/mediasoup/api/#WebRtcTransport) in mediasoup server. A WebRTC transport connects a mediasoupclient [Device](#Device) with a mediasoup [Router](/documentation/v3/mediasoup/api/#Router) at media level and enables the sending of media (by means of [Producer](#Producer) instances) **or** the receiving of media (by means of [Consumer](#Consumer) instances). 7 | 8 | Internally, the transport holds a WebRTC [RTCPeerConnection](https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection) instance. 9 | 10 |
11 | 12 | 13 | ### Methods 14 | {: #Transport-methods} 15 | 16 |
17 | 18 | #### transport.GetId() 19 | {: #Transport-GetId .code} 20 | 21 | Transport identifier. It matches the `id` of the server side transport. 22 | 23 | > `@returns` const std::string& 24 | 25 | #### transport.GetConnectionState() 26 | {: #Transport-GetConnectionState .code} 27 | 28 | The current connection state of the local peerconnection. 29 | 30 | > `@returns` const std::string& [RTCPeerConnectionState](https://w3c.github.io/webrtc-pc/#rtcpeerconnectionstate-enum) 31 | 32 | #### transport.GetStats() 33 | {: #Transport-GetStats .code} 34 | 35 | Gets the local transport statistics by calling `getStats()` in the underlying `RTCPeerConnection` instance. 36 | 37 | > `@async` blocks current thread 38 | > 39 | > `@returns` nlohmann::json& [RTCStatsReport](https://w3c.github.io/webrtc-pc/#dom-rtcstatsreport) 40 | 41 | #### transport.GetAppData() 42 | {: #Transport-GetAppData .code} 43 | 44 | Custom data Object provided by the application in the transport constructor. The app can modify its content at any time. 45 | 46 | > `@returns` const nlohmann::json& 47 | 48 | #### transport.IsClosed() 49 | {: #Transport-IsClosed .code} 50 | 51 | Whether the transport is closed. 52 | 53 | > `@returns` bool 54 | 55 | #### transport.Close() 56 | {: #Transport-Close .code} 57 | 58 | Closes the transport, including all its producers and consumers. 59 | 60 |
61 | This method should be called when the server side transport has been closed (and vice-versa). 62 |
63 | 64 | #### transport.RestartIce(iceParameters) 65 | {: #Transport-RestartIce .code} 66 | 67 | Instructs the underlying peerconnection to restart ICE by providing it with new remote ICE parameters. 68 | 69 |
70 | 71 | Argument | Type | Description | Required | Default 72 | --------------- | ------- | ----------- | -------- | ---------- 73 | `iceParameters` | const nlohmann::json& [IceParameters](/documentation/v3/mediasoup/api/#WebRtcTransportIceParameters) | New ICE parameters of the server side transport. | Yes | 74 | 75 |
76 | 77 | > `@async` blocks current thread 78 | 79 |
80 | This method must be called after restarting ICE in server side via [webRtcTransport.restartIce()](/documentation/v3/mediasoup/api/#webRtcTransport-restartIce). 81 |
82 | 83 | ```c++ 84 | transport.RestartIce(iceParameters); 85 | ``` 86 | 87 | #### transport.UpdateIceServers(iceServers) 88 | {: #Transport-UpdateIceServers .code} 89 | 90 | Provides the underlying peerconnection with a new list of TURN servers. 91 | 92 |
93 | 94 | Argument | Type | Description | Required | Default 95 | --------------- | ------- | ----------- | -------- | ---------- 96 | `iceServers` | const nlohmann::json& Array<[RTCIceServer](https://w3c.github.io/webrtc-pc/#rtciceserver-dictionary)> | List of TURN servers to provide the local peerconnection with. | No | `[ ]` 97 | 98 |
99 | 100 |
101 | This method is specially useful if the TURN server credentials have changed. 102 |
103 | 104 | ```javascript 105 | transport.updateIceServers(iceServers); 106 | ``` 107 | 108 |
109 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/api/TransportListener.md: -------------------------------------------------------------------------------- 1 | ## Transport::Listener 2 | {: #TransportListener} 3 | 4 |
5 | 6 | > `@abstract` 7 | 8 | This is an abstract class inherited by [SendTransport::Listener](#SendTransportListener) and [RecvTransport::Listener](#RecvTransportListener). 9 | 10 |
11 | 12 | 13 | ### Events 14 | {: #TransportListener-events} 15 | 16 |
17 | 18 | #### TransportListener::OnConnect(transport, dtlsParameters) 19 | {: #TransportListener-OnConnect .code} 20 | 21 | Called when the transport is about to establish the ICE+DTLS connection and needs to exchange information with the associated server side transport. 22 | 23 |
24 | 25 | Argument | Type | Description 26 | ----------- | ------- | ---------------- 27 | `transport` | [Transport\*](#Transport) | Transport instance. 28 | `dtlsParameters` | const nlohmann::json& [DtlsParameters](/documentation/v3/mediasoup/api/#WebRtcTransportDtlsParameters) | Local DTLS parameters. 29 | 30 |
31 | 32 | > `@returns` std::future\ when the transport is created in server side mediasoup 33 | 34 |
35 | In server side, the application should call [webRtcTransport.connect()](/documentation/v3/mediasoup/api/#webRtcTransport-connect). 36 |
37 | 38 | ```c++ 39 | std::future MyTransportListener::OnConnect( 40 | mediasoupclient::Transport transport, 41 | const json& dtlsParameters 42 | ) 43 | { 44 | std::promise promise; 45 | 46 | json body = 47 | { 48 | { "transportId", transport->GetId() }, 49 | { "dtlsParameters", dtlsParameters } 50 | }; 51 | 52 | // Signal local DTLS parameters to the server side transport. 53 | mySignaling.send("transport-connect", body); 54 | 55 | // [...] Let's assume code execution continues once we get a success response 56 | // from the server. 57 | 58 | // Fulfil the promise and return its future. 59 | promise.set_value(); 60 | 61 | return promise.get_future(); 62 | } 63 | ``` 64 | 65 | #### listener.OnConnectionStateChange(transport, connectionState) 66 | {: #transport-OnConnectionStateChange .code} 67 | 68 | Emitted when the local transport connection state changes. 69 | 70 |
71 | 72 | Argument | Type | Description 73 | ----------- | ------- | ---------------- 74 | `transport` | [Transport\*](#Transport) | Transport instance. 75 | `connectionState` | const std::string& [RTCPeerConnectionState](https://w3c.github.io/webrtc-pc/#rtcpeerconnectionstate-enum) | Transport connection state. 76 | 77 |
78 | 79 |
80 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/api/mediasoupclient.md: -------------------------------------------------------------------------------- 1 | ## mediasoupclient 2 | {: #mediasoupclient} 3 | 4 |
5 | 6 | The main C++ namespace exposed by the libmediasoupclient library. 7 | 8 | ```c++ 9 | #include "libmediasoupclient/mediasoupclient.hpp" 10 | ``` 11 | 12 |
13 | 14 | 15 | ### Classes 16 | {: #mediasoupclient-classes} 17 | 18 |
19 | 20 | #### mediasoupclient::Device 21 | {: #mediasoupclient-Device .code} 22 | 23 | The `Device` class. 24 | 25 | > `@returns` [Device](#Device) 26 | 27 | ```javascript 28 | auto* device = new mediasoupclient::Device(); 29 | ``` 30 | 31 |
32 | 33 | 34 | ### Functions 35 | {: #mediasoupclient-functions} 36 | 37 |
38 | 39 | #### mediasoupclient::Version() 40 | {: #mediasoupclient-Version .code} 41 | 42 | The libmediasoupclient version. 43 | 44 | > `@returns` std::string 45 | 46 | ```c++ 47 | mediasoupclient::Version(); 48 | // "1.0.0" 49 | ``` 50 | 51 | #### mediasoupclient::Initialize() 52 | {: #mediasoupclient-Initialize .code} 53 | 54 | libmediasoupclient initialization. Initializes libwebrtc. 55 | 56 | ```c++ 57 | mediasoupclient::Initialize(); 58 | ``` 59 | 60 | #### mediasoupclient::Cleanup() 61 | {: #mediasoupclient-Cleanup .code} 62 | 63 | libmediasoupclient cleanup. Cleans up libwebrtc. 64 | 65 | ```c++ 66 | mediasoupclient::Cleanup(); 67 | ``` 68 | 69 | #### mediasoupclient::parseScalabilityMode(scalabilityMode) 70 | {: #mediasoupclient-parseScalabilityMode .code} 71 | 72 | Parses the given `scalabilityMode` string according to the rules in [webrtc-svc](https://w3c.github.io/webrtc-svc/). 73 | 74 |
75 | 76 | Argument | Type | Description | Required | Default 77 | ---------- | ------- | ----------- | -------- | ---------- 78 | `scalabilityMode` | const std::string& | Scalability mode. | Yes | 79 | 80 |
81 | 82 | > `@returns` nlohmann::json: 83 | > 84 | > * `spatialLayers` {`@type` uint16_t} Number of spatial layers (by default 1). 85 | > 86 | > * `temporalLayers` {`@type` uint16_t} Number of temporal layers (by default 1). 87 | 88 | ```javascript 89 | mediasoupclient::parseScalabilityMode("L2T3"); 90 | // => { spatialLayers: 2, temporalLayers: 3 } 91 | 92 | mediasoupclient::parseScalabilityMode("L4T7_KEY_SHIFT"); 93 | // => { spatialLayers: 4, temporalLayers: 7 } 94 | ``` 95 | 96 |
97 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/api/nlohmann-json.md: -------------------------------------------------------------------------------- 1 | ## nlohmann::json 2 | {: #nlohmann-json} 3 | 4 |
5 | 6 | libmediasoupclient uses the [JSON for Modern C++](https://github.com/nlohmann/json/) library and exposes its `nlohmann::json` C++ namespace. 7 | 8 |
9 | The application must use it to construct JSON objects and pass them to the libmediasoupclient API when required. 10 |
11 | 12 | ```c++ 13 | #include "nlohmann/json.hpp" 14 | ``` 15 | 16 |
17 | -------------------------------------------------------------------------------- /_includes/documentation/v3/libmediasoupclient/index.md: -------------------------------------------------------------------------------- 1 | C++ library built on top of libwebrtc. It exposes the same API than mediasoup-client. 2 | 3 | * [Design](/documentation/v3/libmediasoupclient/design/) 4 | * [Installation](/documentation/v3/libmediasoupclient/installation/) 5 | * [API](/documentation/v3/libmediasoupclient/api/) 6 | * [Debugging](/documentation/v3/libmediasoupclient/debugging/) 7 | -------------------------------------------------------------------------------- /_includes/documentation/v3/mediasoup-client/api/observer-api.md: -------------------------------------------------------------------------------- 1 | ## Observer API 2 | {: #observer-api} 3 | 4 |
5 | 6 | Most entities in mediasoup-client expose a `observer` property (a Node.js [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter)) that can be used by third party libraries to monitor everything related to mediasoup. 7 | 8 | The observer API should not be directly used by the application itself, but by separate modules or libraries that the application integrate into its code. Such a module or library may, for example, monitor all the creation and closure of transports, producers, consumers, etc. It could also monitor events generated by producers and consumers ("pause", "resume", etc). 9 | 10 | Usage example: 11 | 12 | ```javascript 13 | const mediasoupClient = require("mediasoup-client"); 14 | 15 | const mediasoupClientDevice = new mediasoupClientTypes.Device(); 16 | 17 | mediasoupClientDevice.observer.on("newtransport", (transport) => 18 | { 19 | console.log( 20 | "new transport created [transport.id:%s]", transport.id); 21 | 22 | transport.observer.on("close", () => 23 | { 24 | console.log("transport closed [transport.id:%s]", transport.id); 25 | }); 26 | 27 | transport.observer.on("newproducer", (producer) => 28 | { 29 | console.log( 30 | "new producer created [transport.id:%s, producer.id:%s]", 31 | transport.id, producer.id); 32 | 33 | producer.observer.on("close", () => 34 | { 35 | console.log("producer closed [producer.id:%s]", producer.id); 36 | }); 37 | }); 38 | 39 | transport.observer.on("newconsumer", (consumer) => 40 | { 41 | console.log( 42 | "new consumer created [transport.id:%s, consumer.id:%s]", 43 | transport.id, consumer.id); 44 | 45 | consumer.observer.on("close", () => 46 | { 47 | console.log("consumer closed [consumer.id:%s]", consumer.id); 48 | }); 49 | }); 50 | 51 | transport.observer.on("newdataproducer", (dataProducer) => 52 | { 53 | console.log( 54 | "new data producer created [transport.id:%s, dataProducer.id:%s]", 55 | transport.id, dataProducer.id); 56 | 57 | dataProducer.observer.on("close", () => 58 | { 59 | console.log("data producer closed [dataProducer.id:%s]", dataProducer.id); 60 | }); 61 | }); 62 | 63 | transport.observer.on("newdataconsumer", (dataConsumer) => 64 | { 65 | console.log( 66 | "new data consumer created [transport.id:%s, dataConsumer.id:%s]", 67 | transport.id, dataConsumer.id); 68 | 69 | dataConsumer.observer.on("close", () => 70 | { 71 | console.log("data consumer closed [dataConsumer.id:%s]", dataConsumer.id); 72 | }); 73 | }); 74 | }); 75 | ``` 76 | 77 |
78 | -------------------------------------------------------------------------------- /_includes/documentation/v3/mediasoup-client/index.md: -------------------------------------------------------------------------------- 1 | Client side JavaScript library for browsers and Node.js clients. 2 | 3 | * [Design](/documentation/v3/mediasoup-client/design/) 4 | * [Installation](/documentation/v3/mediasoup-client/installation/) 5 | * [API](/documentation/v3/mediasoup-client/api/) 6 | * [React Native](/documentation/v3/mediasoup-client/react-native/) 7 | * [Debugging](/documentation/v3/mediasoup-client/debugging/) 8 | -------------------------------------------------------------------------------- /_includes/documentation/v3/mediasoup/api/ActiveSpeakerObserver.md: -------------------------------------------------------------------------------- 1 | ## ActiveSpeakerObserver 2 | {: #ActiveSpeakerObserver} 3 | 4 |
5 | 6 | > `@inherits` [RtpObserver](#RtpObserver) 7 | 8 | An active speaker observer monitors the speech activity of the selected audio producers. It just handles audio producers (if [addProducer()](#rtpObserver-addProducer) is called with a video producer it will fail). 9 | 10 | Implementation of Dominant Speaker Identification for Multipoint Videoconferencing by Ilana Volfin and Israel Cohen. This implementation uses the RTP Audio Level extension from RFC-6464 for the input signal. This has been ported from [DominantSpeakerIdentification.java](https://github.com/jitsi/jitsi-utils/blob/master/src/main/java/org/jitsi/utils/dsi/DominantSpeakerIdentification.java) in Jitsi. Audio levels used for speech detection are read from an RTP header extension. No decoding of audio data is done. See [RFC6464](https://tools.ietf.org/html/rfc6464) for more information. 11 | 12 |
13 | 14 | 15 | ### Dictionaries 16 | {: #ActiveSpeakerDetection-dictionaries} 17 | 18 |
19 | 20 | #### ActiveSpeakerObserverOptions 21 | {: #ActiveSpeakerObserverOptions .code} 22 | 23 |
24 | 25 | Field | Type | Description | Required | Default 26 | -------------- | ------- | ------------ | -------- | ---------- 27 | `interval` | Number | Interval in ms for checking audio volumes. | No | 300 28 | `appData` | [AppData](#AppData) | Custom application data. | No | `{ }` 29 | 30 |
31 | 32 | 33 | #### ActiveSpeakerObserverDominantSpeaker 34 | {: #ActiveSpeakerObserverDominantSpeaker .code} 35 | 36 |
37 | 38 | Field | Type | Description | Required | Default 39 | -------------- | ------- | ------------ | -------- | ---------- 40 | `producer` | [Producer](#Producer) | The dominant audio producer instance. | Yes | 41 | 42 |
43 | 44 |
45 | 46 | 47 | ### Properties 48 | {: #ActiveSpeakerObserver-properties} 49 | 50 |
51 | 52 | See also [RtpObserver Properties](#RtpObserver-properties). 53 | 54 |
55 | 56 | 57 | ### Methods 58 | {: #ActiveSpeakerObserver-methods} 59 | 60 |
61 | 62 | See also [RtpObserver Methods](#RtpObserver-methods). 63 | 64 |
65 | 66 | 67 | ### Events 68 | {: #ActiveSpeakerObserver-events} 69 | 70 |
71 | 72 | See also [RtpObserver Events](#RtpObserver-events). 73 | 74 | #### activeSpeakerObserver.on("dominantspeaker", fn(dominantSpeaker)) 75 | {: #activeSpeakerObserver-on-producer .code} 76 | 77 | Emitted when a new dominant speaker is detected. 78 | 79 |
80 | 81 | Argument | Type | Description 82 | --------- | ------- | ---------------- 83 | `dominantSpeaker` | [ActiveSpeakerObserverDominantSpeaker](#ActiveSpeakerObserverDominantSpeaker) | Speaker with most dominant audio in the last interval. 84 | 85 |
86 | 87 |
88 | 89 | 90 | ### Observer Events 91 | {: #ActiveSpeakerObserver-observer-events} 92 | 93 |
94 | 95 | See also [RTP Observer Observer Events](#RtpObserver-observer-events). 96 | 97 | #### activeSpeakerObserver.observer.on("dominantspeaker", fn(dominantSpeaker)) 98 | {: #activeSpeakerObserver-observer-on-producer .code} 99 | 100 | Same as the [producer](#activeSpeakerObserver-on-dominantspeaker) event. 101 | 102 |
103 | -------------------------------------------------------------------------------- /_includes/documentation/v3/mediasoup/api/AudioLevelObserver.md: -------------------------------------------------------------------------------- 1 | ## AudioLevelObserver 2 | {: #AudioLevelObserver} 3 | 4 |
5 | 6 | > `@inherits` [RtpObserver](#RtpObserver) 7 | 8 | An audio level observer monitors the volume of the selected audio producers. It just handles audio producers (if [addProducer()](#rtpObserver-addProducer) is called with a video producer it will fail). 9 | 10 | Audio levels are read from an RTP header extension. No decoding of audio data is done. See [RFC6464](https://tools.ietf.org/html/rfc6464) for more information. 11 | 12 |
13 | 14 | 15 | ### Dictionaries 16 | {: #AudioLevelObserver-dictionaries} 17 | 18 |
19 | 20 | #### AudioLevelObserverOptions 21 | {: #AudioLevelObserverOptions .code} 22 | 23 |
24 | 25 | Field | Type | Description | Required | Default 26 | -------------- | ------- | ------------ | -------- | ---------- 27 | `maxEntries` | Number | Maximum number of entries in the "volumes" event. | No | 1 28 | `threshold` | Number | Minimum average volume (in dBvo from -127 to 0) for entries in the "volumes" event. | No | -80 29 | `interval` | Number | Interval in ms for checking audio volumes. | No | 1000 30 | `appData` | [AppData](#AppData) | Custom application data. | No | `{ }` 31 | 32 |
33 | 34 | 35 | #### AudioLevelObserverVolume 36 | {: #AudioLevelObserverVolume .code} 37 | 38 |
39 | 40 | Field | Type | Description | Required | Default 41 | -------------- | ------- | ------------ | -------- | ---------- 42 | `producer` | [Producer](#Producer) | The audio producer instance. | Yes | 43 | `volume` | Number | The average volume (in dBvo from -127 to 0) of the audio producer in the last interval. | Yes | 44 | 45 |
46 | 47 |
48 | 49 | 50 | ### Properties 51 | {: #AudioLevelObserver-properties} 52 | 53 |
54 | 55 | See also [RtpObserver Properties](#RtpObserver-properties). 56 | 57 |
58 | 59 | 60 | ### Methods 61 | {: #AudioLevelObserver-methods} 62 | 63 |
64 | 65 | See also [RtpObserver Methods](#RtpObserver-methods). 66 | 67 |
68 | 69 | 70 | ### Events 71 | {: #AudioLevelObserver-events} 72 | 73 |
74 | 75 | See also [RtpObserver Events](#RtpObserver-events). 76 | 77 | #### audioLevelObserver.on("volumes", fn(volumes)) 78 | {: #audioLevelObserver-on-volumes .code} 79 | 80 | Emitted at most every `interval` ms (see [AudioLevelObserverOptions](#AudioLevelObserverOptions)). 81 | 82 |
83 | 84 | Argument | Type | Description 85 | --------- | ------- | ---------------- 86 | `volumes` | Array<[AudioLevelObserverVolume](#AudioLevelObserverVolume)> | Audio volumes entries ordered by `volume` (louder ones go first). 87 | 88 |
89 | 90 | #### audioLevelObserver.on("silence") 91 | {: #audioLevelObserver-on-silence .code} 92 | 93 | Emitted when no one of the producers in this RTP observer is generating audio with a volume beyond the given threshold. 94 | 95 |
96 | 97 | 98 | ### Observer Events 99 | {: #AudioLevelObserver-observer-events} 100 | 101 |
102 | 103 | See also [RTP Observer Observer Events](#RtpObserver-observer-events). 104 | 105 | #### audioLevelObserver.observer.on("volumes", fn(volumes)) 106 | {: #audioLevelObserver-observer-on-volumes .code} 107 | 108 | Same as the [volumes](#audioLevelObserver-on-volumes) event. 109 | 110 | #### audioLevelObserver.observer.on("silence") 111 | {: #audioLevelObserver-observer-on-silence .code} 112 | 113 | Same as the [silence](#audioLevelObserver-on-silence) event. 114 | 115 |
116 | -------------------------------------------------------------------------------- /_includes/documentation/v3/mediasoup/api/observer-api.md: -------------------------------------------------------------------------------- 1 | ## Observer API 2 | {: #observer-api} 3 | 4 |
5 | 6 | Most entities in mediasoup expose a `observer` property (a Node.js [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter)) that can be used by third party libraries to monitor everything related to mediasoup. 7 | 8 | The observer API should not be directly used by the application itself, but by separate modules or libraries that the application integrate into its code. Such a module or library may, for example, monitor all the creation and closure of workers, routers, transports, etc. It could also monitor events generated by producers and consumers ("pause", "resume", "score", "layerschange", etc). 9 | 10 | Usage example: 11 | 12 | ```javascript 13 | const mediasoup = require("mediasoup"); 14 | 15 | mediasoup.observer.on("newworker", (worker) => 16 | { 17 | console.log("new worker created [worke.pid:%d]", worker.pid); 18 | 19 | worker.observer.on("close", () => 20 | { 21 | console.log("worker closed [worker.pid:%d]", worker.pid); 22 | }); 23 | 24 | worker.observer.on("newrouter", (router) => 25 | { 26 | console.log( 27 | "new router created [worker.pid:%d, router.id:%s]", 28 | worker.pid, router.id); 29 | 30 | router.observer.on("close", () => 31 | { 32 | console.log("router closed [router.id:%s]", router.id); 33 | }); 34 | 35 | router.observer.on("newtransport", (transport) => 36 | { 37 | console.log( 38 | "new transport created [worker.pid:%d, router.id:%s, transport.id:%s]", 39 | worker.pid, router.id, transport.id); 40 | 41 | transport.observer.on("close", () => 42 | { 43 | console.log("transport closed [transport.id:%s]", transport.id); 44 | }); 45 | 46 | transport.observer.on("newproducer", (producer) => 47 | { 48 | console.log( 49 | "new producer created [worker.pid:%d, router.id:%s, transport.id:%s, producer.id:%s]", 50 | worker.pid, router.id, transport.id, producer.id); 51 | 52 | producer.observer.on("close", () => 53 | { 54 | console.log("producer closed [producer.id:%s]", producer.id); 55 | }); 56 | }); 57 | 58 | transport.observer.on("newconsumer", (consumer) => 59 | { 60 | console.log( 61 | "new consumer created [worker.pid:%d, router.id:%s, transport.id:%s, consumer.id:%s]", 62 | worker.pid, router.id, transport.id, consumer.id); 63 | 64 | consumer.observer.on("close", () => 65 | { 66 | console.log("consumer closed [consumer.id:%s]", consumer.id); 67 | }); 68 | }); 69 | 70 | transport.observer.on("newdataproducer", (dataProducer) => 71 | { 72 | console.log( 73 | "new data producer created [worker.pid:%d, router.id:%s, transport.id:%s, dataProducer.id:%s]", 74 | worker.pid, router.id, transport.id, dataProducer.id); 75 | 76 | dataProducer.observer.on("close", () => 77 | { 78 | console.log("data producer closed [dataProducer.id:%s]", dataProducer.id); 79 | }); 80 | }); 81 | 82 | transport.observer.on("newdataconsumer", (dataConsumer) => 83 | { 84 | console.log( 85 | "new data consumer created [worker.pid:%d, router.id:%s, transport.id:%s, dataConsumer.id:%s]", 86 | worker.pid, router.id, transport.id, dataConsumer.id); 87 | 88 | dataConsumer.observer.on("close", () => 89 | { 90 | console.log("data consumer closed [dataConsumer.id:%s]", dataConsumer.id); 91 | }); 92 | }); 93 | }); 94 | }); 95 | 96 | worker.observer.on("newwebrtcserver", (webRtcServer) => 97 | { 98 | console.log( 99 | "new WebRTC server created [worker.pid:%d, webRtcServer.id:%s]", 100 | worker.pid, webRtcServer.id); 101 | 102 | webRtcServer.observer.on("close", () => 103 | { 104 | console.log("WebRTC server closed [webRtcServer.id:%s]", webRtcServer.id); 105 | }); 106 | }); 107 | }); 108 | ``` 109 | 110 |
111 | -------------------------------------------------------------------------------- /_includes/documentation/v3/mediasoup/index.md: -------------------------------------------------------------------------------- 1 | C++ SFU and server side Node.js module. 2 | 3 | * [Design](/documentation/v3/mediasoup/design/) 4 | * [Installation](/documentation/v3/mediasoup/installation/) 5 | * [API](/documentation/v3/mediasoup/api/) 6 | * [RTP Parameters and Capabilities](/documentation/v3/mediasoup/rtp-parameters-and-capabilities/) 7 | * [SCTP Parameters](/documentation/v3/mediasoup/sctp-parameters/) 8 | * [SRTP Parameters](/documentation/v3/mediasoup/srtp-parameters/) 9 | * [RTC Statistics](/documentation/v3/mediasoup/rtc-statistics/) 10 | * [Garbage Collection](/documentation/v3/mediasoup/garbage-collection/) 11 | * [Debugging](/documentation/v3/mediasoup/debugging/) 12 | -------------------------------------------------------------------------------- /_includes/header.html: -------------------------------------------------------------------------------- 1 |
2 |

mediasoup

3 | 4 | 5 |
6 | -------------------------------------------------------------------------------- /_includes/menu.html: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /_layouts/layout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% if page.home %} 6 | mediasoup 7 | {% else %} 8 | mediasoup :: {{ page.title }} 9 | {% endif %} 10 | 11 | 12 | 13 | {% if page.home %} 14 | 15 | {% else %} 16 | 17 | {% endif %} 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | {% unless page.home %} 39 | {% include header.html %} 40 | {% endunless %} 41 | 42 | {% include menu.html %} 43 | 44 |
45 | {% if page.home %} 46 |
47 | {{ content }} 48 |
49 | {% else %} 50 |
51 | {% include breadcrumbs.html %} 52 | {{ content }} 53 |
54 | {% endif %} 55 |
56 | 57 | 65 | 66 |
67 | 68 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /_plugins/breadcrumbs.rb: -------------------------------------------------------------------------------- 1 | require_relative 'drops/breadcrumb_item.rb' 2 | 3 | Jekyll::Hooks.register [:pages, :documents], :pre_render do |side, payload| # documents are collections, and collections include also posts 4 | drop = Drops::BreadcrumbItem 5 | 6 | if side.url == "/" 7 | then payload["breadcrumbs"] = [ 8 | drop.new(side, payload) 9 | ] 10 | else 11 | payload["breadcrumbs"] = [] 12 | path = side.url.split("/") 13 | 14 | 0.upto(path.size - 1) do |int| 15 | joined_path = path[0..int].join("/") 16 | sides = [].concat(side.site.pages).concat(side.site.documents) 17 | item = sides.find { |side_| joined_path == "" && side_.url == "/" || side_.url.chomp("/") == joined_path } 18 | payload["breadcrumbs"] << drop.new(item, payload) if item 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /_plugins/drops/breadcrumb_item.rb: -------------------------------------------------------------------------------- 1 | module Drops 2 | class BreadcrumbItem < Liquid::Drop 3 | extend Forwardable 4 | 5 | def_delegator :@page, :data 6 | def_delegator :@page, :url 7 | 8 | def initialize(page, payload) 9 | @payload = payload 10 | @page = page 11 | end 12 | 13 | def title 14 | @page.data["breadcrumb"] != nil ? @page.data["breadcrumb"] : @page.data["title"] 15 | end 16 | 17 | def namespace 18 | @page.data["namespace"] 19 | end 20 | 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /documentation/examples.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Examples 3 | anchors : true 4 | --- 5 | 6 | 7 | # Examples 8 | 9 | 10 | ### versatica/mediasoup-demo 11 | 12 | **Project:** [https://github.com/versatica/mediasoup-demo](https://github.com/versatica/mediasoup-demo) 13 | 14 | This is the "official" mediasoup demo made by mediasoup authors. Said that, we (the authors) don't want this demo to become the "mediasoup reference" and encourage developers to read the API documentation instead. 15 | 16 | The **mediasoup-demo** has a client side web application and a server side Node.js application: 17 | 18 | * The client side is a [React](https://reactjs.org) application that uses [mediasoup-client](https://github.com/versatica/mediasoup-client) and [protoo-client](https://www.npmjs.com/package/protoo-client) among other libraries. 19 | * The server side is a Node.js application that uses [mediasoup](https://github.com/versatica/mediasoup) and [protoo-server](https://www.npmjs.com/package/protoo-server). 20 | * [protoo](https://protoo.versatica.com) is a JavaScript library for both, client and server sides, that provides an easy way for clients to connect via WebSocket to a shared room. The API offers request/response transactions and notifications in both directions. 21 | - As an alternative (there are many) readers may be more used to [socket.io](https://socket.io). 22 | 23 | 24 | ### versatica/mediasoup-broadcaster-demo 25 | 26 | **Project:** [https://github.com/versatica/mediasoup-broadcaster-demo](https://github.com/versatica/mediasoup-broadcaster-demo) 27 | 28 | Made by [mediasoup authors](https://github.com/versatica), this project is a 29 | [libmediasoupclient](https://github.com/versatica/libmediasoupclient/) based application that takes the system microphone and webcam and produces the media to the specified room in [mediasoup-demo](https://github.com/versatica/mediasoup-demo/) application. 30 | 31 | 32 | ### Kurento/mediasoup-demos 33 | 34 | **Project:** [https://github.com/Kurento/mediasoup-demos](https://github.com/Kurento/mediasoup-demos) 35 | 36 | Contains mediasoup + Kurento integration projects. 37 | 38 | 39 | ### vpalmisano/mediasoupbin 40 | 41 | **Project:** [https://github.com/vpalmisano/mediasoupbin](https://github.com/vpalmisano/mediasoupbin) 42 | 43 | GStreamer plugin for mediasoup-demo. 44 | 45 | 46 | ### havfo/multiparty-meeting 47 | 48 | **Project:** [https://github.com/havfo/multiparty-meeting](https://github.com/havfo/multiparty-meeting) 49 | 50 | **Web:** [https://letsmeet.no](https://letsmeet.no) 51 | 52 | Multiparty web-meetings using mediasoup and WebRTC. It started as a fork of mediasoup-demo but has evolved quite a bit. 53 | 54 | 55 | ### ethand91/mediasoup3-record-demo 56 | 57 | **Project:** [https://github.com/ethand91/mediasoup3-record-demo](https://github.com/ethand91/mediasoup3-record-demo) 58 | 59 | Simple audio/video record application using mediasoup and GStreamer or FFmpeg. 60 | 61 | 62 | ### mkhahani/mediasoup-sample-app 63 | 64 | **Project:** [https://github.com/mkhahani/mediasoup-sample-app](https://github.com/mkhahani/mediasoup-sample-app) 65 | 66 | A minimal client/server app based on Mediasoup and Socket.io made by [@mkhahani](https://github.com/mkhahani). 67 | 68 | 69 | ### daily-co/mediasoup-sandbox 70 | 71 | **Project:** [https://github.com/daily-co/mediasoup-sandbox/tree/master/single-page](https://github.com/daily-co/mediasoup-sandbox/tree/master/single-page) 72 | 73 | Sample code with the the simplest possible signaling, and fewest possible dependencies, for cross-browser testing of: 74 | 75 | * Sending/receiving audio and video tracks 76 | * Switching to a different input device and replacing a track 77 | * Screen sharing 78 | * Subscribing to and unsubscribing from tracks 79 | * Pausing tracks for sender and receiver independently 80 | * Simulcast 81 | * Setting maximum simulcast layer when sending 82 | * Setting maximum simulcast layer when receiving 83 | * Display of stats 84 | * Display of "active speaker" 85 | 86 | 87 | ### Dirvann/mediasoup-sfu-webrtc-video-rooms 88 | 89 | **Project:** [https://github.com/Dirvann/mediasoup-sfu-webrtc-video-rooms](https://github.com/Dirvann/mediasoup-sfu-webrtc-video-rooms) 90 | 91 | Example website for multi-party video/audio/screen conferencing using mediasoup. This project is intended to better understand how mediasoup works with a simple example. 92 | 93 | 94 | ### Others 95 | 96 | Other public projects using mediasoup can be found in [GitHub](https://github.com/versatica/mediasoup/network/dependents). 97 | 98 | -------------------------------------------------------------------------------- /documentation/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Documentation 3 | --- 4 | 5 | 6 | # Documentation 7 | 8 | ##### [Overview](/documentation/overview/) 9 | 10 | A brief introduction to mediasoup and its ecosystem. 11 | 12 | ##### [v3 Documentation](/documentation/v3/) 13 | 14 | mediasoup, mediasoup-rust, mediasoup-client and libmediasoupclient v3. 15 | 16 | ##### [v2 Documentation](/documentation/v2/) 17 | 18 | mediasoup and mediasoup-client v2. 19 | 20 | ##### [v1 Documentation](/documentation/v1/) 21 | 22 | mediasoup v1. 23 | 24 | ##### [Examples](/documentation/examples/) 25 | 26 | mediasoup usage samples. 27 | 28 | ##### [Publications](/documentation/publications/) 29 | 30 | Publications and studies about mediasoup. 31 | -------------------------------------------------------------------------------- /documentation/overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Overview 3 | anchors : true 4 | --- 5 | 6 | 7 | # Overview 8 | 9 | An [SFU](https://webrtcglossary.com/sfu/) (Selective Forwarding Unit) receives audio and video streams from endpoints and relays them to everyone else (endpoints send one and receive many). Each receiver endpoint can select which streams and spatial/temporal layers it receives. Compared to a mixer or [MCU](https://webrtcglossary.com/mcu/) (Multipoint Conferencing Unit) this design leads to a better performance, higher throughput and less latency. It's highly scalable and requires much less resources given that it does not transcode or mix media. 10 | 11 | Since endpoints get the other endpoints' media separately, they can have a personalized layout and choose which streams to render and how to display them. 12 | 13 |
14 | Detailed information regarding the architecture of an SFU can be found at RFC 7667 "RTP Topologies" [section 3.7](https://tools.ietf.org/html/rfc7667#section-3.7). 15 |
16 | 17 | 18 | ## Design Goals 19 | 20 | mediasoup and its client side libraries are designed to accomplish with the following goals: 21 | 22 | * Be a [SFU](https://webrtcglossary.com/sfu/) (Selective Forwarding Unit). 23 | * Support both WebRTC and plain RTP input and output. 24 | * Be a Node.js module in server side. 25 | * Be a tiny JavaScript and C++ libraries in client side. 26 | * Be minimalist: just handle the media layer. 27 | * Be signaling agnostic: do not mandate any signaling protocol. 28 | * Be super low level API. 29 | * Support all existing WebRTC endpoints. 30 | * Enable integration with well known multimedia libraries/tools. 31 | 32 | 33 | ## Use Cases 34 | 35 | mediasoup and its client side libraries provide a super low level API. They are intended to enable different use cases and scenarios, without any constraint or assumption. Some of these use cases are: 36 | 37 | * Group video chat applications. 38 | * One-to-many (or few-to-many) broadcasting applications in real-time. 39 | * RTP streaming. 40 | -------------------------------------------------------------------------------- /documentation/publications.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Publications 3 | anchors : true 4 | --- 5 | 6 | 7 | # Publications 8 | 9 | 10 | ### Comparative Study of WebRTC Open Source SFUs for Video Conferencing 11 | 12 | "Comparative Study of WebRTC Open Source SFUs for Video Conferencing", by Emmanuel André, Nicolas Le Breton, Augustin Lemesle, Ludovic Roux and Alexandre Gouaillard ([CoSMo Software](https://www.cosmosoftware.io)), in "Proceedings of Principles, Systems and Applications of IP Telecommunications". 13 | 14 | * Illinois Institute of Technology, Chicago, USA 15 | * October 2018 16 | * [Download PDF](/resources/CoSMo_ComparativeStudyOfWebrtcOpenSourceSfusForVideoConferencing.pdf) 17 | 18 | This study used mediasoup v2. 19 | 20 | 21 | ### Performance Testing with mediasoup: 1:many video broadcasting 22 | 23 | Topic in the [mediasoup Discourse Group](https://mediasoup.discourse.group/) about performance of mediasoup v3 for 1:many video broadcasting using various mediasoup `workers` and `pipeToRouter()`. It includes performance testing numbers: 24 | 25 | * [Link to the topic](https://mediasoup.discourse.group/t/experience-with-mediasoup/1578) 26 | -------------------------------------------------------------------------------- /documentation/v1/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : v1 3 | --- 4 | 5 | 6 | # v1 Documentation 7 | 8 |
9 | mediasoup v1 is no longer documented. Sorry. Anyway it's no longer maintained so please move to the latest version. 10 |
11 | -------------------------------------------------------------------------------- /documentation/v2/glossary.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Glossary 3 | anchors : true 4 | --- 5 | 6 | 7 | # Glossary 8 | 9 | Both mediasoup and mediasoup-client refer to the same common entities that are represented in both client and server sides. Those entities are described below: 10 | 11 | 12 | ### Room 13 | {: #Glossary-Room} 14 | 15 | A **Room** represents a multi-party conference with N participants (**Peers**). Within a **Room**, audio and video tracks generated by a client/browser are relayed to all the participants. 16 | 17 | 18 | ### Peer 19 | {: #Glossary-Peer} 20 | 21 | A **Peer** represents a participant in the conference, thus it has a local (client side) representation and a remote (server side) representation. When a client joins a **Room** it also gets information about existing and new **Peers** in the conference. 22 | 23 | A **Peer** holds a set of associated **Transport**, **Producer** and **Consumer** instances. 24 | 25 | 26 | ### Transport 27 | {: #Glossary-Transport} 28 | 29 | A **Transport** represents a path for sending or receiving audio/video RTP and RTCP. In the context of WebRTC this means a network path negotiated by both, the client and the server, via ICE and DTLS. A **Transport** has an associated entity in both client and server sides. 30 | 31 | 32 | ### Producer 33 | {: #Glossary-Producer} 34 | 35 | A **Producer** represents and handles a media track (audio or video) sent by a client to the server. A **Producer** has an associated entity in both client and server sides, meaning that both sides (the client app and the server app) can run API methods on it (such as pausing or resuming it). 36 | 37 | In order to send the media track to the server, the **Producer** needs to be provided with a **Transport** instance. 38 | 39 | In mediasoup (server side) a **Producer** is connected with many **Consumers** associated to it. 40 | 41 | 42 | ### Consumer 43 | {: #Glossary-Consumer} 44 | 45 | A **Consumer** represents and handles a media track (audio or video) sent by the server to the client. A **Consumer** has an associated entity in both client and server sides, meaning that both sides (the client app and the server app) can run API methods on it (such as pausing or resuming it). 46 | 47 | Typically, a **Consumer** has a remote **Producer** as a source. In fact, an audio **Producer** created by Alice's **Peer** will trigger the creation of an audio **Consumer** in Bob's **Peer** and all the other **Peers**. 48 | 49 | It's up to the client side application whether to enable/activate a **Consumer** (by providing a **Transport**) or not. Once enabled, the corresponding RTP is relayed to the client. 50 | 51 | 52 | ### Profile 53 | {: #Glossary-Profile} 54 | 55 | A **Profile** represents a RTP quality layer and, hence, just makes sense for [simulcast](https://tools.ietf.org/html/draft-westerlund-avtcore-rtp-simulcast) streams. 56 | 57 | mediasoup defines the following profiles: 58 | 59 | * **default**: If no simulcast, it just points to the single audio or video RTP stream. When there is simulcast, this profile means the highest available stream. 60 | * **low**: The lowest profile. In simulcast this means the stream with lowest video resolution. 61 | * **medium**: The medium profile. In simulcast this means the stream with medium video resolution. 62 | * **high**: The highest profile. In simulcast this means the stream with highest video resolution. 63 | * **none**: Special case when there is no available stream (this may happen at **Consumer** level when no profile can be sent to the remote client). 64 | -------------------------------------------------------------------------------- /documentation/v2/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : v2 3 | --- 4 | 5 | 6 | # v2 Documentation 7 | 8 | ### General 9 | 10 | * [Glossary](/documentation/v2/glossary/) 11 | * [mediasoup protocol](/documentation/v2/mediasoup-protocol/) 12 | * [RTC stats](/documentation/v2/rtc-stats/) 13 | 14 | ### mediasoup 15 | 16 | {% include documentation/v2/mediasoup/index.md %} 17 | 18 | ### mediasoup-client 19 | 20 | {% include documentation/v2/mediasoup-client/index.md %} 21 | -------------------------------------------------------------------------------- /documentation/v2/mediasoup-client/api.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : API 3 | anchors : true 4 | apiToc : true 5 | class : h3color 6 | --- 7 | 8 | 9 |
10 | * Will be replaced with the ToC 11 | {: toc} 12 |
13 | 14 |
15 |
16 | 17 | 18 | # mediasoup-client v2 API 19 | 20 | {% include documentation/v2/mediasoup-client/api/mediasoupClient.md %} 21 | 22 | {% include documentation/v2/mediasoup-client/api/Room.md %} 23 | 24 | {% include documentation/v2/mediasoup-client/api/Transport.md %} 25 | 26 | {% include documentation/v2/mediasoup-client/api/Producer.md %} 27 | 28 | {% include documentation/v2/mediasoup-client/api/Peer.md %} 29 | 30 | {% include documentation/v2/mediasoup-client/api/Consumer.md %} 31 | -------------------------------------------------------------------------------- /documentation/v2/mediasoup-client/debugging.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Debugging 3 | anchors : true 4 | --- 5 | 6 | 7 | # Debugging 8 | 9 | 10 | ## Log Levels 11 | 12 | mediasoup-client uses the [debug](https://www.npmjs.com/package/debug) module to log to the browser console. 13 | 14 | There are three log severities: 15 | 16 | * **debug**: verbose information logged to `console.info` 17 | * **warn**: warning messages logged to `console.warn` 18 | * **error**: error messages logged to `console.error` 19 | 20 | All the logs generated by mediasoup-client have a namespace starting with "mediasoup-client" plus colon, followed by the log severity in upper case plus colon (just if "warn" or "error"), and followed by the internal component name (if any) and the log message. 21 | 22 | 23 | ## Enable Logging 24 | 25 | By default logging is turned off. In order to enable it, the `debug` key in the browser's `localStorage` must be set. 26 | 27 |
28 | Check the [debug](https://www.npmjs.com/package/debug) module documentation for further information regarding how to filter specific log messages based on namespace matching rules. 29 |
30 | 31 | 32 | ### Example 33 | 34 | Within the `` section of your HTML app: 35 | 36 | ```html 37 | 40 | 41 | 42 | ``` 43 | -------------------------------------------------------------------------------- /documentation/v2/mediasoup-client/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : mediasoup-client 3 | --- 4 | 5 | 6 | # Documentation 7 | 8 | Client side JavaScript library. 9 | 10 | * [Installation](/documentation/v2/mediasoup-client/installation/) 11 | * [API](/documentation/v2/mediasoup-client/api/) 12 | * [Debugging](/documentation/v2/mediasoup-client/debugging/) 13 | -------------------------------------------------------------------------------- /documentation/v2/mediasoup-client/installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Installation 3 | anchors : true 4 | --- 5 | 6 | 7 | # Installation 8 | 9 | Install mediasoup-client within you client application: 10 | 11 | ```bash 12 | $ npm install mediasoup-client@2 13 | ``` 14 | 15 | 16 | ## Usage 17 | 18 | Depending on how your web application loads libraries (for example, by using a JavaScript module loader) your may need to use one of the following ways to load mediasoup-client: 19 | 20 | * Using `import`: 21 | 22 | ```javascript 23 | import * as mediasoupClient from "mediasoup-client"; 24 | ``` 25 | 26 | * Using CommonJS with [browserify](http://browserify.org) or [webpack](https://webpack.github.io): 27 | 28 | ```javascript 29 | const mediasoupClient = require("mediasoup-client"); 30 | ``` 31 | -------------------------------------------------------------------------------- /documentation/v2/mediasoup-protocol.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : mediasoup protocol 3 | --- 4 | 5 | 6 | # mediasoup protocol 7 | 8 | Although mediasoup does not implement a signaling protocol, both the client (mediasoup-client) and the server (mediasoup) must exchange messages. Those messages can be **request**/**response** pairs or **notifications**, and can be sent in both directions. 9 | 10 | Those messages can be serialized to JSON bodies for network transmission, but may be converted into JavaScripts Objects (`JSON.parse()`) before they are given to the corresponding API methods in both mediasoup and mediasoup-client. 11 | 12 | The exact definition of the message payloads that must be exchanged is documented in the [MEDIASOUP_PROTOCOL.md](https://github.com/versatica/mediasoup-client/blob/v2/MEDIASOUP_PROTOCOL.md) file included in the mediasoup-client source code. 13 | 14 |
15 | The application developer does not need to know in depth about these messages, but can intercept them for advanced usages. 16 |
17 | 18 | 19 | ## Request/response pairs and notifications 20 | 21 | mediasoup-client can generate both **requests** and **notifications** to be sent to mediasoup, while mediasoup just generates **notifications** and **responses** for mediasoup-client. 22 | 23 | * A mediasoup protocol **request** is an Object that requires a **response** from the other side. 24 | * A mediasoup protocol **notification** is also an Object that includes a `notification: true` key/value and does **NOT** require a **response**. 25 | 26 |
27 | It's up to the application how to correlate those **requests** and their associated **responses**, for example by enveloping the **request** and its **response** into a signaling transaction that uses a `id` field to match them. 28 |
29 | 30 | 31 | ## Message target 32 | 33 | Both **requests** and **notifications** sent by mediasoup-client have a `target` key whose value can be "room" or "peer": 34 | 35 | * `target: "room"` means that the **request** or **notification** must be delivered to the corresponding server side [Room](/documentation/v2/mediasoup/api/#Room). 36 | * The `Room` just accepts **requests** by calling to its [room.receiveRequest()](/documentation/v2/mediasoup/api/#room-receiveRequest) method. 37 | * `target: "peer"` means that the **request** or **notification** must be delivered to the corresponding server side [Peer](/documentation/v2/mediasoup/api/#Peer). 38 | * The `Peer` accepts **requests** by calling to its [peer.receiveRequest()](/documentation/v2/mediasoup/api/#peer-receiveRequest) method. 39 | * The `Peer` accepts **notifications** by calling to its [peer.receiveNotification()](/documentation/v2/mediasoup/api/#peer-receiveNotification) method. 40 | 41 |
42 | It's up to the application how to correlate those **requests** and their associated **responses**, for example by enveloping the **request** and its **response** into a signaling transaction that uses a `id` field to match them. 43 |
44 | 45 | 46 | ## Message examples 47 | 48 | Those real messages are directly taken from the [MEDIASOUP_PROTOCOL.md](https://github.com/versatica/mediasoup-client/blob/v2/MEDIASOUP_PROTOCOL.md) file included in the mediasoup-client source code. Here they are represented in JSON format. 49 | 50 | 51 | ### mediasoup-client request sent to the mediasoup Room 52 | 53 | * **request**: 54 | 55 | ```json 56 | { 57 | "method": "queryRoom", 58 | "target": "room" 59 | } 60 | ``` 61 | 62 | * **response**: 63 | 64 | ```json 65 | { 66 | "rtpCapabilities": {}, 67 | "mandatoryCodecPayloadTypes": [] 68 | } 69 | ``` 70 | 71 | ### mediasoup-client request sent to the mediasoup Peer 72 | 73 | * **request**: 74 | 75 | ```json 76 | { 77 | "method": "createTransport", 78 | "target": "peer", 79 | "id": 1111, 80 | "options": {}, 81 | "dtlsParameters": {}, 82 | "appData": "foo" 83 | } 84 | ``` 85 | 86 | * **response**: 87 | 88 | ```json 89 | { 90 | "iceParameters": {}, 91 | "iceCandidates": [], 92 | "dtlsParameters": {} 93 | } 94 | ``` 95 | 96 | ### mediasoup-client notification sent to the mediasoup Peer 97 | 98 | * **notification**: 99 | 100 | ```json 101 | { 102 | "method": "leave", 103 | "target": "peer", 104 | "notification": true, 105 | "appData": 1234 106 | } 107 | ``` 108 | 109 | ### mediasoup notification sent to the mediasoup-client Peer 110 | 111 | * **notification**: 112 | 113 | ```json 114 | { 115 | "method": "transportStats", 116 | "target": "peer", 117 | "notification": true, 118 | "id": 3333, 119 | "stats": [] 120 | } 121 | ``` 122 | -------------------------------------------------------------------------------- /documentation/v2/mediasoup/api.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : API 3 | anchors : true 4 | apiToc : true 5 | class : h3color 6 | --- 7 | 8 | 9 |
10 | * Will be replaced with the ToC 11 | {: toc} 12 |
13 | 14 |
15 |
16 | 17 | 18 | # mediasoup v2 API 19 | 20 | {% include documentation/v2/mediasoup/api/mediasoup.md %} 21 | 22 | {% include documentation/v2/mediasoup/api/Server.md %} 23 | 24 | {% include documentation/v2/mediasoup/api/Room.md %} 25 | 26 | {% include documentation/v2/mediasoup/api/Peer.md %} 27 | 28 | {% include documentation/v2/mediasoup/api/Transport.md %} 29 | 30 | {% include documentation/v2/mediasoup/api/WebRtcTransport.md %} 31 | 32 | {% include documentation/v2/mediasoup/api/PlainRtpTransport.md %} 33 | 34 | {% include documentation/v2/mediasoup/api/Producer.md %} 35 | 36 | {% include documentation/v2/mediasoup/api/Consumer.md %} 37 | 38 | {% include documentation/v2/mediasoup/api/ActiveSpeakerDetector.md %} 39 | 40 | {% include documentation/v2/mediasoup/api/RtpStreamer.md %} 41 | 42 | {% include documentation/v2/mediasoup/api/errors.md %} 43 | -------------------------------------------------------------------------------- /documentation/v2/mediasoup/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : mediasoup 3 | --- 4 | 5 | 6 | # Documentation 7 | 8 | C++ SFU and server side Node.js module. 9 | 10 | * [Installation](/documentation/v2/mediasoup/installation/) 11 | * [API](/documentation/v2/mediasoup/api/) 12 | * [Debugging](/documentation/v2/mediasoup/debugging/) 13 | -------------------------------------------------------------------------------- /documentation/v2/mediasoup/installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Installation 3 | anchors : true 4 | --- 5 | 6 | 7 | # Installation 8 | 9 | Install the mediasoup Node.js module via NPM within your Node.js application: 10 | 11 | ```bash 12 | $ npm install mediasoup@2 13 | ``` 14 | 15 | 16 | ## Requirements 17 | 18 | In order to build the C/C++ component the following packages and libraries must be available in the target host: 19 | 20 | * Node.js >= `v6.4.0` 21 | * POSIX based operating system (Windows not supported) 22 | * Python 2 (`python2` or `python` command must point to the Python 2 executable) 23 | * `make` 24 | * `gcc` and `g++` or `clang` (with C++11 support) 25 | * `cc` command pointing to `gcc` or `clang` 26 | 27 |
28 | * In Debian and Ubuntu install the `build-essential` DEB package. It includes both `make` and `gcc`/`g++`. 29 | * In YUM based Linux (Red Hat, CentOS) use `yum groupinstall "Development Tools"`. 30 | * The installation path MUST NOT contain whitespaces. 31 |
32 | -------------------------------------------------------------------------------- /documentation/v2/rtc-stats.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : RTC stats 3 | anchors : true 4 | --- 5 | 6 | 7 | # RTC stats 8 | 9 | Similar to [WebRTC](https://w3c.github.io/webrtc-stats/) and [ORTC](https://draft.ortc.org/#rtcstats-dictionary), mediasoup provides stats in server side. If enabled, they are also delivered to mediasoup-client. 10 | 11 | Currently stats are generated for the following entities: 12 | 13 | * [WebRtcTransport](/documentation/v2/mediasoup/api/#WebRtcTransport) 14 | * [Producer](/documentation/v2/mediasoup/api/#Producer) 15 | * [Consumer](/documentation/v2/mediasoup/api/#Consumer) 16 | 17 | Stats are an Array of Objects. 18 | 19 | 20 | ## Examples 21 | 22 | ### Video consumer stats 23 | 24 | When enabling stats for a `consumer`, received stats look as follows: 25 | 26 | ```js 27 | [ 28 | { 29 | bitrate: 126032 30 | byteCount: 3813723 31 | firCount: 0 32 | fractionLost: 0 33 | id: '8nvfesjqo5ntjm3k' 34 | jitter: 17 35 | kind: 'video' 36 | mediaType: 'video' 37 | mimeType: 'video/VP8' 38 | nackCount: 16 39 | packetCount: 4566 40 | packetsDiscarded: 0 41 | packetsLost: 10 42 | packetsRepaired: 8 43 | pliCount: 29 44 | sliCount: 0 45 | ssrc: 3514166852 46 | timestamp: 139426926 47 | type: 'inbound-rtp' 48 | }, 49 | { 50 | bitrate: 126032 51 | byteCount: 6025653 52 | firCount: 0 53 | fractionLost: 0 54 | id: 'x2dtpsmtsmnp7dwp' 55 | inboundRtpId: '8nvfesjqo5ntjm3k' 56 | kind: 'video' 57 | mediaType: 'video' 58 | mimeType: 'video/VP8' 59 | nackCount: 17 60 | packetCount: 6431 61 | packetsDiscarded: 0 62 | packetsLost: 38 63 | packetsRepaired: 14 64 | pliCount: 0 65 | roundTripTime: 25 66 | sliCount: 0 67 | ssrc: 93410199 68 | timestamp: 139426926 69 | transportId: 20102291 70 | type: 'outbound-rtp' 71 | } 72 | ] 73 | ``` 74 | 75 | Here there is an Array with two Objects, one for the stream being consumed by the `consumer` (with `type: 'outbound-rtp'`) and another with the stats of the associated `producer` (`type: 'inbound-rtp'`). Note that the second one includes a `inboundRtpId: '8nvfesjqo5ntjm3k'` field referencing the associated `producer`'s stats Object within the array. 76 | 77 |
78 | When the `producer` uses simulcast (so it sends N streams with different SSRC values) the stats Object with `type: 'inbound-rtp'` references the stats of the specific inbound stream with same profile ("low", "medium" or "high") that the `consumer` is receiving in that moment. 79 |
80 | 81 | -------------------------------------------------------------------------------- /documentation/v3/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : v3 3 | --- 4 | 5 | 6 | # v3 Documentation 7 | 8 | ### General 9 | 10 | * [Communication Between Client and Server](/documentation/v3/communication-between-client-and-server/) 11 | * [Scalability](/documentation/v3/scalability/) 12 | * [Tricks](/documentation/v3/tricks/) 13 | 14 | ### mediasoup 15 | 16 | {% include documentation/v3/mediasoup/index.md %} 17 | 18 | ### mediasoup-rust 19 | 20 | Brings the same powerful C++ SFU to the Rust ecosystem, shares design philosophy with Node.js module. 21 | 22 | * [Documentation on docs.rs](https://docs.rs/mediasoup) 23 | * [Crate on crates.io](https://crates.io/crates/mediasoup) 24 | 25 | ### mediasoup-client 26 | 27 | {% include documentation/v3/mediasoup-client/index.md %} 28 | 29 | ### libmediasoupclient 30 | 31 | {% include documentation/v3/libmediasoupclient/index.md %} 32 | 33 | ### mediasoup-client-aiortc 34 | 35 | mediasoup-client handler for [aiortc](https://github.com/aiortc/aiortc/) Python library. Suitable for building Node.js applications that connect to a mediasoup server using WebRTC and exchange real audio, video and DataChannel messages with it in both directions. 36 | 37 | Documentation is exposed in the project [README](https://github.com/versatica/mediasoup-client-aiortc/blob/v3/README.md) file. 38 | -------------------------------------------------------------------------------- /documentation/v3/libmediasoupclient/api.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : API 3 | anchors : true 4 | apiToc : true 5 | class : h3color 6 | --- 7 | 8 | 9 |
10 | * Will be replaced with the ToC 11 | {: toc} 12 |
13 | 14 |
15 |
16 | 17 | 18 | # libmediasoupclient v3 API 19 | 20 | {% include documentation/v3/libmediasoupclient/api/mediasoupclient.md %} 21 | 22 | {% include documentation/v3/libmediasoupclient/api/Device.md %} 23 | 24 | {% include documentation/v3/libmediasoupclient/api/Transport.md %} 25 | 26 | {% include documentation/v3/libmediasoupclient/api/TransportListener.md %} 27 | 28 | {% include documentation/v3/libmediasoupclient/api/SendTransport.md %} 29 | 30 | {% include documentation/v3/libmediasoupclient/api/SendTransportListener.md %} 31 | 32 | {% include documentation/v3/libmediasoupclient/api/RecvTransport.md %} 33 | 34 | {% include documentation/v3/libmediasoupclient/api/RecvTransportListener.md %} 35 | 36 | {% include documentation/v3/libmediasoupclient/api/Producer.md %} 37 | 38 | {% include documentation/v3/libmediasoupclient/api/ProducerListener.md %} 39 | 40 | {% include documentation/v3/libmediasoupclient/api/Consumer.md %} 41 | 42 | {% include documentation/v3/libmediasoupclient/api/ConsumerListener.md %} 43 | 44 | {% include documentation/v3/libmediasoupclient/api/DataProducer.md %} 45 | 46 | {% include documentation/v3/libmediasoupclient/api/DataProducerListener.md %} 47 | 48 | {% include documentation/v3/libmediasoupclient/api/DataConsumer.md %} 49 | 50 | {% include documentation/v3/libmediasoupclient/api/DataConsumerListener.md %} 51 | 52 | {% include documentation/v3/libmediasoupclient/api/Logger.md %} 53 | 54 | {% include documentation/v3/libmediasoupclient/api/LoggerLogHandlerInterface.md %} 55 | 56 | {% include documentation/v3/libmediasoupclient/api/nlohmann-json.md %} 57 | -------------------------------------------------------------------------------- /documentation/v3/libmediasoupclient/debugging.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Debugging 3 | anchors : true 4 | --- 5 | 6 | 7 | # libmediasoupclient v3 Debugging 8 | 9 |
10 | Take a look to the [Logger](/documentation/v3/libmediasoupclient/api/#Logger) API. 11 |
12 | -------------------------------------------------------------------------------- /documentation/v3/libmediasoupclient/design.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Design 3 | anchors : true 4 | --- 5 | 6 | 7 | # libmediasoupclient v3 Design 8 | 9 | libmediasoupclient is a C++ library based on [libwebrtc](https://webrtc.org/) for building mediasoup based C++ client side applications. 10 | 11 | 12 | ## Features 13 | 14 | * C++11 low level API. 15 | * Uses [libwebrtc](https://webrtc.org/) as native WebRTC engine. 16 | 17 | 18 | ## libwebrtc API 19 | 20 | The application is responsible of using the API exposed by libwebrtc to create instances of `webrtc::MediaStreamTrackInterface` (audio and video tracks) and use them to feed the API methods of libmediasoupclient. 21 | 22 |
23 | This is: libmediasoupclient does not expose any "track factory" API. The application must use libwebrtc for that. 24 |
25 | 26 | 27 | ## Multi Threading 28 | 29 | libmediasoup client does not implement multi-threading. All API methods marked as `@async` block the current thread until the underlaying operation is terminated. Such underlaying operation can be an operation executed by the libwebrtc stack or an operation executed by the user. 30 | 31 | Examples: 32 | 33 | * [device.GetRtpCapabilities()](/documentation/v3/libmediasoupclient/api/#device-GetRtpCapabilities) blocks the current thread until capabilities are internally retrieved and returns them. 34 | * [sendTransport.Produce()](/documentation/v3/libmediasoupclient/api/#SendTransport-Produce) internally performs SDP offer/answer in the underlaying `RTCPeerConnection` instance and blocks the thread until done. 35 | * The [SendTransport::Listener::OnProduce](/documentation/v3/libmediasoupclient/api/#SendTransportListener-OnProduce) event returns a `std::future` and waits for the application to fulfil it (once it communicates to the server). 36 | -------------------------------------------------------------------------------- /documentation/v3/libmediasoupclient/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : libmediasoupclient 3 | --- 4 | 5 | 6 | # libmediasoupclient v3 Documentation 7 | 8 | {% include documentation/v3/libmediasoupclient/index.md %} 9 | -------------------------------------------------------------------------------- /documentation/v3/mediasoup-client/api.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : API 3 | anchors : true 4 | apiToc : true 5 | class : h3color 6 | --- 7 | 8 | 9 |
10 | * Will be replaced with the ToC 11 | {: toc} 12 |
13 | 14 |
15 |
16 | 17 | 18 | # mediasoup-client v3 API 19 | 20 | {% include documentation/v3/mediasoup-client/api/mediasoupClient.md %} 21 | 22 | {% include documentation/v3/mediasoup-client/api/Device.md %} 23 | 24 | {% include documentation/v3/mediasoup-client/api/Transport.md %} 25 | 26 | {% include documentation/v3/mediasoup-client/api/Producer.md %} 27 | 28 | {% include documentation/v3/mediasoup-client/api/Consumer.md %} 29 | 30 | {% include documentation/v3/mediasoup-client/api/DataProducer.md %} 31 | 32 | {% include documentation/v3/mediasoup-client/api/DataConsumer.md %} 33 | 34 | {% include documentation/v3/mediasoup-client/api/observer-api.md %} 35 | -------------------------------------------------------------------------------- /documentation/v3/mediasoup-client/debugging.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Debugging 3 | anchors : true 4 | --- 5 | 6 | 7 | # mediasoup-client v3 Debugging 8 | 9 | * Will be replaced with the ToC 10 | {: toc} 11 | 12 | 13 | ## Log Levels 14 | {: #Log-Level} 15 | 16 | mediasoup-client uses the [debug](https://www.npmjs.com/package/debug) module to log to the browser console. 17 | 18 | There are three log severities: 19 | 20 | * **debug**: verbose information logged to `console.info` 21 | * **warn**: warning messages logged to `console.warn` 22 | * **error**: error messages logged to `console.error` 23 | 24 | All the logs generated by mediasoup-client have a namespace starting with "mediasoup-client" plus colon, followed by the log severity in upper case plus colon (just if "warn" or "error"), and followed by the internal component name (if any) and the log message. 25 | 26 | 27 | ## Enable Logging 28 | {: #Enable-Logging} 29 | 30 | By default logging is turned off. In order to enable it, the `debug` key in the browser's `localStorage` must be set. 31 | 32 |
33 | Check the [debug](https://www.npmjs.com/package/debug) module documentation for further information regarding how to filter specific log messages based on namespace matching rules. 34 |
35 | 36 | 37 | ### Example 38 | {: #Enable-Logging-Example} 39 | 40 | Within the `` section of your HTML app: 41 | 42 | ```html 43 | 46 | 47 | 48 | ``` 49 | -------------------------------------------------------------------------------- /documentation/v3/mediasoup-client/design.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Design 3 | anchors : true 4 | --- 5 | 6 | 7 | # mediasoup-client v3 Design 8 | 9 | mediasoup-client is a JavaScript library for building mediasoup based client side applications (such as web applications). It's a tiny library exposing a powerful cross-browser API and supports all current WebRTC browsers via different [handlers](https://github.com/versatica/mediasoup-client/tree/v3/src/handlers) for each model/version. 10 | 11 | 12 | ## Features 13 | 14 | * ECMAScript low level API. 15 | * Works in the browser and Node.js. 16 | 17 |
18 | There is no native WebRTC or RTP engine in Node.js. When running in Node.js the application must provide mediasoup-client with a custom [handler](/documentation/v3/mediasoup-client/api/#DeviceOptions) to control a 3rd party media/RTP library. 19 |
20 | -------------------------------------------------------------------------------- /documentation/v3/mediasoup-client/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : mediasoup-client 3 | --- 4 | 5 | 6 | # mediasoup-client v3 Documentation 7 | 8 | {% include documentation/v3/mediasoup-client/index.md %} 9 | -------------------------------------------------------------------------------- /documentation/v3/mediasoup-client/installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Installation 3 | anchors : true 4 | --- 5 | 6 | 7 | # mediasoup-client v3 Installation 8 | 9 | Install mediasoup-client within you client application: 10 | 11 | ```bash 12 | $ npm install mediasoup-client@3 13 | ``` 14 | 15 | 16 | ## Usage 17 | 18 | mediasoup-client is written in TypeScript and transpiled to JavaScript plus CommonJS. This is: it uses `require()` internally. 19 | 20 | This makes it work in the browser by properly using [browserify](http://browserify.org), [webpack](https://webpack.js.org) or similar tools, and also in Node.js (which does not yet implement `import`/`export`) . It's up to the application developer to decide how to integrate mediasoup-client into his client side application. 21 | 22 |
23 | mediasoup-client does not provide any bundled, minified and/or ES5 transpiled single file. There are tools out there to do that if your application needs it. 24 |
25 | 26 | Depending on how your web application loads libraries (for example, by using a JavaScript module loader) your may need to use one of the following ways to load mediasoup-client: 27 | 28 | * Using `import`: 29 | 30 | ```javascript 31 | import * as mediasoupClient from "mediasoup-client"; 32 | ``` 33 | 34 | * Using CommonJS with [browserify](http://browserify.org) or [webpack](https://webpack.github.io): 35 | 36 | ```javascript 37 | const mediasoupClient = require("mediasoup-client"); 38 | ``` 39 | -------------------------------------------------------------------------------- /documentation/v3/mediasoup-client/react-native.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : React Native 3 | anchors : true 4 | --- 5 | 6 | 7 | # React Native 8 | 9 | In order to use mediasoup-client in React Native (for building Android and iOS apps): 10 | 11 | - Include [react-native-webrtc](https://www.npmjs.com/package/react-native-webrtc) dependency into your React Native project. 12 | - Call mediasoup-client exposed [registerGlobals()](https://github.com/react-native-webrtc/react-native-webrtc#registerglobals) function **before** creating a mediasoup-client [Device](/documentation/v3/mediasoup-client/api/#Device-constructor) instance. 13 | 14 |
15 | * By calling `registerGlobals()`, classes such as `RTCPeerConnection` and `MediaStream` (among others) will be exposed in the global scope. 16 | * Those classes are required for the `ReactNative` handler (or the new `ReactNativeUnifiedPlan` handler) of mediasoup-client to work. 17 |
18 | -------------------------------------------------------------------------------- /documentation/v3/mediasoup/api.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : API 3 | anchors : true 4 | apiToc : true 5 | class : h3color 6 | --- 7 | 8 | 9 |
10 | * Will be replaced with the ToC 11 | {: toc} 12 |
13 | 14 |
15 |
16 | 17 | 18 | # mediasoup v3 API 19 | 20 | {% include documentation/v3/mediasoup/api/mediasoup.md %} 21 | 22 | {% include documentation/v3/mediasoup/api/Worker.md %} 23 | 24 | {% include documentation/v3/mediasoup/api/Router.md %} 25 | 26 | {% include documentation/v3/mediasoup/api/WebRtcServer.md %} 27 | 28 | {% include documentation/v3/mediasoup/api/Transport.md %} 29 | 30 | {% include documentation/v3/mediasoup/api/WebRtcTransport.md %} 31 | 32 | {% include documentation/v3/mediasoup/api/PlainTransport.md %} 33 | 34 | {% include documentation/v3/mediasoup/api/PipeTransport.md %} 35 | 36 | {% include documentation/v3/mediasoup/api/DirectTransport.md %} 37 | 38 | {% include documentation/v3/mediasoup/api/Producer.md %} 39 | 40 | {% include documentation/v3/mediasoup/api/Consumer.md %} 41 | 42 | {% include documentation/v3/mediasoup/api/DataProducer.md %} 43 | 44 | {% include documentation/v3/mediasoup/api/DataConsumer.md %} 45 | 46 | {% include documentation/v3/mediasoup/api/RtpObserver.md %} 47 | 48 | {% include documentation/v3/mediasoup/api/ActiveSpeakerObserver.md %} 49 | 50 | {% include documentation/v3/mediasoup/api/AudioLevelObserver.md %} 51 | 52 | {% include documentation/v3/mediasoup/api/observer-api.md %} 53 | -------------------------------------------------------------------------------- /documentation/v3/mediasoup/design.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Design 3 | anchors : true 4 | --- 5 | 6 | 7 | # mediasoup v3 Design 8 | 9 | Unlike other existing SFU implementations, mediasoup is not a standalone server but an unopinionated [Node.js](https://nodejs.org) module which can be integrated into a larger application: 10 | 11 | ```javascript 12 | const mediasoup = require("mediasoup"); 13 | ``` 14 | 15 | Thus internally, mediasoup can be splitted into two separate components: 16 | 17 | * a JavaScript layer exposing a modern ECMAScript API for Node.js, and 18 | * a set of C/C++ subprocesses that handle the media layer (ICE, DTLS, RTP and so on). 19 | 20 | Both components communicate to each other by means of inter-process communication. However, from the point of view of the developer, the application should just care about the JavaScript API integration. 21 | 22 | 23 | ## Features 24 | 25 | * ECMAScript low level API. 26 | * Multi-stream: multiple audio/video streams over a single ICE + DTLS transport. 27 | * IPv6 ready. 28 | * ICE / DTLS / RTP / RTCP over UDP and TCP. 29 | * Simulcast and SVC support. 30 | * Congestion control. 31 | * Sender and receiver bandwidth estimation with spatial/temporal layers distribution algorithm. 32 | * Extremely powerful (media worker subprocess coded in C++ on top of [libuv](https://libuv.org)). 33 | 34 | 35 | ## Architecture 36 | 37 | ![](/images/mediasoup-v3-architecture-01.svg){: .full-width } 38 | -------------------------------------------------------------------------------- /documentation/v3/mediasoup/garbage-collection.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Garbage Collection 3 | anchors : true 4 | --- 5 | 6 | 7 | # Garbage Collection 8 | 9 | Due to its design, the Node.js application is responsible of creating and managing mediasoup objects such as workers, routers, transports, producers and consumers. In summary this means that the application must keep references to those objects, call methods on them, listen for events on them and remove those references when the corresponding object has been closed. 10 | 11 | 12 | ## Closure Actions and Events 13 | {: #closure-actions-and-events} 14 | 15 | The mediasoup [API](/documentation/v3/mediasoup/api/) describes all those actions and events. Here just a summary of them. 16 | 17 | A [Worker](/documentation/v3/mediasoup/api/#Worker) is closed when: 18 | 19 | * `worker.close()` is called, or 20 | * `worker.on("died")` event is fired (emitted when the worker process unexpectedly). 21 | 22 | A [Router](/documentation/v3/mediasoup/api/#Router) is closed when: 23 | 24 | * `router.close()` is called, or 25 | * `router.on("workerclose")` event is fired (emitted when the worker this router belongs to is closed for whatever reason). 26 | 27 | A [Transport](/documentation/v3/mediasoup/api/#Transport) is closed when: 28 | 29 | * `transport.close()` is called, or 30 | * `transport.on("routerclose")` event is fired (emitted when the router this transport belongs to is closed for whatever reason). 31 | 32 | A [Producer](/documentation/v3/mediasoup/api/#Producer) is closed when: 33 | 34 | * `producer.close()` is called, or 35 | * `producer.on("transportclose")` event is fired (emitted when the transport this producer belongs to is closed for whatever reason). 36 | 37 | A [Consumer](/documentation/v3/mediasoup/api/#Consumer) is closed when: 38 | 39 | * `consumer.close()` is called, or 40 | * `consumer.on("transportclose")` event is fired (emitted when the transport this consumer belongs to is closed for whatever reason), or 41 | * `consumer.on("producerclose")` event is fired (emitted when the associated producer is closed for whatever reason). 42 | 43 | A [DataProducer](/documentation/v3/mediasoup/api/#DataProducer) is closed when: 44 | 45 | * `dataProducer.close()` is called, or 46 | * `dataProducer.on("transportclose")` event is fired (emitted when the transport this data producer belongs to is closed for whatever reason). 47 | 48 | A [DataConsumer](/documentation/v3/mediasoup/api/#DataConsumer) is closed when: 49 | 50 | * `dataConsumer.close()` is called, or 51 | * `dataConsumer.on("transportclose")` event is fired (emitted when the transport this data consumer belongs to is closed for whatever reason), or 52 | * `consumer.on("dataproducerclose")` event is fired (emitted when the associated data producer is closed for whatever reason). 53 | 54 | A [RtpObserver](/documentation/v3/mediasoup/api/#RtpObserver) is closed when: 55 | 56 | * `rtpObserver.close()` is called, or 57 | * `rtpObserver.on("routerclose")` event is fired (emitted when the router this RTP observer belongs to is closed for whatever reason). 58 | 59 | When any of these `close()` methods is called or "xxxxxclose" event is emitted, the corresponding mediasoup object becomes "closed" (its `closed` property is `true` from now on) and the application should clean the reference to that object. 60 | -------------------------------------------------------------------------------- /documentation/v3/mediasoup/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : mediasoup 3 | --- 4 | 5 | 6 | # mediasoup v3 Documentation 7 | 8 | {% include documentation/v3/mediasoup/index.md %} 9 | -------------------------------------------------------------------------------- /documentation/v3/mediasoup/installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Installation 3 | anchors : true 4 | --- 5 | 6 | 7 | # mediasoup v3 Installation 8 | 9 | Install mediasoup via NPM within your Node.js application: 10 | 11 | ```bash 12 | $ npm install mediasoup@3 13 | ``` 14 | 15 | During the installation process, the mediasoup NPM package will try to fetch a prebuilt mediasoup-worker binary appropriate for current platform and architecture. If not found, it will locally build the mediasoup-worker binary. 16 | 17 |
18 | * If "MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD" or "MEDIASOUP_LOCAL_DEV" environment variables are set, or if mediasoup package is being installed via `git+ssh` (instead of via `npm`), and if "MEDIASOUP_FORCE_WORKER_PREBUILT_DOWNLOAD" environment variable is not set, the installation process won't attempt to fetch any prebuilt mediasoup-worker binary and it will build it locally instead. 19 | 20 | ```bash 21 | MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD="true" npm install mediasoup@3 22 | ``` 23 | 24 | * If "MEDIASOUP_WORKER_BIN" environment variable is set during mediasoup package installation, mediasoup will use the the value of such an environment variable as mediasoup-worker binary and **won't** compile it locally. And if same environment variable is set when running your Node.js app, mediasoup will use it as mediasoup-worker binary (instead of looking for it in the `mediasoup/worker/out/Release` path). 25 | 26 | ```bash 27 | MEDIASOUP_WORKER_BIN="/home/xxx/src/foo/mediasoup-worker" npm install mediasoup@3 28 | MEDIASOUP_WORKER_BIN="/home/xxx/src/foo/mediasoup-worker" node myapp.js 29 | ``` 30 |
31 | 32 | 33 | ## Requirements 34 | 35 | In order to build the mediasoup C/C++ components the following packages and libraries must be available in the target host: 36 | 37 | ### All Platforms 38 | 39 | * Node.js version >= v20.0.0 40 | * Python version >= 3.7 with PIP 41 | 42 |
43 | Python is only required if no prebuilt mediasoup-worker binary was fetched. 44 |
45 | 46 | 47 | ### Linux, OSX and *NIX Systems 48 | 49 | * `gcc` and `g++` >= 8 or `clang` (with C++17 support) 50 | * `cc` and `c++` commands (symlinks) pointing to the corresponding `gcc`/`g++` or `clang`/`clang++` executables 51 | 52 |
53 | * On Debian and Ubuntu install the `python3-pip` DEB package, otherwise PIP package manager might be unavailable. 54 | * On Debian and Ubuntu install the `build-essential` DEB package. It includes `gcc`/`g++`. 55 | * On YUM based Linux (Red Hat, CentOS) use `yum groupinstall "Development Tools"`. 56 | * On musl based systems (such as Alpine Linux) `linux-headers` package must be installed, otherwise abseil-cpp C++ subproject fails to build due to "linux/futex.h: No such file or directory". 57 |
58 | 59 |
60 | If there is neither `python3` nor `python` command pointing to Python 3 executable, set the `PYTHON` environment variable during mediasoup installation: 61 | 62 | ```bash 63 | $ PYTHON=python3.9 npm install mediasoup@3 64 | ``` 65 |
66 | 67 |
68 | If the `MEDIASOUP_MAX_CORES` environment variable is set, the build process will use that number of CPU cores. Otherwise, it will auto-detect the number of cores in the machine. 69 |
70 | 71 | 72 | ### Windows 73 | 74 | * Microsoft Visual Studio environment with MSVC compiler (with C++17 support). 75 | 76 |
77 | * Make sure to have **ISRG Root X1** certificate installed, or you will get errors while downloading OpenSSL (whose website is secured with Let's Encrypt), you can import it from (install to Local computer). 78 | * If you have Python-related errors, search for "App execution aliases" in system settings and disable everything Python-related from there. 79 |
80 | -------------------------------------------------------------------------------- /documentation/v3/mediasoup/sctp-parameters.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : SCTP Parameters 3 | anchors : true 4 | --- 5 | 6 | 7 | # SCTP Parameters 8 | 9 | * Will be replaced with the ToC 10 | {: toc} 11 | 12 | 13 | ## Dictionaries 14 | {: #Dictionaries} 15 | 16 |
17 | 18 | #### SctpParameters 19 | {: #SctpParameters .code} 20 | 21 | Parameters of the SCTP association. 22 | 23 |
24 | 25 | Field | Type | Description | Required | Default 26 | ---------------- | ------ | ------------- | --------- | 27 | `port` | Number | Must always equal 5000. | Yes | 28 | `OS` | Number | Initially requested number of outgoing SCTP streams. | Yes | 29 | `MIS` | Number | Maximum number of incoming SCTP streams. | Yes | 30 | `maxMessageSize` | Number | Maximum allowed size for SCTP messages. | Yes | 31 | 32 |
33 | 34 | #### NumSctpStreams 35 | {: #NumSctpStreams .code} 36 | 37 |
38 | 39 | Field | Type | Description | Required | Default 40 | ------ | ------ | ------------- | --------- | 41 | `OS` | Number | Initially requested number of outgoing SCTP streams (from 1 to 65535). | No | 1024 42 | `MIS` | Number | Maximum number of incoming SCTP streams (from 1 to 65535). | No | 1024 43 | 44 |
45 | 46 |
47 | Both `OS` and `MIS` are part of the SCTP INIT+ACK handshake. `OS` refers to the initial number of outgoing SCTP streams that the server side transport creates (to be used by [DataConsumers](#DataConsumer)), while `MIS` refers to the maximum number of incoming SCTP streams that the server side transport can receive (to be used by [DataProducers](#DataProducer)). So, if the server side transport will just be used to create data producers (but no data consumers), `OS` can be low (~1). However, if data consumers are desired on the server side transport, `OS` must have a proper value and such a proper value depends on whether the remote endpoint supports `SCTP_ADD_STREAMS` extension or not. 48 | 49 | * libwebrtc (Chrome, Safari, etc) does not enable `SCTP_ADD_STREAMS` so, if data consumers are required, `OS` should be 1024 (the maximum number of DataChannels that libwebrtc enables). 50 | * Firefox does enable `SCTP_ADD_STREAMS` so, if data consumers are required, `OS` can be lower (16 for instance). The mediasoup transport will allocate and announce more outgoing SCTP streams when needed. 51 | * mediasoup-client provides specific per browser/version `OS` and `MIS` values via the [device.sctpCapabilities](/documentation/v3/mediasoup-client/api/#device-sctpCapabilities) getter. 52 |
53 | 54 | #### SctpStreamParameters 55 | {: #SctpStreamParameters .code} 56 | 57 | SCTP stream parameters describe the reliability of a certain SCTP stream. 58 | 59 |
60 | 61 | Field | Type | Description | Required | Default 62 | ------------------ | ------- | ------------- | -------- | --------- 63 | `streamId` | Number | SCTP stream id | true | 64 | `ordered` | Boolean | Whether data messages must be received in order. if true the messages will be sent reliably. | No | true 65 | `maxPacketLifeTime`| Number | When `ordered` is false indicates the time (in milliseconds) after which a SCTP packet will stop being retransmitted. | No | 66 | `maxRetransmits`| Number | When `ordered` is false indicates the maximum number of times a packet will be retransmitted. | No | 67 | 68 |
69 | 70 |
71 | * If `ordered` is true then `maxPacketLifeTime` and `maxRetransmits` must be false. 72 | 73 | * If `ordered` if false, only one of `maxPacketLifeTime` or `maxRetransmits` can be true. 74 |
75 | 76 |
77 | -------------------------------------------------------------------------------- /documentation/v3/mediasoup/srtp-parameters.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : SRTP Parameters 3 | anchors : true 4 | --- 5 | 6 | 7 | # SRTP Parameters 8 | 9 | Actually these SRTP parameters just apply to `PlainTransport` and `PipeTransport` which has optional SRTP support. 10 | 11 | ---- 12 | 13 | * Will be replaced with the ToC 14 | {: toc} 15 | 16 | 17 | ## Dictionaries 18 | {: #Dictionaries} 19 | 20 |
21 | 22 | #### SrtpParameters 23 | {: #SrtpParameters .code} 24 | 25 |
26 | 27 | Field | Type | Description | Required | Default 28 | --------------| ------ | ------------- | --------- | 29 | `cryptoSuite` | [SrtpCryptoSuite](#SrtpCryptoSuite) | Encryption and authentication transforms to be used. | Yes | 30 | `keyBase64` | String | SRTP keying material (master key and salt) in Base64. | Yes | 31 | 32 |
33 | 34 |
35 | 36 | 37 | ## Enums 38 | {: #Enums} 39 | 40 |
41 | 42 | #### SrtpCryptoSuite 43 | {: #SrtpCryptoSuite .code} 44 | 45 |
46 | 47 | Value | Description 48 | ------------------------- | ------------- 49 | "AEAD_AES_256_GCM" | It requires SRTP keying material of 44 bytes (60 bytes in Base64). 50 | "AEAD_AES_128_GCM" | It requires SRTP keying material of 28 bytes (40 bytes in Base64). 51 | "AES_CM_128_HMAC_SHA1_80" | It requires SRTP keying material of 30 bytes (40 bytes in Base64). 52 | "AES_CM_128_HMAC_SHA1_32" | It requires SRTP keying material of 30 bytes (40 bytes in Base64). 53 | 54 |
55 | 56 |
57 | -------------------------------------------------------------------------------- /documentation/v3/tricks.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Tricks 3 | anchors : true 4 | --- 5 | 6 | 7 | # mediasoup v3 Tricks 8 | 9 | Some useful tricks for mediasoup and client libraries. 10 | 11 | 12 | ## Using a different video codec in each Producer 13 | {: #using-a-different-video-codec-in-each-producer} 14 | 15 | Sometimes it's useful to use, for instance, H264 for webcam and VP8 for screen sharing. Starting from mediasoup-client 3.6.0, this is possible by using the new `codec` option in [ProducerOptions](/documentation/v3/mediasoup-client/api/#ProducerOptions). Example: 16 | 17 | ```javascript 18 | // Assuming that the mediasoup Router has been provided with both VP8 and H264 19 | // video codecs, let's use H264 for webcam and VP8 for screen sharing. 20 | 21 | const webcamProducer = await sendTransport.produce( 22 | { 23 | track: videoTrack, 24 | codec : device.rtpCapabilities.codecs 25 | .find((codec) => codec.mimeType.toLowerCase() === 'video/h264') 26 | }); 27 | 28 | const sharingProducer = await sendTransport.produce( 29 | { 30 | track: sharingTrack, 31 | codec : device.rtpCapabilities.codecs 32 | .find((codec) => codec.mimeType.toLowerCase() === 'video/vp8') 33 | }); 34 | ``` 35 | 36 | ## RTP capabilities filtering 37 | {: #rtp-capabilities-filtering} 38 | 39 | **Related issue:** 40 | 41 | * Wrong received video orientation in Firefox and FFmpeg. 42 | 43 | The mediasoup [router.rtpCapabilities](/documentation/v3/mediasoup/api/#router-rtpCapabilities) represent the RTP capabilities that the router supports. While the `codecs` list depends on the [RouterOptions](/documentation/v3/mediasoup/api/#RouterOptions) given by during the router creation, other RTP capabilities such as the `headerExtensions` are fixed and are basically a copy of the `headerExtensions` in the [supportedRtpCapabilities.ts](https://github.com/versatica/mediasoup/blob/v3/node/src/supportedRtpCapabilities.ts) file of mediasoup. 44 | 45 | For instance, some of those RTP header extensions can affect the behaviour of the client. A good example is the "urn:3gpp:video-orientation" extension which, if supported by both the client and mediasoup, will make the client to not rotate its sending video (for instance when moving the mobile from portrait to landscape) but, instead, set an orientation value into a RTP header extension. This is supported by Chrome and any libwebrtc based endpoint (such as libmediasoupclient). 46 | 47 | The problem with this is that, if a receiving consumer (i.e. Firefox as per today or FFmpeg) does not support such a RTP header extension, when the sender rotates its video the receiver will not realize of it and will render the received video with an orientation of 90º or -90º. In order to avoid that problem here the trick: 48 | 49 | Being in sender side (let's assume it supports the "urn:3gpp:video-orientation" extension), the application may call [device.load()](/documentation/v3/mediasoup-client/api/#device-load) (mediasoup-client, i.e. Chrome) or [device.load()](/documentation/v3/libmediasoupclient/api/#device-Load) (libmediasoupclient) with a filtered version of the router RTP capabilities by removing the problematic headers. For instance, when in Chrome running mediasoup-client it would be as follows: 50 | 51 | ```javascript 52 | // Let's get router RTP capabilities via our own app signaling. 53 | let routerRtpCapabilities = await mySignaling.request("getRouterRtpCapabilities"); 54 | 55 | // Just for Chrome, Safari or any libwebrtc based browser. 56 | if (supportsVideoOrientationHeaderExtension) 57 | { 58 | // Remove the "urn:3gpp:video-orientation" extension so when rotating the 59 | // device, Chrome will encode rotated video instead of indicating the video 60 | // orientation in an RTP header extension. 61 | routerRtpCapabilities.headerExtensions = routerRtpCapabilities.headerExtensions. 62 | filter((ext) => ext.uri !== 'urn:3gpp:video-orientation'); 63 | } 64 | 65 | // Finally apply the router RTP capabilities to the device. 66 | await device.load({ routerRtpCapabilities }); 67 | ``` 68 | -------------------------------------------------------------------------------- /faq.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : F.A.Q. 3 | anchors : true 4 | --- 5 | 6 | 7 | # F.A.Q. 8 | 9 | * Will be replaced with the ToC 10 | {: toc} 11 | 12 | 13 | ### Why a Node.js module? 14 | {: #why-a-nodejs-module} 15 | 16 | You may wonder "why not a standalone server?". That's a fair question. 17 | 18 | Being a [Node.js](https://nodejs.org) module, mediasoup is easily integrable within larger Node.js applications. Consider that mediasoup just handles the media plane (audio/video streams) so the application needs some kind of signaling mechanism. Having both the signaling and the media handlers working together makes the application architecture easier. 19 | 20 | All those using others languages/platforms for the signaling plane would need to develop their own communication channel with a standalone Node.js server running mediasoup (or wait for somebody to do it). 21 | 22 | 23 | ### Is mediasoup a native addon? 24 | {: #is-mediasoup-a-native-addon} 25 | 26 | Not exactly. [Native addons](https://nodejs.org/api/addons.html) are Node.js extensions written in C/C++ that can be loaded using `require()` as if they were ordinary Node.js modules. 27 | 28 | Instead, mediasoup launches a set of C++ child processes (media workers) and communicates with them by means of inter-process communication. This approach leads to a media worker design not tiled to the internals of Node.js or V8 (which change in every new release). 29 | 30 | 31 | ### Which signaling protocol does it use? 32 | {: #which-signaling-protocol-does-it-use} 33 | 34 | That's a wrong question. mediasoup does not provide any network signaling protocol to communicate with endpoints/browsers. It just handles the media layer and provides a JavaScript API to set the media parameters. 35 | 36 | It's up to the application developer to build his preferred signaling protocol to carry messages with such parameters. 37 | 38 | 39 | ### Is there any example code? 40 | {: #is-there-any-example-code} 41 | 42 | Yes, check the [examples](/documentation/examples/). 43 | 44 | 45 | ### Does mediasoup transcode? 46 | {: #does-mediasoup-transcode} 47 | 48 | No. All the peers in a room should support a common subset of audio and video codecs. Said that, WebRTC defines a list of MTI ("mandatory to implement") audio/video codecs, so in a world of happy unicorns this topic should not be a problem. 49 | 50 | 51 | ### Does it work with legacy SIP endpoints? 52 | {: #does-it-work-with-legacy-sip-endpoints} 53 | 54 | No. If you expected a different response here it means that you have not properly read the mediasoup documentation. 55 | 56 | mediasoup is "just" a SFU, it does not implement the SIP protocol nor it does audio mixing. In order to integrate a SIP/PSTN system with mediasoup you need to build a client or gateway that connects to mediasoup as a regular peer and acts as an audio mixer in the other leg (in which it implements the SIP protocol). 57 | 58 | 59 | ### Running mediasoup in hosts with private IP (AWS, Google Cloud, Azure) 60 | {: #running-mediasoup-in-hosts-with-private-ip} 61 | 62 | Those environments run virtual hosts with private IP and provide mechanisms to route an external public IP into that private IP. mediasoup implements ICE-Lite meaning that it won't initiate ICE connections but will always act as ICE "server" role. 63 | 64 | In order to run mediasoup in those environments (host with private IP and a mapped public IP): 65 | 66 | * Let `HOST_PUBLIC_IP` be the external public IP mapped to your host. 67 | * Redirect the port range given to the transport (`portRange` field) from `HOST_PUBLIC_IP` to your host. 68 | * Of course, also redirect whichever port your application uses for signaling (HTTP/WebSocket) from `HOST_PUBLIC_IP` to your host. 69 | * Use `ip: '0.0.0.0'` and `announcedAddress: HOST_PUBLIC_IP` when creating a transport. 70 | 71 | ### How to use H264 for webcam and VP8 for screen sharing 72 | {: #how-to-use-h264-for-webcam-and-vp8-for-screen-sharing} 73 | 74 | Check the [Tricks](/documentation/v3/tricks/#using-a-different-video-codec-in-each-producer) section. 75 | 76 | ### When consuming a video in Firefox it does not properly rotate 77 | {: #when-consuming-a-video-in-firefox-it-does-not-properly-rotate} 78 | 79 | Check the [Tricks](/documentation/v3/tricks/#rtp-capabilities-filtering) section. 80 | -------------------------------------------------------------------------------- /favicons-dark-theme/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-dark-theme/android-chrome-192x192.png -------------------------------------------------------------------------------- /favicons-dark-theme/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-dark-theme/android-chrome-512x512.png -------------------------------------------------------------------------------- /favicons-dark-theme/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-dark-theme/apple-touch-icon.png -------------------------------------------------------------------------------- /favicons-dark-theme/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #cccccc 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /favicons-dark-theme/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-dark-theme/favicon-16x16.png -------------------------------------------------------------------------------- /favicons-dark-theme/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-dark-theme/favicon-32x32.png -------------------------------------------------------------------------------- /favicons-dark-theme/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-dark-theme/favicon.ico -------------------------------------------------------------------------------- /favicons-dark-theme/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-dark-theme/mstile-150x150.png -------------------------------------------------------------------------------- /favicons-dark-theme/safari-pinned-tab.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | Created by potrace 1.14, written by Peter Selinger 2001-2017 9 | 10 | 12 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /favicons-dark-theme/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mediasoup", 3 | "short_name": "mediasoup", 4 | "icons": [ 5 | { 6 | "src": "/favicons-dark-theme/android-chrome-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "/favicons-dark-theme/android-chrome-512x512.png", 12 | "sizes": "512x512", 13 | "type": "image/png" 14 | } 15 | ], 16 | "theme_color": "#ffffff", 17 | "background_color": "#ffffff", 18 | "display": "standalone" 19 | } 20 | -------------------------------------------------------------------------------- /favicons-light-theme/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/android-chrome-192x192.png -------------------------------------------------------------------------------- /favicons-light-theme/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/android-chrome-512x512.png -------------------------------------------------------------------------------- /favicons-light-theme/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/apple-touch-icon.png -------------------------------------------------------------------------------- /favicons-light-theme/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #11142c 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /favicons-light-theme/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/favicon-16x16.png -------------------------------------------------------------------------------- /favicons-light-theme/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/favicon-32x32.png -------------------------------------------------------------------------------- /favicons-light-theme/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/favicon.ico -------------------------------------------------------------------------------- /favicons-light-theme/mstile-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/mstile-144x144.png -------------------------------------------------------------------------------- /favicons-light-theme/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/mstile-150x150.png -------------------------------------------------------------------------------- /favicons-light-theme/mstile-310x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/mstile-310x150.png -------------------------------------------------------------------------------- /favicons-light-theme/mstile-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/mstile-310x310.png -------------------------------------------------------------------------------- /favicons-light-theme/mstile-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/favicons-light-theme/mstile-70x70.png -------------------------------------------------------------------------------- /favicons-light-theme/safari-pinned-tab.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | Created by potrace 1.14, written by Peter Selinger 2001-2017 9 | 10 | 12 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /favicons-light-theme/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "short_name": "", 4 | "icons": [ 5 | { 6 | "src": "/favicons-light-theme/android-chrome-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "/favicons-light-theme/android-chrome-512x512.png", 12 | "sizes": "512x512", 13 | "type": "image/png" 14 | } 15 | ], 16 | "theme_color": "#11142c", 17 | "background_color": "#11142c", 18 | "display": "standalone" 19 | } 20 | -------------------------------------------------------------------------------- /fonts/Monaco.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Monaco.ttf -------------------------------------------------------------------------------- /fonts/PoiretOne.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/PoiretOne.ttf -------------------------------------------------------------------------------- /fonts/PoiretOne.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/PoiretOne.woff -------------------------------------------------------------------------------- /fonts/Roboto-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-Black.ttf -------------------------------------------------------------------------------- /fonts/Roboto-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-BlackItalic.ttf -------------------------------------------------------------------------------- /fonts/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-Bold.ttf -------------------------------------------------------------------------------- /fonts/Roboto-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-BoldItalic.ttf -------------------------------------------------------------------------------- /fonts/Roboto-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-Italic.ttf -------------------------------------------------------------------------------- /fonts/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-Light.ttf -------------------------------------------------------------------------------- /fonts/Roboto-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-LightItalic.ttf -------------------------------------------------------------------------------- /fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /fonts/Roboto-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-MediumItalic.ttf -------------------------------------------------------------------------------- /fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /fonts/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-Thin.ttf -------------------------------------------------------------------------------- /fonts/Roboto-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/fonts/Roboto-ThinItalic.ttf -------------------------------------------------------------------------------- /fonts/embed.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is for setting TTF files to Installable Embedding mode. 3 | * 4 | * Note that using this to embed fonts which you are not licensed to embed 5 | * does not make it legal. 6 | * 7 | * This code was written by Tom Murphy 7, and is public domain. Use at your 8 | * own risk... 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | void fatal(); 15 | 16 | int main (int argc, char**argv) { 17 | FILE * inways; 18 | if (argc != 2) 19 | printf("Usage: %s font.ttf\n\nPublic Domain software by Tom 7. Use at your own risk.\n",argv[0]); 20 | else if (inways = fopen(argv[1],"rb+")) { 21 | int a,x; 22 | char type[5]; 23 | type[4]=0; 24 | fseek(inways,12,0); 25 | for (;;) { 26 | for (x=0;x<4;x++) if (EOF == (type[x] = getc(inways))) fatal(); 27 | if (!strcmp(type,"OS/2")) { 28 | int length; 29 | unsigned long loc, fstype, sum=0; 30 | loc=ftell(inways); /* location for checksum */ 31 | for (x=4;x--;) if (EOF == getc(inways)) fatal(); 32 | fstype = fgetc(inways) << 24; 33 | fstype |= fgetc(inways) << 16; 34 | fstype |= fgetc(inways) << 8 ; 35 | fstype |= fgetc(inways) ; 36 | length = fgetc(inways) << 24; 37 | length |= fgetc(inways) << 16; 38 | length |= fgetc(inways) << 8 ; 39 | length |= fgetc(inways) ; 40 | /* printf("fstype: %d length: %d\n",fstype,length);*/ 41 | if (fseek(inways,fstype+8,0)) fatal(); 42 | fputc(0,inways); 43 | fputc(0,inways); 44 | fseek(inways,fstype,0); 45 | for (x=length;x--;) 46 | sum += fgetc(inways); 47 | fseek(inways,loc,0); /* write checksum */ 48 | fputc(sum>>24,inways); 49 | fputc(255&(sum>>16),inways); 50 | fputc(255&(sum>>8), inways); 51 | fputc(255&sum , inways); 52 | fclose(inways); 53 | exit(0); 54 | } 55 | for (x=12;x--;) if (EOF == getc(inways)) fatal(); 56 | } 57 | 58 | } else 59 | printf("I wasn't able to open the file %s.\n", argv[1]); 60 | } 61 | 62 | void fatal() { fprintf(stderr,"Malformed TTF file.\n"); 63 | exit(-1); } 64 | -------------------------------------------------------------------------------- /github.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : GitHub 3 | anchors : true 4 | --- 5 | 6 | 7 | # GitHub 8 | 9 | ##### [mediasoup](https://github.com/versatica/mediasoup/) 10 | 11 | C++ SFU and server side Node.js module. 12 | 13 | 14 | ##### [mediasoup-client](https://github.com/versatica/mediasoup-client/) 15 | 16 | Client side JavaScript library. 17 | 18 | 19 | ##### [libmediasoupclient](https://github.com/versatica/libmediasoupclient/) 20 | 21 | C++ library based on libwebrtc. 22 | 23 | 24 | ##### [mediasoup-client-aiortc](https://github.com/versatica/mediasoup-client-aiortc/) 25 | 26 | handler for [aiortc](https://github.com/aiortc/aiortc/) Python library. Suitable for building Node.js applications that connect to a mediasoup server using WebRTC and exchange real audio, video and DataChannel messages with it. 27 | 28 | 29 | ##### [mediasoup-demo](https://github.com/versatica/mediasoup-demo/) 30 | 31 | Source code of the [mediasoup demo](https://demo.mediasoup.org) application. 32 | 33 | 34 | ##### [mediasoup-broadcaster-demo](https://github.com/versatica/mediasoup-broadcaster-demo/) 35 | 36 | libmediasoupclient based C++ application that produces the system microphone and webcam into the mediasoup demo. 37 | 38 | 39 | ##### [mediasoup-website](https://github.com/versatica/mediasoup-website/) 40 | 41 | The mediasoup project website at [https://mediasoup.org](https://mediasoup.org). 42 | 43 | 44 | ## 3rd Party Contributions 45 | 46 | Here some libraries and SDKs contributed by non mediasoup authors. 47 | 48 |
49 | Those are just some of the libraries/SDKs that exist. Not all them are covered here. 50 |
51 | 52 | ##### [ethand91/mediasoup-ios-client](https://github.com/ethand91/mediasoup-ios-client) 53 | 54 | Objective-C wrapper library for libmediasoupclient for building mediasoup based **native** iOS based applications. 55 | 56 | ##### [VLprojects/mediasoup-ios-client](https://github.com/VLprojects/mediasoup-ios-client) 57 | 58 | Objective-C wrapper library for libmediasoupclient for building mediasoup iOS based applications. 59 | 60 | A more updated fock of ethand91/mediasoup-ios-client. 61 | 62 | ##### [VLprojects/mediasoup-client-swift](https://github.com/VLprojects/mediasoup-client-swift) 63 | 64 | Swift wrapper for libmediasoupclient with iOS support. 65 | 66 | ##### [haiyangwu/mediasoup-client-android](https://github.com/haiyangwu/mediasoup-client-android) 67 | 68 | Java wrapper library for libmediasoupclient for building mediasoup based **native** Android based applications. 69 | 70 | ##### [haiyangwu/mediasoup-demo-android](https://github.com/haiyangwu/mediasoup-demo-android) 71 | 72 | mediasoup-client-android based Android app to connect to the [mediasoup demo](https://demo.mediasoup.org). 73 | 74 | 75 | ## Examples 76 | 77 | Check out some projects and examples using mediasoup, mediasoup-client and libmediasoup client in the [Examples](/documentation/examples/) section. 78 | -------------------------------------------------------------------------------- /images/arrow-up.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 16 | 35 | 40 | 44 | 45 | -------------------------------------------------------------------------------- /images/checkbox-off-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 30 | 50 | 55 | 56 | -------------------------------------------------------------------------------- /images/checkbox-on.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 30 | 50 | 55 | 60 | 61 | -------------------------------------------------------------------------------- /images/close.svg: -------------------------------------------------------------------------------- 1 | 2 | 15 | 17 | 36 | 40 | 44 | 45 | -------------------------------------------------------------------------------- /images/ibc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/images/ibc.jpg -------------------------------------------------------------------------------- /images/icon-bug.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /images/icon-github.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 16 | 35 | 39 | 40 | -------------------------------------------------------------------------------- /images/icon-help.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /images/icon-linkedin.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 16 | 35 | 39 | 40 | -------------------------------------------------------------------------------- /images/icon-twitter.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 16 | 35 | 39 | 40 | -------------------------------------------------------------------------------- /images/icon-upwork.svg: -------------------------------------------------------------------------------- 1 | 2 | 36 | -------------------------------------------------------------------------------- /images/icon-website.svg: -------------------------------------------------------------------------------- 1 | 2 | 15 | 17 | 36 | 40 | 44 | 45 | -------------------------------------------------------------------------------- /images/jmillan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/images/jmillan.jpg -------------------------------------------------------------------------------- /images/mediasoup-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/images/mediasoup-banner.png -------------------------------------------------------------------------------- /images/menu-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 30 | 50 | 54 | 55 | -------------------------------------------------------------------------------- /images/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 30 | 50 | 54 | 55 | -------------------------------------------------------------------------------- /images/nazar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/images/nazar.jpg -------------------------------------------------------------------------------- /images/toc.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/anchors.js: -------------------------------------------------------------------------------- 1 | const AnchorJS = require('anchor-js'); 2 | 3 | const anchorjs = new AnchorJS(); 4 | 5 | module.exports = () => 6 | { 7 | anchorjs.add('.content h2, .content h3, .content h4'); 8 | }; 9 | -------------------------------------------------------------------------------- /lib/apiToc.js: -------------------------------------------------------------------------------- 1 | const hammerjs = require('hammerjs'); 2 | const dontscrollthebody = require('dontscrollthebody'); 3 | 4 | module.exports = () => 5 | { 6 | const tocButton = document.querySelector('.api-toc-button'); 7 | const toc = document.querySelector('.api-toc-wrapper'); 8 | const tocUl = toc.children[0]; 9 | const transitionDuration = 200; 10 | let isTocVisible = false; 11 | const tocButtonHammer = new hammerjs.Manager(tocButton); 12 | const tocHammer = new hammerjs.Manager(toc); 13 | 14 | tocButtonHammer.add(new hammerjs.Pan( 15 | { 16 | threshold : 30, 17 | direction : hammerjs.DIRECTION_LEFT 18 | })); 19 | 20 | tocHammer.add(new hammerjs.Pan( 21 | { 22 | threshold : 30, 23 | direction : hammerjs.DIRECTION_RIGHT 24 | })); 25 | 26 | if (!CSS.supports || !CSS.supports('overscroll-behavior', 'contain')) 27 | dontscrollthebody(toc); 28 | 29 | document.addEventListener('click', (event) => 30 | { 31 | if (tocButton.contains(event.target)) 32 | { 33 | if (!isTocVisible) 34 | showToc(); 35 | else 36 | hideToc(); 37 | } 38 | else if (!toc.contains(event.target)) 39 | { 40 | hideToc(); 41 | } 42 | }); 43 | 44 | // ESC key hides the TOC panel. 45 | document.addEventListener('keydown', (event) => 46 | { 47 | if (event.keyCode === 27) 48 | hideToc(); 49 | }); 50 | 51 | tocButtonHammer.on('panleft', () => showToc()); 52 | 53 | tocHammer.on('panright', () => hideToc()); 54 | 55 | function showToc() 56 | { 57 | if (isTocVisible) 58 | return; 59 | 60 | isTocVisible = true; 61 | toc.classList.add('visible'); 62 | } 63 | 64 | function hideToc() 65 | { 66 | if (!isTocVisible) 67 | return; 68 | 69 | isTocVisible = false; 70 | toc.classList.remove('visible'); 71 | } 72 | }; 73 | -------------------------------------------------------------------------------- /lib/arrowUp.js: -------------------------------------------------------------------------------- 1 | module.exports = () => 2 | { 3 | const arrow = document.querySelector('.arrow-up'); 4 | let isVisible = false; 5 | let elem; 6 | let startTime = new Date(); 7 | const interval = 1000; 8 | let timer; 9 | 10 | if (!arrow) 11 | return; 12 | 13 | function checkScroll() 14 | { 15 | const scrollHeight = elem.scrollHeight; 16 | const visibleHeight = elem.offsetHeight; 17 | const scrollTop = elem.scrollTop; 18 | 19 | // Reset timer. 20 | clearTimeout(timer); 21 | timer = null; 22 | 23 | if ( 24 | scrollTop > visibleHeight && 25 | (scrollTop + visibleHeight < scrollHeight - 100) 26 | ) 27 | { 28 | if (!isVisible) 29 | { 30 | isVisible = true; 31 | arrow.classList.add('visible'); 32 | } 33 | } 34 | else 35 | { 36 | if (isVisible) 37 | { 38 | isVisible = false; 39 | arrow.classList.remove('visible'); 40 | } 41 | } 42 | } 43 | 44 | document.addEventListener('scroll', () => 45 | { 46 | if (!elem) 47 | { 48 | // Hack: https://miketaylr.com/posts/2014/11/document-body-scrolltop.html 49 | if (document.documentElement && document.documentElement.scrollTop) 50 | elem = document.documentElement; 51 | else if (document.body.parentNode && document.body.parentNode.scrollTop) 52 | elem = document.body.parentNode; 53 | else if (document.body.scrollTop) 54 | elem = document.body; 55 | 56 | if (!elem) 57 | return; 58 | } 59 | 60 | // Check interval. 61 | const now = new Date(); 62 | 63 | if (now - startTime >= interval) 64 | { 65 | startTime = now; 66 | checkScroll(); 67 | } 68 | else 69 | { 70 | if (!timer) 71 | { 72 | timer = setTimeout(() => 73 | { 74 | if (!timer) 75 | return; 76 | 77 | checkScroll(); 78 | }, interval * 1.5); 79 | } 80 | 81 | return; 82 | } 83 | }, { passive: true }); 84 | 85 | arrow.addEventListener('click', () => 86 | { 87 | // Hack: https://miketaylr.com/posts/2014/11/document-body-scrolltop.html 88 | const d = document; 89 | 90 | if (d.documentElement && d.documentElement.scrollTop) 91 | d.documentElement.scrollTop = 0; 92 | else if (d.body.parentNode && d.body.parentNode.scrollTop) 93 | d.body.parentNode.scrollTop = 0; 94 | else if (d.body && d.body.scrollTop) 95 | d.body.scrollTop = 0; 96 | }); 97 | }; 98 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | const domready = require('domready'); 2 | const loading = require('./loading'); 3 | const shields = require('./shields'); 4 | const menu = require('./menu'); 5 | const arrowUp = require('./arrowUp'); 6 | const anchors = require('./anchors'); 7 | const apiToc = require('./apiToc'); 8 | // const piwik = require('./piwik'); 9 | 10 | domready(() => 11 | { 12 | loading(); 13 | shields(); 14 | menu(); 15 | arrowUp(); 16 | 17 | // Set anchors if requested. 18 | if (window.siteSettings.anchors) 19 | anchors(); 20 | 21 | // Set API TOC if requested. 22 | if (window.siteSettings.apiToc) 23 | apiToc(); 24 | 25 | // Set Piwik. 26 | // piwik(); 27 | }); 28 | -------------------------------------------------------------------------------- /lib/loading.js: -------------------------------------------------------------------------------- 1 | module.exports = () => 2 | { 3 | // Hack for iOS devices. 4 | const iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; 5 | 6 | if (iOS) 7 | { 8 | document.body.classList.add('ios'); 9 | 10 | const header = document.querySelector('body > .header') 11 | 12 | if (header) 13 | header.classList.add('ios'); 14 | } 15 | 16 | // Transition for 'loading' elements. 17 | const elems = document.querySelectorAll('.loading'); 18 | 19 | for (let i = 0, len = elems.length; i < len; ++i) 20 | { 21 | const element = elems[i]; 22 | 23 | (function(elem) 24 | { 25 | elem.classList.remove('loading'); 26 | elem.addEventListener('transitionend', loaded); 27 | 28 | function loaded() 29 | { 30 | elem.removeEventListener('transitionend', loaded); 31 | elem.classList.add('loaded'); 32 | } 33 | })(element); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /lib/menu.js: -------------------------------------------------------------------------------- 1 | const hammerjs = require('hammerjs'); 2 | const dontscrollthebody = require('dontscrollthebody'); 3 | 4 | module.exports = () => 5 | { 6 | const menuButton = document.querySelector('.menu-button'); 7 | const footerMore = document.querySelector('.footer-more'); 8 | const menu = document.querySelector('.menu'); 9 | const menuClose = menu.querySelector('.close'); 10 | let isVisible = false; 11 | const hammer = new hammerjs.Manager(menu); 12 | 13 | hammer.add(new hammerjs.Pan({ threshold: 15 })); 14 | 15 | if (!CSS.supports || !CSS.supports('overscroll-behavior', 'contain')) 16 | dontscrollthebody(menu); 17 | 18 | document.addEventListener('click', (event) => 19 | { 20 | if (menuButton.contains(event.target)) 21 | { 22 | showMenu(); 23 | } 24 | else if (footerMore.contains(event.target)) 25 | { 26 | event.preventDefault(); 27 | 28 | if (!isVisible) 29 | showMenu(); 30 | else 31 | hideMenu(); 32 | } 33 | else if (!menu.contains(event.target)) 34 | { 35 | hideMenu(); 36 | } 37 | }); 38 | 39 | menuClose.addEventListener('click', hideMenu); 40 | 41 | // ESC key hides the menu. 42 | document.addEventListener('keydown', (event) => 43 | { 44 | if (event.keyCode === 27) 45 | hideMenu(); 46 | }); 47 | 48 | hammer.on('panright', () => hideMenu()); 49 | 50 | function showMenu() 51 | { 52 | if (isVisible) 53 | return; 54 | 55 | isVisible = true; 56 | menu.classList.add('visible'); 57 | menuButton.classList.add('hidden'); 58 | } 59 | 60 | function hideMenu() 61 | { 62 | if (!isVisible) 63 | return; 64 | 65 | isVisible = false; 66 | menu.classList.remove('visible'); 67 | menuButton.classList.remove('hidden'); 68 | } 69 | }; 70 | -------------------------------------------------------------------------------- /lib/piwik.js: -------------------------------------------------------------------------------- 1 | module.exports = () => 2 | { 3 | const _paq = _paq || []; 4 | 5 | _paq.push(['trackPageView']); 6 | _paq.push(['enableLinkTracking']); 7 | 8 | const u = (('https:' == document.location.protocol) ? 'https' : 'http') + '://private.versatica.com/piwik/'; 9 | 10 | _paq.push(['setTrackerUrl', u+'piwik.php']); 11 | _paq.push(['setSiteId', 8]); 12 | 13 | const d = document; 14 | const g = d.createElement('script'); 15 | const s = d.getElementsByTagName('script')[0]; 16 | 17 | g.type = 'text/javascript'; 18 | g.defer = true; 19 | g.async = true; 20 | g.src = u+'piwik.js'; 21 | s.parentNode.insertBefore(g, s); 22 | }; 23 | -------------------------------------------------------------------------------- /lib/shields.js: -------------------------------------------------------------------------------- 1 | module.exports = () => 2 | { 3 | const shields = document.querySelectorAll('.shield img'); 4 | 5 | shields.forEach((shield) => 6 | { 7 | shield.src = shield.dataset.canonicalSrc; 8 | }); 9 | }; 10 | 11 | 12 | -------------------------------------------------------------------------------- /license.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : License 3 | --- 4 | 5 | 6 | # ISC License 7 | 8 | Copyright © 2015, Iñaki Baz Castillo <ibc@aliax.net> 9 | 10 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mediasoup-website", 3 | "version": "3.0.0", 4 | "private": true, 5 | "description": "mediasoup website", 6 | "main": "lib/index.js", 7 | "homepage": "https://mediasoup.org", 8 | "repository": { 9 | "type": "git", 10 | "url": "https://github.com/versatica/mediasoup-website.git" 11 | }, 12 | "author": "Iñaki Baz Castillo ", 13 | "license": "LicenseRef-LICENSE", 14 | "engines": { 15 | "node": ">=18" 16 | }, 17 | "browserify": { 18 | "transform": [ 19 | "browserify-shim" 20 | ] 21 | }, 22 | "browserify-shim": { 23 | "anchor-js": "anchors" 24 | }, 25 | "dependencies": { 26 | "anchor-js": "^5.0.0", 27 | "domready": "^1.0.8", 28 | "dontscrollthebody": "^0.1.0", 29 | "hammerjs": "^2.0.8" 30 | }, 31 | "devDependencies": { 32 | "@octokit/rest": "^20.0.1", 33 | "browserify": "^17.0.0", 34 | "browserify-shim": "^3.8.16", 35 | "del": "^7.1.0", 36 | "gulp": "^4.0.2", 37 | "gulp-rename": "^2.0.0", 38 | "gulp-replace": "^1.1.4", 39 | "gulp-shell": "^0.8.0", 40 | "gulp-sitemap": "^8.0.0", 41 | "gulp-uglify-es": "^3.0.0", 42 | "request": "^2.88.0", 43 | "rsyncwrapper": "^3.0.1", 44 | "vinyl-buffer": "^1.0.1", 45 | "vinyl-source-stream": "^2.0.0" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /resources/CoSMo_ComparativeStudyOfWebrtcOpenSourceSfusForVideoConferencing.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versatica/mediasoup-website/462064b0011f50a9b668f48f680270e2aa48ee7d/resources/CoSMo_ComparativeStudyOfWebrtcOpenSourceSfusForVideoConferencing.pdf -------------------------------------------------------------------------------- /robots.txt: -------------------------------------------------------------------------------- 1 | --- 2 | layout : null 3 | --- 4 | 5 | User-agent: * 6 | Disallow: /404.html 7 | Sitemap: {{ site.custom.canonicalUrl }}/sitemap.xml 8 | -------------------------------------------------------------------------------- /sponsor.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Sponsor 3 | anchors : true 4 | --- 5 | 6 | 7 | 27 | 28 | 29 | # Become a Sponsor 30 | 31 | You can contribute to mediasoup by sponsoring it in [Open Collective](https://opencollective.com/mediasoup): 32 | 33 | * Become a recurring [backer](https://opencollective.com/mediasoup/contribute/backer-7720/checkout). 34 | * Become a recurring [sponsor](https://opencollective.com/mediasoup/contribute/sponsor-7721/checkout). 35 | * Make a [one time donation](https://opencollective.com/mediasoup/donate). 36 | * Or [contact us](/about/). 37 | 38 |
39 | This is a donation. No goods or services are expected in return. Any requests for refunds for those purposes will be rejected. 40 |
41 | 42 | 43 | ## Sponsors 44 | 45 | Check the list of individuals and organizations already contributing to mediasoup in Open Collective: 46 | 47 | * [opencollective.com/mediasoup](https://opencollective.com/mediasoup#section-contributors) 48 | -------------------------------------------------------------------------------- /support.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : Support 3 | anchors : true 4 | --- 5 | 6 | 7 | # Support 8 | 9 | mediasoup is an Open Source project supported on a best effort basis. Before asking any questions, please check the [documentation](/documentation/) and the [F.A.Q.](/faq/) (the response may be there). 10 | 11 | 12 | ### Questions and Doubts 13 | 14 |
15 |
16 | 17 | ![](/images/icon-help.svg){: .left.logo } 18 | 19 |
20 |
21 | 22 | Use the **[mediasoup Discourse Group][mediasoup-discourse-group]** for questions and doubts regarding mediasoup and its ecosystem. 23 | 24 | You can also check for historical discussions in the [mediasoup Google Group][mediasoup-google-group] (previously used as mediasoup support forum). 25 | 26 |
27 |
28 | 29 | 30 | ### Bug Reports and Feature Requests 31 | 32 |
33 |
34 | 35 | ![](/images/icon-bug.svg){: .left.logo } 36 | 37 |
38 |
39 | 40 | If you find an issue or bug in the software, or want to propose a new feature or improvement, do not hesitate to report it in the corresponding issue tracker: 41 | 42 | * **[mediasoup issue tracker][mediasoup-github-issues]** 43 | * **[mediasoup-client issue tracker][mediasoup-client-github-issues]** 44 | * **[libmediasoupclient issue tracker][libmediasoupclient-github-issues]** 45 | 46 |
47 |
48 | 49 |
50 | Please do **NOT** open an issue in GitHub for questions or doubts. Use the **[mediasoup Discourse Group][mediasoup-discourse-group]** instead. 51 |
52 | 53 | #### Crashes in mediasoup (get a core dump) 54 | 55 | If you get a crash in mediasoup server, this is, if you get an error log as follows: 56 | 57 | ``` 58 | 2020-01-06T16:02:57.965Z mediasoup:ERROR:Worker worker process died unexpectedly [pid:22, code:null, signal:SIGABRT] 59 | ``` 60 | 61 | or if the [worker.on("died")](/documentation/v3/mediasoup/api/#worker-on-died) event fires, this is a bug in mediasoup that should not happen. 62 | 63 | If so, please report the issue in [GitHub][mediasoup-github-issues] and also enable core dumps in your host. 64 | 65 | ##### Enabling core dumps in Linux 66 | 67 | If you run mediasoup in Linux, do the following **before** running your mediasoup application again: 68 | 69 | ```bash 70 | $ mkdir /tmp/cores 71 | $ chmod 777 /tmp/cores 72 | $ echo "/tmp/cores/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern 73 | $ ulimit -c unlimited 74 | ``` 75 | 76 | Then run your mediasoup application. If the crash happens again you should get a core dump in the `/tmp/cores` folder. Open it with `gdb` and attach it into the issue reported in GitHub: 77 | 78 | ```bash 79 | $ gdb PATH_TO_YOUR_NODE_APP/node_modules/mediasoup/worker/out/Release/mediasoup-worker PATH_TO_COREFILE 80 | ``` 81 | 82 | Then, within the `gdb` terminal: 83 | 84 | ```bash 85 | gdb> bt full 86 | ``` 87 | 88 | ##### Enabling core dumps in OSX 89 | 90 | Crashing processes in OSX automatically got a crash report in `/Users/USER/Library/Logs/DiagnosticReports` folder. 91 | 92 | ##### Forcing a core dump or crash report 93 | 94 | You can check whether your setup works by manually generating one as follows: 95 | 96 | ```bash 97 | $ pidof mediasoup-worker 98 | 46717 46718 46719 46720 99 | 100 | $ kill -s SIGSEGV 46717 101 | ``` 102 | 103 | Then check the generated core dump or crash report file in the corresponding folder. 104 | 105 | 106 | 107 | 108 | [mediasoup-discourse-group]:https://mediasoup.discourse.group 109 | [mediasoup-google-group]: https://groups.google.com/forum/#!forum/mediasoup 110 | [mediasoup-github-issues]: https://github.com/versatica/mediasoup/issues 111 | [mediasoup-client-github-issues]: https://github.com/versatica/mediasoup-client/issues 112 | [libmediasoupclient-github-issues]: https://github.com/versatica/libmediasoupclient/issues 113 | --------------------------------------------------------------------------------