| 1 | /* |
| 2 | * Copyright 2012 Closure Compiler Authors |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | /** |
| 17 | * @fileoverview Definitions for the Media Source Extensions. |
| 18 | * @see http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html |
| 19 | * |
| 20 | * @externs |
| 21 | */ |
| 22 | |
| 23 | /** |
| 24 | * @constructor |
| 25 | * @implements {EventTarget} |
| 26 | */ |
| 27 | function MediaSource() {} |
| 28 | |
| 29 | /** @override */ |
| 30 | MediaSource.prototype.addEventListener = function( |
| 31 | type, listener, useCapture) {}; |
| 32 | |
| 33 | /** @override */ |
| 34 | MediaSource.prototype.removeEventListener = function( |
| 35 | type, listener, useCapture) {}; |
| 36 | |
| 37 | /** @override */ |
| 38 | MediaSource.prototype.dispatchEvent = function(evt) {}; |
| 39 | |
| 40 | /** @type {Array} */ |
| 41 | MediaSource.prototype.sourceBuffers; |
| 42 | |
| 43 | /** @type {Array} */ |
| 44 | MediaSource.prototype.activeSourceBuffers; |
| 45 | |
| 46 | /** @type {number} */ |
| 47 | MediaSource.prototype.duration; |
| 48 | |
| 49 | /** |
| 50 | * @param {string} type |
| 51 | * @return {SourceBuffer} |
| 52 | */ |
| 53 | MediaSource.prototype.addSourceBuffer = function(type) {}; |
| 54 | |
| 55 | /** |
| 56 | * @param {SourceBuffer} sourceBuffer |
| 57 | */ |
| 58 | MediaSource.prototype.removeSourceBuffer = function(sourceBuffer) {}; |
| 59 | |
| 60 | /** @type {string} */ |
| 61 | MediaSource.prototype.readyState; |
| 62 | |
| 63 | /** |
| 64 | * @param {string=} opt_error |
| 65 | */ |
| 66 | MediaSource.prototype.endOfStream = function(opt_error) {}; |
| 67 | |
| 68 | |
| 69 | /** |
| 70 | * @constructor |
| 71 | * @implements {EventTarget} |
| 72 | */ |
| 73 | function SourceBuffer() {} |
| 74 | |
| 75 | /** @override */ |
| 76 | SourceBuffer.prototype.addEventListener = function( |
| 77 | type, listener, useCapture) {}; |
| 78 | |
| 79 | /** @override */ |
| 80 | SourceBuffer.prototype.removeEventListener = function( |
| 81 | type, listener, useCapture) {}; |
| 82 | |
| 83 | /** @override */ |
| 84 | SourceBuffer.prototype.dispatchEvent = function(evt) {}; |
| 85 | |
| 86 | /** @type {TimeRanges} */ |
| 87 | SourceBuffer.prototype.buffered; |
| 88 | |
| 89 | /** @type {number} */ |
| 90 | SourceBuffer.prototype.timestampOffset; |
| 91 | |
| 92 | /** |
| 93 | * @param {Uint8Array} data |
| 94 | */ |
| 95 | SourceBuffer.prototype.append = function(data) {}; |
| 96 | |
| 97 | /** |
| 98 | * Abort the current segment append sequence. |
| 99 | */ |
| 100 | SourceBuffer.prototype.abort = function() {}; |