Last active
November 5, 2021 15:12
-
-
Save io-st/5134080e73f9bda0bc19e5616b358958 to your computer and use it in GitHub Desktop.
m3u8-video-js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/alt/video-js-cdn.css" rel="stylesheet"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/video.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/3.0.2/videojs-contrib-hls.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> | |
<script src="script.js"></script> | |
<input type="text" id="url" style="width:100%" value="https://p2p.cy/Soe0Woo3/output-360p.m3u8"> <input type="button" id="btn" value="play"> | |
<br><br> | |
<video id="video" class="video-js vjs-default-skin" preload="none" crossorigin="true" controls width="auto" height="320" controls> | |
</video> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$("#btn").on("click", function() { | |
$("#video").html("<source src='"+ $("#url").val() +"' type='application/x-mpegURL'>"); | |
var ply = videojs("video"); | |
ply.play(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment