You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<html><head> <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script> <!-- Or if you want a more recent canary version --> <!-- <script src="https://cdn.jsdelivr.net/npm/hls.js@canary"></script> --> <script> var video = document.getElementById('video'); if( Hls.isSupported()) { alert("HLS is OK"); var hls = new Hls(); hls.loadSource('https://video-dev.github.io/streams/x36xhzz/x36xhzz.m3u8'); hls.attachMedia(video); hls.on(Hls.Events.MANIFEST_PARSED,function() { video.play(); }); } // hls.js is not supported on platforms that do not have Media Source Extensions (MSE) enabled. // When the browser has built-in HLS support (check using `canPlayType`), we can provide an HLS manifest (i.e. .m3u8 URL) directly to the video element through the `src` property. // This is using the built-in support of the plain video element, without using hls.js. // Note: it would be more normal to wait on the 'canplay' event below however on Safari (where you are most likely to find built-in HLS support) the video.src URL must be on the user-driven // white-list before a 'canplay' event will be emitted; the last video event that can be reliably listened-for when the URL is not on the white-list is 'loadedmetadata'. else if (video.canPlayType('application/vnd.apple.mpegurl')) { video.src = 'https://video-dev.github.io/streams/x36xhzz/x36xhzz.m3u8'; video.addEventListener('loadedmetadata',function() { video.play(); }); }; var socket; function start_connection(){ var socket = new WebSocket('ws://192.168.0.115:8080/koko/shmoko/zuzu?ID=2323089034'); socket.onopen = function() { alert("Connection opened...") }; socket.onclose = function() { alert("Connection closed..."); socket = null; }; socket.onopen = function(event) { socket.send('Some message') }; socket.onmessage = function(event) { var message = event.data; alert( 'Resived:' + message ); }; }; function chucha(){ //var mimeCodec = 'video/mp4; codecs="avc1.4D401F"'; var mimeCodec = 'video/mp4; codecs="avc1.64001E"' if (MediaSource.isTypeSupported(mimeCodec)) { // Create Media Source var mediaSource = new MediaSource(); // mediaSource.readyState === 'closed' alert('Codec OK'); } else { alert("Unsupported media format"); } }; </script></head><body> <input type="button" onclick="start_connection();" value="Connect"> <input type="button" onclick="chucha();" value="Check Codec"> <video id="video" controls ></video></video></body></html>
|