如何从 php 媒体源流与 JWPlayer 链接?

问题描述 投票:0回答:0

你好谁能告诉我如何在 JWPlayer 上设置 php 流源链接??

视频网址示例:https://example.com/myvideo/master.m3u8/get.php?id=xxxx 这个网址可以在 vlc、exo 播放器、在线 hls 播放器上播放。但不能在 jwplayer 上播放。

我的玩家代码在下面


 <head>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="https://cdn.jwplayer.com/libraries/IDzF9Zmk.js"></script>  
 </head>   
    


    <div id="content">
 
    <div id="my-video"></div>

 <script type="text/javascript">
    // Setup the player
    const player = jwplayer('my-video').setup({
      autostart: false,
      mute: false,
      responsive: true,
                

  "playlist": [{

  "sources": [{

     "default": false,
      type: "hls",
      file: 'https://example.com/myvideo/master.m3u8/get.php?id=xxxx',


      aspectratio: '16:9',
      primary: "html5",
      hlshtml: true,         
        }]
    }]
    });

  </script>
  </div>
<br>



javascript html html5-video jwplayer
© www.soinside.com 2019 - 2024. All rights reserved.