VideoJs带直播 [英] VideoJs with live stream

查看:614
本文介绍了VideoJs带直播的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用videoJs来处理实时流我有一个包含rtmp直播的链接。

http://www.iptv-player.com/index.php?fdb=1&title=%20+JIMTV%20%20&stream=rtmp%3A%2F%2Frtmp.jim.stream.vmmacdn.be %2Fvmma-jim-rtmplive-live%2Fjim

和玩家本身有一个链接:

rtmp://rtmp.jim.stream.vmmacdn。 be / vmma-jim-rtmplive-live / jim

我目前只是想在视频播放器上播放实时视频播放器我已经获得了本地视频,但是我无法理解如何获取现场直播工作。

这是我到目前为止的html

I am trying to get videoJs to work with a live stream I have a this link which contains an rtmp live stream.
http://www.iptv-player.com/index.php?fdb=1&title=%20+JIMTV%20%20&stream=rtmp%3A%2F%2Frtmp.jim.stream.vmmacdn.be%2Fvmma-jim-rtmplive-live%2Fjim
and the player itself has a link which is:
rtmp://rtmp.jim.stream.vmmacdn.be/vmma-jim-rtmplive-live/jim
I am currently just trying to get the live stream to play on the videoJs player I have already got the local video to work just cant fathom out how to get the live stream to work.
Here is my html for what i have so far

<!DOCTYPE html>
<html>
<head>
  <title>Video.js | HTML5 Video Player</title>

  <!-- Chang URLs to wherever Video.js files will be hosted -->
  <link href="video-js.css" rel="stylesheet" type="text/css">
  <!-- video.js must be in the <head> for older IEs to work. -->
  <script src="video.js"></script>

  <!-- Unless using the CDN hosted version, update the URL to the Flash SWF -->
  <script>
    videojs.options.flash.swf = "video-js.swf";
  </script>


</head>
<body>

  <video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="264"
      poster="http://www.pageresource.com/wallpapers/wallpaper/bleach-ichigo-mugetsu-here-size-original_215405.jpg"
      data-setup="{}">
    <
    <source src="http://www.iptv-player.com/index.php?fdb=1&title=%20+JIMTV%20%20&stream=rtmp%3A%2F%2Frtmp.jim.stream.vmmacdn.be%2Fvmma-jim-rtmplive-live%2Fjim" type='video/mp4' />
    <!--<track kind="captions" src="demo.captions.vtt" srclang="en" label="English"></track>--><!-- Tracks need an ending tag thanks to IE9 -->
    <!--<track kind="subtitles" src="demo.captions.vtt" srclang="en" label="English"></track>--><!-- Tracks need an ending tag thanks to IE9 -->
  </video>

</body>
</html>


推荐答案

所以我看了更多,发现它是因为我试图在当地这样做。我将我的代码放到JsFiddle上并且它有效。所以我可以逻辑地说,文件必须在Web服务器上才能让播放器工作。

这对我来说不太确定它是否可以在本地完成但是我能做的唯一方法让它在网络服务器上工作

So I Looked more into this and found out that it was because I was trying to do this locally. I put my code onto the JsFiddle and it worked. So all I can logically say is that the files must be on a web server for the player to work.
This worked for me not sure if it can be done locally but the only way I could get it to work was on a web server

这篇关于VideoJs带直播的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆