Skip to content

snowinszu/wt-tracker

 
 

Repository files navigation

Build Status Coverage Status

wt-tracker

High-performance WebTorrent tracker.

WebTorrent tracker is a required component of WebTorrent and P2P Media Loader (peer-to-peer networks for web browsers) to do WebRTC signaling - exchanging connection data (i.e. SDP) between peers - joining them into swarms.

Open Trackers

USA

  • wss://us-tracker1.peerhub.net

Canada

  • wss://ca-tracker1.peerhub.net

English

  • wss://uk-tracker1.peerhub.net

Germany

  • wss://ge-tracker1.peerhub.net

Usage

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Clappr/Hls.js with P2P Media Loader</title>
    <meta charset="utf-8">
    <script src="https://cdn.jsdelivr.net/npm/p2p-media-loader-core@latest/build/p2p-media-loader-core.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/p2p-media-loader-hlsjs@latest/build/p2p-media-loader-hlsjs.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/clappr@latest"></script>
</head>
<body>
<div id="player"></div>
<script>
    const config = {
        loader: {
            trackerAnnounce: ['wss://us-tracker1.peerhub.net'],       // here config the tracker url
        }
    };
    if (p2pml.hlsjs.Engine.isSupported()) {
        var engine = new p2pml.hlsjs.Engine(config);

        var player = new Clappr.Player({
            parentId: "#player",
            source: "https://hlsjs-test-streams-wistia.s3.amazonaws.com/start-delimiter.m3u8",
            mute: true,
            autoPlay: true,
            playback: {
                hlsjsConfig: {
                    liveSyncDurationCount: 7,
                    loader: engine.createLoaderClass({

                    })
                }
            }
        });
        p2pml.hlsjs.initClapprPlayer(player);
    } else {
        document.write("Not supported :(");
    }
</script>
</body>
</html>

About

High-performance WebTorrent tracker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 93.2%
  • JavaScript 4.7%
  • HTML 1.8%
  • Dockerfile 0.3%