2017-12-18 425 views
-4

我找到了运行我自己的rtmp服务器的方法,我也有一个mp4视频。 使用VLC我可以使用rtmp文件,但我需要将视频嵌入HTML网页。 我看到以下链接:https://www.codeproject.com/Tips/668131/How-to-embed-streaming-Video-rtmp-protocol-in-HTML但没有为我工作如何在HTML网页中嵌入流媒体视频(rtmp协议)?

我也读过你可以使用一种叫JWPlayer的东西.....但我不明白它是如何工作的或者你需要遵循哪些步骤来使用它。

我知道在网上有很多关于这个话题的文章,任何人都可以举个例子吗? (我的意思是HTML代码)

在此先感谢!

Eric。

+0

“_我知道互联网上有很多关于这个topic_的帖子。”然后请解释你为什么不使用这些资源,而是希望我们再次复制这些信息。 – csmckelvey

+0

你说得对,对不起,我的第一篇文章在这里。 我会改进我未来的职位 –

回答

0

最后我解决了我的问题。 我不得不使用Flowplayer在网站上显示我的rtmp视频。

下面是我遵循的步骤:

- wget的http://releases.flowplayer.org/flowplayer.rtmp/flowplayer.rtmp-3.2.13.swf(RTMP服务器上,特别是在USR /本地/ nginx的/ HTML /)

- 打开HTML,我创建并把它像这样(在我的情况是的test.html):

<html> 
<head> 
    <script src="http://releases.flowplayer.org/js/flowplayer- 
     3.2.12.min.js"></script> 
</head> 

<body> 
    <div id="player" style="width:644px;height:276px;margin:0 auto;text-align:center"> 
     <img src="/path/to/background.png" height="260" width="489" /> 
    </div> 
    <script> 
     $f("player", "http://releases.flowplayer.org/swf/flowplayer- 
    3.2.16. swf ", { 
     clip: { 
      url: '<YOUR_FILE.flv>', 
      scaling: 'fit', 
      provider: 'hddn' 
     }, 

     plugins: { 
      hddn: { 
       url: "flowplayer.rtmp-3.2.13.swf", 

       netConnectionUrl: 'rtmp://<IP_OF_THE_SERVER>:1935/vod' 
      } 
     }, 
     canvas: { 
      backgroundGradient: 'none' 
     } 
     }); 
    </script> 
</body> 
</html> 

- 修改NETC的值onnectionUrl和url。

- 导航服务器(在我的情况http://10.11.1.11/test.html

和它的作品!