Skip to content

JWPlayer with Peer5 for HLS integration




JWPlayer is a feature rich video player that supports HLS.

The integration with Peer5 plugin is easy and involves just two lines of code. In addition to the player script, simply include the Peer5 client and the matching Peer5 JWPlayer plugin based on your player version.

Peer5 client and plugins scripts

Add the following two scripts to the head of your player's page, based on your player version:

JWPlayer v8.x

1
2
<script src="//api.peer5.com/peer5.js?id=PEER5_CUSTOMER_ID"></script>
<script src="//api.peer5.com/peer5.jwplayer8.plugin.js"></script>

JWPlayer v7.x

1
2
<script src="//api.peer5.com/peer5.js?id=PEER5_CUSTOMER_ID"></script>
<script src="//api.peer5.com/peer5.jwplayer7.plugin.js"></script>

Complete Example (JWPlayer v8.x)

The following information needs to be filled according to your actual data:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JWPlayer test</title>
    <!-- Peer5 scripts -->
    <script src="//api.peer5.com/peer5.js?id=PEER5_CUSTOMER_ID"></script>
    <script src="//api.peer5.com/peer5.jwplayer8.plugin.js"></script>

    <!-- Player scripts -->
    <script src="//ssl.p.jwpcdn.com/player/v/8.12.5/jwplayer.js"></script>

    <!-- JWPlayer license key -->
    <script>jwplayer.key = 'JWPLAYER_KEY';</script>
</head>
<body>
    <div id="player"></div>
    <script>
        var player = jwplayer('player').setup({
            file: 'MANIFEST_FILE'
        });
    </script>
</body>
</html>

Complete Example With JW Cloud Platform (JWPlayer 8)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JWPlayer 8 Demo</title>
    <!-- Peer5 scripts -->
    <script src="//api.peer5.com/peer5.js?id=PEER5_CUSTOMER_ID"></script>
    <script src="//api.peer5.com/peer5.jwplayer8.plugin.js"></script>
</head>
<body>
    <div>
        <!-- Player scripts -->
        <script src="//content.jwplatform.com/players/abcd-efghij12.js"></script>
    </div>
</body>
</html>

Visit the full JWPlayer player docs here.

To test that you integrated with Peer5 correctly, and to see stats about what the Peer5 integration is doing, you can view the stats overlay.