TypechoJoeTheme

Strjson博客-专注于各种精品源码、精品软件、技术教程分享、黑客技术、破解教程(爱你在心口难开、没事写一写)

统计

免费p2p加速播放器m3u8播放器开源免费

子沫博主
2019-11-22
/
4 评论
/
4,249 阅读
/
0 个字
/
百度已收录
11/22
本文最后更新于2019年11月22日,已超过1825天没有更新。如果文章内容或图片资源失效,请留言反馈,我会及时处理,谢谢!
<!DOCTYPE html>
<html lang="en">
<head>

    <meta charset="UTF-8">

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

    <script src="../node_modules/p2p-media-loader-core/build/p2p-media-loader-core.js"></script>
    <script src="../build/p2p-media-loader-hlsjs.js"></script>

    <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/p2p-dplayer@latest/dist/DPlayer.min.css">
    <script src="https://cdn.jsdelivr.net/npm/dplayer@latest"></script>

    <style>
        #dplayer {
            width: 720px;
            margin-left: auto;
            margin-right: auto;
            display: block;
        }
    </style>

</head>
<body>

    <div id="dplayer"></div>

    <script>
        if (Hls.isSupported() && p2pml.hlsjs.Engine.isSupported()) {
            window.dp = new DPlayer({
                container: document.getElementById("dplayer"),
                video: {
                    url: "https://akamai-axtest.akamaized.net/routes/lapd-v1-acceptance/www_c4/Manifest.m3u8",
                    type: "customHls",
                    customType: {
                        "customHls": function (video, player) {
                            const engine = new p2pml.hlsjs.Engine();
                            const hls = new Hls({
                                liveSyncDurationCount: 7, // To have at least 7 segments in queue
                                loader: engine.createLoaderClass()
                            });
                            p2pml.hlsjs.initHlsJsPlayer(hls);
                            hls.loadSource(video.src);
                            hls.attachMedia(video);
                        }
                    }
                }
            });
        } else {
            document.write("Not supported :(");
        }
    </script>

</body>
</html>
P2P
朗读
赞(0)
赞赏
感谢您的支持,我会继续努力哒!
版权属于:

Strjson博客-专注于各种精品源码、精品软件、技术教程分享、黑客技术、破解教程(爱你在心口难开、没事写一写)

本文链接:

https://jpgke.com/jishu/135.html(转载时请注明本文出处及文章链接)

评论 (4)
  1. 111111111 闲逛
    Windows 10 · Google Chrome

    wwwwww五万

    2021-09-11 回复
  2. valneysl 闲逛
    Windows 10 · Google Chrome

    2020-11-23 回复
  3. 闲逛
    Windows 7 · Google Chrome

    www

    2020-03-07 回复
  4. 滚滚滚 闲逛
    Android Oreo · Google Chrome

    该喝喝

    2019-12-12 回复

互动读者

人生倒计时

今日已经过去小时
这周已经过去
本月已经过去
今年已经过去个月

360实时热点

  • 获取失败!

标签云

最新回复

  1. 试试看闲逛
    2021-12-14
  2. 555闲逛
    2021-12-07
  3. def闲逛
    2021-11-28
  4. 紫夜闲逛
    2021-11-28
  5. 666闲逛
    2021-10-05