且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在chrome上看不到HLS视频|Video.js

更新时间:2023-09-21 22:39:34

我不确定上面的代码到底有什么问题,因为我没有足够的与Web相关的知识.但是,我发现堆栈溢出的解决方案,事情开始起作用:

I'm not sure what really is the issue with the code above, as i don't have enough knowledge related to web. However, i found this solution on stack overflow and things started working:

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Video</title>

  <link href="http://vjs.zencdn.net/4.12/video-js.css" rel="stylesheet">
  <script src="http://vjs.zencdn.net/4.12/video.js"></script>
 <script src="https://github.com/videojs/videojs-contrib-media-sources/releases/download/v0.1.0/videojs-media-sources.js"></script>
  <script src="https://github.com/videojs/videojs-contrib-hls/releases/download/v0.11.2/videojs.hls.min.js"></script>

</head>
<body>
  <h1>Video</h1>

  <video id="my_video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="268" 
  data-setup='{}'>
    <source src="http://iphone-streaming.ustream.tv/uhls/3064708/streams/live/iphone/playlist.m3u8" type='application/x-mpegURL'>
  </video>

  <script>
  var player = videojs('my_video_1');
  </script>

</body>
</html>

<!-- Replace current .m3u8 and check..current file has access issue-->

更新该解决方案有时也不起作用.可能是HLS视频的带宽问题.我的S3存储桶在美国,因为那里有用户.但是,我正在从巴基斯坦访问它.因此问题仍然存在.可能是什么问题?如何解决?

Update This solution is also not working sometimes. May be it's issue with bandwidth of HLS videos. My S3 bucket is in US as the users are there. However, i'm accessing it from Pakistan. So the question remains there. What can be the issue? How to fix it?