JWplayer with p2p点对点分享资源

admin

发表文章数:3048

首页 » 网络资源 » 正文

代码示例:

<!DOCTYPE html>
<!--
    Copyright 2018 Novage LLC.
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
        http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<html lang="en">
<head>

    <meta charset="UTF-8">

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

    <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="./hola-jwplayer-hlsjs.min.js"></script>

    <script src="https://content.jwplatform.com/libraries/aG3IMhIy.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>

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

</head>
<body>
    <div id="wrapper">
        <div id="player"></div>
    </div>

    <script>
      jwplayer.key = "uoW6qHjBL3KNudxKVnwa3rt5LlTakbko9e6aQ6VUyKQ=";
        if (Hls.isSupported() && p2pml.hlsjs.Engine.isSupported()) {
            var engine = new p2pml.hlsjs.Engine();
            var player = jwplayer("player");
            player.setup({
                file: "<?php echo($_GET['url']);?>",
             	 playbackRateControls: true,
            });
            var provider = require("@hola.org/jwplayer-hlsjs");
            provider.attach();
            p2pml.hlsjs.initJwPlayer(player, {
                liveSyncDurationCount: 7, // To have at least 7 segments in queue
                loader: engine.createLoaderClass()
            });
        } else {
           var player = jwplayer("player");
          player.setup({
            autostart: true,
                sources: [{
                  file: "<?php echo($_GET['url']);?>",
                   type: "mp4"
                }],
          });
        }
    </script>

</body>
</html>

整合包下载:t1

未经允许不得转载:作者:admin, 转载或复制请以 超链接形式 并注明出处 夜河资源网
原文地址:《JWplayer with p2p点对点分享资源》 发布于2019-08-19

分享到:
赞(0) 打赏

评论 抢沙发

8 + 9 =


撰写不易~如果您觉得文章对您有帮助的话可以打赏我哦~谢谢亲亲~

支付宝扫一扫打赏

微信扫一扫打赏

外服网游加速器破解版
包含腾讯网游加速器、海豚网游加速器等八款知名加速器,可加速外服游戏,永久包售后包更新,不定时添加新款破解版加速器!
切换注册

登录

忘记密码 ?

切换登录

注册