OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 function loadMediaFromURL(video) { | 5 function loadMediaFromURL(video) { |
6 installTitleEventHandler(video, 'error'); | 6 installTitleEventHandler(video, 'error'); |
7 video.addEventListener('playing', function(event) { | 7 video.addEventListener('playing', function(event) { |
8 console.log('Video Playing.'); | 8 console.log('Video Playing.'); |
9 }); | 9 }); |
10 var source = loadMediaSource(QueryString.mediafile, QueryString.mediatype); | 10 var source = loadMediaSource(QueryString.mediafile, QueryString.mediatype); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 srcBuffer.addEventListener('updateend', onUpdateEnd); | 58 srcBuffer.addEventListener('updateend', onUpdateEnd); |
59 srcBuffer.appendBuffer(new Uint8Array(e.target.response)); | 59 srcBuffer.appendBuffer(new Uint8Array(e.target.response)); |
60 }); | 60 }); |
61 xhr.send(); | 61 xhr.send(); |
62 } | 62 } |
63 | 63 |
64 var mediaSource = new MediaSource(); | 64 var mediaSource = new MediaSource(); |
65 mediaSource.addEventListener('sourceopen', onSourceOpen); | 65 mediaSource.addEventListener('sourceopen', onSourceOpen); |
66 return mediaSource; | 66 return mediaSource; |
67 } | 67 } |
OLD | NEW |