Menu

[r15]: / trunk / libs / OSMF / org / osmf / net / httpstreaming / HTTPStreamingIndexHandlerBase.as  Maximize  Restore  History

Download this file

210 lines (197 with data), 7.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
/*****************************************************
*
* Copyright 2009 Adobe Systems Incorporated. All Rights Reserved.
*
*****************************************************
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
*
* The Initial Developer of the Original Code is Adobe Systems Incorporated.
* Portions created by Adobe Systems Incorporated are Copyright (C) 2009 Adobe Systems
* Incorporated. All Rights Reserved.
*
*****************************************************/
package org.osmf.net.httpstreaming
{
import flash.errors.IllegalOperationError;
import flash.events.EventDispatcher;
/**
* Dispatched when the bootstrap information has been downloaded and parsed.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion OSMF 1.0
*/
[Event(name="notifyIndexReady", type="org.osmf.events.HTTPStreamingFileIndexHandlerEvent")]
/**
* Dispatched when rates information becomes available. The rates usually becomes available
* when the bootstrap information has been parsed.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion OSMF 1.0
*/
[Event(name="notifyRates", type="org.osmf.events.HTTPStreamingFileIndexHandlerEvent")]
/**
* Dispatched when total duration value becomes available. The total duration usually becomes available
* when the bootstrap information has been parsed.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion OSMF 1.0
*/
[Event(name="notifyTotalDuration", type="org.osmf.events.HTTPStreamingFileIndexHandlerEvent")]
/**
* Dispatched when the index handler needs the index to be downloaded.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion OSMF 1.0
*/
[Event(name="requestLoadIndex", type="org.osmf.events.HTTPStreamingFileIndexHandlerEvent")]
/**
* Dispatched when the index handler encounters an unrecoverable error, such as an invalid
* bootstrap box or an empty server base url.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion OSMF 1.0
*/
[Event(name="notifyError", type="org.osmf.events.HTTPStreamingFileIndexHandlerEvent")]
/**
* Dispatched whenever the index handler learns of (new) DVR metadata
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion OSMF 1.0
*/
[Event(name="DVRStreamInfo", type="org.osmf.events.DVRStreamInfoEvent")]
[ExcludeClass]
/**
* @private
*
* Base class for HTTP streaming index handlers.
*
* An index handler is responsible for mapping a media playback time to the
* URL from which the corresponding media fragment can be retrieved.
*/
public class HTTPStreamingIndexHandlerBase extends EventDispatcher
{
/**
* Constructor.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion OSMF 1.0
*/
public function HTTPStreamingIndexHandlerBase()
{
}
/**
* Initializes this index with information about the media to be played.
*
* Subclasses must override to provide a specific implementation.
*
* @param indexInfo The info object used to initialize the index.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion OSMF 1.0
*/
public function initialize(indexInfo:Object):void
{
throw new IllegalOperationError("The initialize() method must be overridden by the derived class.");
}
/**
* Called when the index file has been loaded and is ready to be processed.
*
* Subclasses must override to provide a specific implementation. When the
* index file is processed, that implementation should dispatch the
* notifyIndexReady event.
*
* @param data The data from the loaded index file.
* @param indexContext An arbitrary context object which describes the loaded
* index file. Useful for index handlers which load multiple index files
* (and thus need to know which one to process).
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion OSMF 1.0
*/
public function processIndexData(data:*, indexContext:Object):void
{
throw new IllegalOperationError("The processIndexData() method must be overridden by the derived class.");
}
/**
* Returns the HTTPStreamRequest which encapsulates the file for the given
* playback time and quality. If no such file exists for the specified time
* or quality, then this method should return null.
*
* Subclasses must override to provide a specific implementation.
*
* @param time The time for which to retrieve a request object.
* @param quality The quality of the requested stream.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion OSMF 1.0
*/
public function getFileForTime(time:Number, quality:int):HTTPStreamRequest
{
throw new IllegalOperationError("The getFileForTime() method must be overridden by the derived class.");
}
/**
* Returns the HTTPStreamRequest which encapsulates the file that follows the
* previously retrieved file. If no next file exists, or if the specified
* quality is out of range, then this method should return null.
*
* Subclasses must override to provide a specific implementation.
*
* @param quality The quality of the requested stream.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion OSMF 1.0
*/
public function getNextFile(quality:int):HTTPStreamRequest
{
throw new IllegalOperationError("The getNextFile() method must be overridden by the derived class.");
}
/**
* Called when HTTPNetStream and/or its derived class needs to obtain DVR information. When information
* is ready available, it dispatches DVRStreamInfoEvent to pass the value back to HTTPNetStream.
*
* Subclasses must override to provide a specific implementation.
*
* @param the index information from which DVR information can be retrieve.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion OSMF 1.0
*/
public function dvrGetStreamInfo(indexInfo:Object):void
{
throw new IllegalOperationError("The dvrGetStreamInfo() method must be overridden by the derived class.");
}
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.