Video.js player does not play video when clicked? #8134
-
Hi everyone. I'm using video.js to make a simple web page that play a video stream from Gstreamer. The stream is written to a m3u8 file and here is the web page source: <!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title> My live video </title>
<link href="https://unpkg.com/video.js/dist/video-js.css" rel="stylesheet">
</head>
<body>
<h1>My live video - simple HLS player </h1>
<video-js id="video_id" class="vjs-default-skin" controls preload="auto" width="640" height="360">
<source src="http://server_ip:server_port/playlist.m3u8" type="application/x-mpegURL">
</video-js>
<script src="https://unpkg.com/video.js/dist/video.js"></script>
<script src="https://unpkg.com/@videojs/http-streaming/dist/videojs-http-streaming.js"></script>
<script>
var player = videojs('video_id')
</script>
</body>
</html> This used to working great 3-4 weeks ago but now it does not working. The player button simply does nothing when it's clicked, mean while the stream still works fine with VLC. Any ideas why this happened and how to fix it? Thanks a lot. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title> My live video </title>
<link href="https://unpkg.com/video.js/dist/video-js.css" rel="stylesheet">
</head>
<body>
<h1>My live video - simple HLS player </h1>
<video-js id="video_id" class="vjs-default-skin" controls preload="auto" width="640" height="360">
<source src="http://server_ip:server_port/playlist.m3u8" type="application/x-mpegURL">
</video-js>
<script src="https://unpkg.com/video.js/dist/video.js"></script>
<script>
var player = videojs('video_id')
</script>
</body>
</html> However, I noticed this behavior is happening on videojs version 8.x, I'm not sure if it's intended or not. In some very specific use cases a developer may want to use the a different version of the <!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title> My live video </title>
<link href="https://unpkg.com/[email protected]/dist/video-js.css" rel="stylesheet">
</head>
<body>
<h1>My live video - simple HLS player </h1>
<video-js id="video_id" class="vjs-default-skin" controls preload="auto" width="640" height="360">
<source src="https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8" type="application/x-mpegURL">
</video-js>
<script src="https://unpkg.com/[email protected]/dist/video.js"></script>
<script src="https://unpkg.com/@videojs/[email protected]/dist/videojs-http-streaming.js"></script>
<script>
var player = videojs('video_id')
</script>
</body>
</html> |
Beta Was this translation helpful? Give feedback.
Hi @vuongdanghuy
videojs-http-streaming
is bundled withvideojs
so you don't need to includedvideojs-http-streaming
. This should work: