Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <html lang="en">
    <meta charset="UTF-8" />

    <title>JWPlayer with hls.js engine and P2P demo</title>

    <script src=""></script>
    <script src="//"></script>
    <script src=""></script>
        #wrapper {
            width: 720px;
            margin-left: auto;
            margin-right: auto;
            display: block;
<div id="wrapper">
    <div id="player"></div>

    jwplayer.key = "uoW6qHjBL3KNudxKVnwa3rt5LlTakbko9e6aQ6VUyKQ=";
    var p2pConfig = {
        live: false,        // set to true in live mode
        swFile: './sw.js',
        // trackerZone: 'hk',        // if using Hongkong tracker
        // trackerZone: 'us',        // if using USA tracker
        // token: YOUR_TOKEN
        // Other p2pConfig options provided by CDNBye
    const isSamsungBrowser = navigator.userAgent.indexOf('SamsungBrowser') > - 1;
    if (!isSamsungBrowser && !Hls.P2pEngine.isMSESupported() || Hls.P2pEngine.getBrowser() === 'Mac-Safari') {
        // use ServiceWorker based p2p engine, need additional file sw.js
        new Hls.P2pEngine.ServiceWorkerEngine(p2pConfig)
    var player = jwplayer("player");
    Hls.P2pEngine.tryRegisterServiceWorker(p2pConfig).then(() => {
            file: "",
            width: 512,
            height: 288,
            autostart: true,
            hlsjsdefault: true,
            hlsjsConfig: {
                liveSyncDurationCount: 10,
                // debug: true,
                // Other hlsjsConfig options provided by hls.js