Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

some cleaning

  • Loading branch information...
commit ab56424dc8eec84488e11ff61a6aabe05dcb067a 1 parent 17159f0
@fadomire authored
View
BIN  public/test.webm
Binary file not shown
View
2  views/index.ejs
@@ -23,7 +23,7 @@
<div class="navbar-inner">
<div class="container">
<a class="brand" href="/">Cocoon</a>
- <a href="https://github.com/FlintMakal/futureAuth"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
+ <a href="https://github.com/FlintMakal/videoStreaming"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
</div>
</div>
</div>
View
60 views/test.ejs
@@ -1,60 +0,0 @@
- <video id="streamSource" controls></video>
-<script>
-
-var video = document.getElementById('streamSource');
-
-window.MediaSource = window.MediaSource || window.WebKitMediaSource;
-if (!!!window.MediaSource) {
- alert('MediaSource API is not available');
-}
-
-var mediaSource = new MediaSource();
-
-video.src = window.URL.createObjectURL(mediaSource);
-
-mediaSource.addEventListener('webkitsourceopen', function(e) {
-
- var sourceBuffer = mediaSource.addSourceBuffer('video/webm; codecs="vorbis,vp8"');
-
-
-
-
- GET('test.webm', function(uInt8Array) {
- //console.log(uInt8Array)
- var file = new Blob([uInt8Array], {type: 'video/webm'});
-
- var reader = new FileReader();
- reader.onload = function(e) {
- console.log(e.target)
- //sourceBuffer.append(new Uint8Array(e.target.result));
- };
- reader.readAsArrayBuffer(file);
-
- });
-
-
-
-
-}, false);
-
-mediaSource.addEventListener('webkitsourceended', function(e) {
- logger.log('mediaSource readyState: ' + this.readyState);
-}, false);
-
-function GET(url, callback) {
- // alert(url);
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url, true);
- xhr.responseType = 'arraybuffer';
- xhr.send();
-
- xhr.onload = function(e) {
- if (xhr.status != 200) {
- alert("Unexpected status code " + xhr.status + " for " + url);
- return false;
- }
- console.log(xhr.response)
- callback(new Uint8Array(xhr.response));
- };
-}
-</script>
Please sign in to comment.
Something went wrong with that request. Please try again.