Videojs 和 rtmp 流
Videojs and rtmp streaming
嘿,我正在使用videojs显示某些视频,一些需要显示的视频是rtmp流。
我正在尝试使用以下配置 运行 视频,但没有成功。
此类视频需要特定插件吗?
这是我目前所取得的成就:
<link href="http://vjs.zencdn.net/5.0.2/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/ie8/1.1.0/videojs-ie8.min.js"></script>
<script src="http://vjs.zencdn.net/5.0.2/video.js"></script>
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="264" poster="http://vjs.zencdn.net/v/oceans.png" data-setup="{}">
<source src="rtmp://aljazeeraflashlivefs.fplive.net/aljazeeraflashlive-live/aljazeera_ara_high" type="rtmp/mp4">
<track kind="captions" src="../shared/example-captions.vtt" srclang="en" label="English"></track>
<!-- Tracks need an ending tag thanks to IE9 -->
<track kind="subtitles" src="../shared/example-captions.vtt" srclang="en" label="English"></track>
<!-- Tracks need an ending tag thanks to IE9 -->
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video>
VideoJS是否支持rtmp流,根据文档说它支持flash视频(包括rtmp吗?)
我已经把视频类型改成了rtmp/mp4可以吗?
如果我使用的是 vlc 或 vlc 插件,那么我可以 运行 此处的视频:
rtmp://aljazeeraflashlivefs.fplive.net/aljazeeraflashlive-live/aljazeera_ara_high
不要忘记将源类型更改为:type="application/x-mpegURL"/> 如果是 m3u8
我在我的项目中使用了这个
<head>
<link href="https://vjs.zencdn.net/7.6.6/video-js.css" rel="stylesheet" />
<script src="https://vjs.zencdn.net/7.6.6/video.js"></script>
<title>Stream PAGE</title>
<!-- This style is clearly not needed but yolo -->
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>What you want</h1>
<video id="player" class="video-js vjs-default-skin" width="800" height="440" controls preload="none">
<source src="http://192.168.205.1:9000/1234.m3u8" type="application/x-mpegURL" />
</video>
<script>
var player = videojs('#player')
</script>
嘿,我正在使用videojs显示某些视频,一些需要显示的视频是rtmp流。
我正在尝试使用以下配置 运行 视频,但没有成功。 此类视频需要特定插件吗?
这是我目前所取得的成就:
<link href="http://vjs.zencdn.net/5.0.2/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/ie8/1.1.0/videojs-ie8.min.js"></script>
<script src="http://vjs.zencdn.net/5.0.2/video.js"></script>
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="264" poster="http://vjs.zencdn.net/v/oceans.png" data-setup="{}">
<source src="rtmp://aljazeeraflashlivefs.fplive.net/aljazeeraflashlive-live/aljazeera_ara_high" type="rtmp/mp4">
<track kind="captions" src="../shared/example-captions.vtt" srclang="en" label="English"></track>
<!-- Tracks need an ending tag thanks to IE9 -->
<track kind="subtitles" src="../shared/example-captions.vtt" srclang="en" label="English"></track>
<!-- Tracks need an ending tag thanks to IE9 -->
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video>
VideoJS是否支持rtmp流,根据文档说它支持flash视频(包括rtmp吗?)
我已经把视频类型改成了rtmp/mp4可以吗?
如果我使用的是 vlc 或 vlc 插件,那么我可以 运行 此处的视频: rtmp://aljazeeraflashlivefs.fplive.net/aljazeeraflashlive-live/aljazeera_ara_high
不要忘记将源类型更改为:type="application/x-mpegURL"/> 如果是 m3u8
我在我的项目中使用了这个
<head>
<link href="https://vjs.zencdn.net/7.6.6/video-js.css" rel="stylesheet" />
<script src="https://vjs.zencdn.net/7.6.6/video.js"></script>
<title>Stream PAGE</title>
<!-- This style is clearly not needed but yolo -->
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>What you want</h1>
<video id="player" class="video-js vjs-default-skin" width="800" height="440" controls preload="none">
<source src="http://192.168.205.1:9000/1234.m3u8" type="application/x-mpegURL" />
</video>
<script>
var player = videojs('#player')
</script>