mediasource.js (3270B)
1 /* 2 * Copyright 2012 The 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. Note that the 18 * properties available here are the union of several versions of the spec. 19 * @see http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html 20 * 21 * @externs 22 */ 23 24 /** 25 * @constructor 26 * @implements {EventTarget} 27 */ 28 function MediaSource() {} 29 30 /** 31 * @param {boolean=} opt_useCapture 32 * @override 33 */ 34 MediaSource.prototype.addEventListener = function( 35 type, listener, opt_useCapture) {}; 36 37 /** 38 * @param {boolean=} opt_useCapture 39 * @override 40 */ 41 MediaSource.prototype.removeEventListener = function( 42 type, listener, opt_useCapture) {}; 43 44 /** @override */ 45 MediaSource.prototype.dispatchEvent = function(evt) {}; 46 47 /** @type {Array.<SourceBuffer>} */ 48 MediaSource.prototype.sourceBuffers; 49 50 /** @type {Array.<SourceBuffer>} */ 51 MediaSource.prototype.activeSourceBuffers; 52 53 /** @type {number} */ 54 MediaSource.prototype.duration; 55 56 /** 57 * @param {string} type 58 * @return {SourceBuffer} 59 */ 60 MediaSource.prototype.addSourceBuffer = function(type) {}; 61 62 /** 63 * @param {SourceBuffer} sourceBuffer 64 */ 65 MediaSource.prototype.removeSourceBuffer = function(sourceBuffer) {}; 66 67 /** @type {string} */ 68 MediaSource.prototype.readyState; 69 70 /** 71 * @param {string=} opt_error 72 */ 73 MediaSource.prototype.endOfStream = function(opt_error) {}; 74 75 /** 76 * @param {string} type 77 * @return {boolean} 78 */ 79 MediaSource.isTypeSupported = function(type) {}; 80 81 82 /** 83 * @constructor 84 * @implements {EventTarget} 85 */ 86 function SourceBuffer() {} 87 88 /** 89 * @param {boolean=} opt_useCapture 90 * @override 91 */ 92 SourceBuffer.prototype.addEventListener = function( 93 type, listener, opt_useCapture) {}; 94 95 /** 96 * @param {boolean=} opt_useCapture 97 * @override 98 */ 99 SourceBuffer.prototype.removeEventListener = function( 100 type, listener, opt_useCapture) {}; 101 102 /** @override */ 103 SourceBuffer.prototype.dispatchEvent = function(evt) {}; 104 105 /** @type {string} */ 106 SourceBuffer.prototype.appendMode; 107 108 /** @type {boolean} */ 109 SourceBuffer.prototype.updating; 110 111 /** @type {TimeRanges} */ 112 SourceBuffer.prototype.buffered; 113 114 /** @type {number} */ 115 SourceBuffer.prototype.timestampOffset; 116 117 /** @type {number} */ 118 SourceBuffer.prototype.appendWindowStart; 119 120 /** @type {number} */ 121 SourceBuffer.prototype.appendWindowEnd; 122 123 /** 124 * @param {Uint8Array} data 125 */ 126 SourceBuffer.prototype.append = function(data) {}; 127 128 /** 129 * @param {ArrayBuffer|ArrayBufferView} data 130 */ 131 SourceBuffer.prototype.appendBuffer = function(data) {}; 132 133 /** 134 * Abort the current segment append sequence. 135 */ 136 SourceBuffer.prototype.abort = function() {}; 137 138 /** 139 * @param {number} start 140 * @param {number} end 141 */ 142 SourceBuffer.prototype.remove = function(start, end) {};