shithub: h264bsd

ref: d6f22738160011bec3a5317d7542d8d756a14a38
dir: /test/h264bsd.html/

View raw version
<!doctype html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>h.264bsd test</title>
</head>
<body>
    <input type="file" id="file" name="file" /><br/>
    <canvas id="canvas" width="640" height="480" style="border:solid;"></canvas>
    <h264decoder id="h264decoder"><h264decoder>
    <script src="../js/h264bsd_asm.js"></script>
    <script src="../js/sylvester.js"></script>
    <script src="../js/glUtils.js"></script>
    <script src="../js/util.js"></script>
    <script src="../js/canvas.js"></script>    
    <script src="../js/h264bsd.js"></script>
    <script type="text/javascript">
    	var canvas = document.getElementById('canvas');
    	var d = new H264Decoder(Module, canvas);

    	var f = document.getElementById('h264decoder');
    	console.log(f);

		function handleFileSelect(evt) {
		    var f = evt.target.files[0]; // FileList object
			
			var reader = new FileReader();

			// Closure to capture the file information.
			reader.onload = function(e) {
				var buf = e.target.result;							
				d.decode(buf);			
			};

			// Read in the image file as a data URL.
			reader.readAsArrayBuffer(f);
		}		  

 		document.getElementById('file').addEventListener('change', handleFileSelect, false);
    </script>
</body>
</html>