Skip to content

Latest commit

 

History

History
executable file
·
101 lines (68 loc) · 3.41 KB

how-to-use.md

File metadata and controls

executable file
·
101 lines (68 loc) · 3.41 KB

How to use?

Please make sure you've installed RTCMultiConnection.

<!-- or -->
<script src="/dist/RTCMultiConnection.min.js"></script>

<!-- Heroku Link -->
<script src="https://rtcmulticonnection.herokuapp.com/dist/RTCMultiConnection.min.js"></script>

<!-- or specific version -->
<script src="https://github.com/muaz-khan/RTCMultiConnection/releases/download/3.4.7/RTCMultiConnection.js"></script>

<!-- or CDN -->
<script src="https://rawgit.com/muaz-khan/RTCMultiConnection/master/dist/RTCMultiConnection.min.js"></script>

<!-- another CDN -->
<script src="https://cdn.jsdelivr.net/npm/rtcmulticonnection@latest/dist/RTCMultiConnection.min.js"></script>

<!-- another CDN -->
<script src="https://unpkg.com/rtcmulticonnection@latest/dist/RTCMultiConnection.min.js"></script>

<!-- bundle CDN -->
<script src="https://bundle.run/rtcmulticonnection@latest"></script>

If you're sharing files, you also need to link:

<script src="https://cdn.webrtc-experiment.com:443/FileBufferReader.js"></script>

You can link multiple files from dev directory. Order doesn't matters.

Use socket.io:

<script src="https://rtcmulticonnection.herokuapp.com/socket.io/socket.io.js"></script>

Set different socket URL

By default, RTCMultiConnection uses default port of your domain.

You can use custom ports either via config.json file:

{
  "socketURL": "https://yourdomain.com:9001/",
  "socketMessageEvent": "RTCMultiConnection-Message"
}

Or simply override in your HTML code:

connection.socketURL = 'https://yourdomain.com:9001/';

// if your server is already having "message" event
// then you can use something else, unique.
connection.socketMessageEvent = 'unique-message';

For testing purpose, you can use this as well:

{
  "socketURL": "https://rtcmulticonnection.herokuapp.com:443/",
  "socketMessageEvent": "RTCMultiConnection-Message"
}

Or:

connection.socketURL = 'https://rtcmulticonnection.herokuapp.com:443/';

Here is a demo explaining how to use above socketURL:

Integrate in your own applications?

Other Documents

  1. Installation Guide
  2. How to Use?
  3. API Reference
  4. Upgrade from v2 to v3
  5. How to write iOS/Android applications?
  6. Tips & Tricks

License

RTCMultiConnection is released under MIT licence . Copyright (c) Muaz Khan.