src_minplayer.players.minplayer.js.html in HTML5 Media 7
1 /** The minplayer namespace. */
2 var minplayer = minplayer || {};
3
4 /** All the media player implementations */
5 minplayer.players = minplayer.players || {};
6
7 /**
8 * @constructor
9 * @extends minplayer.display
10 * @class The Flash media player class to control the flash fallback.
11 *
12 * @param {object} context The jQuery context.
13 * @param {object} options This components options.
14 * @param {object} queue The event queue to pass events around.
15 */
16 minplayer.players.minplayer = function(context, options, queue) {
17
18 // Derive from players flash.
19 minplayer.players.flash.call(this, context, options, queue);
20 };
21
22 /** Derive from minplayer.players.flash. */
23 minplayer.players.minplayer.prototype = new minplayer.players.flash();
24
25 /** Reset the constructor. */
26 minplayer.players.minplayer.prototype.constructor = minplayer.players.minplayer;
27
28 /**
29 * @see minplayer.plugin.construct
30 * @this minplayer.players.minplayer
31 */
32 minplayer.players.minplayer.prototype.construct = function() {
33
34 // Call the players.flash constructor.
35 minplayer.players.flash.prototype.construct.call(this);
36
37 // Set the plugin name within the options.
38 this.options.pluginName = 'minplayer';
39 };
40
41 /**
42 * Called when the Flash player is ready.
43 *
44 * @param {string} id The media player ID.
45 */
46 window.onFlashPlayerReady = function(id) {
47 var media = minplayer.get(id, 'media');
48 var i = media.length;
49 while (i--) {
50 media[i].onReady();
51 }
52 };
53
54 /**
55 * Called when the Flash player updates.
56 *
57 * @param {string} id The media player ID.
58 * @param {string} eventType The event type that was triggered.
59 */
60 window.onFlashPlayerUpdate = function(id, eventType) {
61 var media = minplayer.get(id, 'media');
62 var i = media.length;
63 while (i--) {
64 media[i].onMediaUpdate(eventType);
65 }
66 };
67
68 /**
69 * Used to debug from the Flash player to the browser console.
70 *
71 * @param {string} debug The debug string.
72 */
73 window.onFlashPlayerDebug = function(debug) {
74 if (console && console.log) {
75 console.log(debug);
76 }
77 };
78
79 /**
80 * @see minplayer.players.base#getPriority
81 * @param {object} file A {@link minplayer.file} object.
82 * @return {number} The priority of this media player.
83 */
84 minplayer.players.minplayer.getPriority = function(file) {
85 // Force this player if the stream is set.
86 return file.stream ? 100 : 1;
87 };
88
89 /**
90 * @see minplayer.players.base#canPlay
91 * @return {boolean} If this player can play this media type.
92 */
93 minplayer.players.minplayer.canPlay = function(file) {
94
95 // If this has a stream, then the minplayer must play it.
96 if (file.stream) {
97 return true;
98 }
99
100 var isWEBM = jQuery.inArray(file.mimetype, [
101 'video/x-webm',
102 'video/webm',
103 'application/octet-stream'
104 ]) >= 0;
105 return !isWEBM && (file.type == 'video' || file.type == 'audio');
106 };
107
108 /**
109 * @see minplayer.players.base#create
110 * @return {object} The media player entity.
111 */
112 minplayer.players.minplayer.prototype.create = function() {
113
114 // Make sure we provide default options...
115 this.options = jQuery.extend({
116 swfplayer: 'flash/minplayer.swf'
117 }, this.options);
118
119 minplayer.players.flash.prototype.create.call(this);
120
121 // The flash variables for this flash player.
122 var flashVars = {
123 'id': this.options.id,
124 'debug': this.options.debug,
125 'config': 'nocontrols',
126 'file': this.mediaFile.path,
127 'stream': this.mediaFile.stream,
128 'autostart': this.options.autoplay,
129 'autoload': this.options.autoload
130 };
131
132 // Return a flash media player object.
133 return this.getFlash({
134 swf: this.options.swfplayer,
135 id: this.options.id + '_player',
136 width: '100%',
137 height: '100%',
138 flashvars: flashVars,
139 wmode: this.options.wmode
140 });
141 };
142
143 /**
144 * Called when the Flash player has an update.
145 *
146 * @param {string} eventType The event that was triggered in the player.
147 */
148 minplayer.players.minplayer.prototype.onMediaUpdate = function(eventType) {
149 switch (eventType) {
150 case 'mediaMeta':
151 this.onLoaded();
152 break;
153 case 'mediaPlaying':
154 if (this.minplayerloaded) {
155 this.onPlaying();
156 }
157 break;
158 case 'mediaPaused':
159 this.minplayerloaded = true;
160 this.onPaused();
161 break;
162 case 'mediaComplete':
163 this.onComplete();
164 break;
165 }
166 };
167
168 /**
169 * Resets all variables.
170 */
171 minplayer.players.minplayer.prototype.clear = function() {
172 minplayer.players.flash.prototype.clear.call(this);
173 this.minplayerloaded = this.options.autoplay;
174 };
175
176 /**
177 * @see minplayer.players.base#load
178 * @return {boolean} If this action was performed.
179 */
180 minplayer.players.minplayer.prototype.load = function(file) {
181 if (minplayer.players.flash.prototype.load.call(this, file)) {
182 this.player.loadMedia(file.path, file.stream);
183 return true;
184 }
185
186 return false;
187 };
188
189 /**
190 * @see minplayer.players.base#play
191 * @return {boolean} If this action was performed.
192 */
193 minplayer.players.minplayer.prototype.play = function() {
194 if (minplayer.players.flash.prototype.play.call(this)) {
195 this.player.playMedia();
196 return true;
197 }
198
199 return false;
200 };
201
202 /**
203 * @see minplayer.players.base#pause
204 * @return {boolean} If this action was performed.
205 */
206 minplayer.players.minplayer.prototype.pause = function() {
207 if (minplayer.players.flash.prototype.pause.call(this)) {
208 this.player.pauseMedia();
209 return true;
210 }
211
212 return false;
213 };
214
215 /**
216 * @see minplayer.players.base#stop
217 * @return {boolean} If this action was performed.
218 */
219 minplayer.players.minplayer.prototype.stop = function() {
220 if (minplayer.players.flash.prototype.stop.call(this)) {
221 this.player.stopMedia();
222 return true;
223 }
224
225 return false;
226 };
227
228 /**
229 * @see minplayer.players.base#seek
230 * @return {boolean} If this action was performed.
231 */
232 minplayer.players.minplayer.prototype.seek = function(pos) {
233 if (minplayer.players.flash.prototype.seek.call(this, pos)) {
234 this.player.seekMedia(pos);
235 return true;
236 }
237
238 return false;
239 };
240
241 /**
242 * @see minplayer.players.base#setVolume
243 * @return {boolean} If this action was performed.
244 */
245 minplayer.players.minplayer.prototype.setVolume = function(vol) {
246 if (minplayer.players.flash.prototype.setVolume.call(this, vol)) {
247 this.player.setVolume(vol);
248 return true;
249 }
250
251 return false;
252 };
253
254 /**
255 * @see minplayer.players.base#getVolume
256 */
257 minplayer.players.minplayer.prototype.getVolume = function(callback) {
258 if (this.isReady()) {
259 callback(this.player.getVolume());
260 }
261 };
262
263 /**
264 * @see minplayer.players.flash#getDuration
265 */
266 minplayer.players.minplayer.prototype.getDuration = function(callback) {
267 if (this.isReady()) {
268
269 // Check to see if it is immediately available.
270 var duration = this.player.getDuration();
271 if (duration) {
272 callback(duration);
273 }
274 else {
275
276 // If not, then poll every second for the duration.
277 this.poll((function(player) {
278 return function() {
279 duration = player.player.getDuration();
280 if (duration) {
281 callback(duration);
282 }
283 return !duration;
284 };
285 })(this), 1000);
286 }
287 }
288 };
289
290 /**
291 * @see minplayer.players.base#getCurrentTime
292 */
293 minplayer.players.minplayer.prototype.getCurrentTime = function(callback) {
294 if (this.isReady()) {
295 callback(this.player.getCurrentTime());
296 }
297 };
298
299 /**
300 * @see minplayer.players.base#getBytesLoaded
301 */
302 minplayer.players.minplayer.prototype.getBytesLoaded = function(callback) {
303 if (this.isReady()) {
304 callback(this.player.getMediaBytesLoaded());
305 }
306 };
307
308 /**
309 * @see minplayer.players.base#getBytesTotal.
310 */
311 minplayer.players.minplayer.prototype.getBytesTotal = function(callback) {
312 if (this.isReady()) {
313 callback(this.player.getMediaBytesTotal());
314 }
315 };
316
File
player/doc/symbols/src/src_minplayer.players.minplayer.js.html
View source
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/** The minplayer namespace. */</span><span class="WHIT">
<span class='line'> 2</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">minplayer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">minplayer</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 3</span>
<span class='line'> 4</span> </span><span class="COMM">/** All the media player implementations */</span><span class="WHIT">
<span class='line'> 5</span> </span><span class="NAME">minplayer.players</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">minplayer.players</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 6</span>
<span class='line'> 7</span> </span><span class="COMM">/**
<span class='line'> 8</span> * @constructor
<span class='line'> 9</span> * @extends minplayer.display
<span class='line'> 10</span> * @class The Flash media player class to control the flash fallback.
<span class='line'> 11</span> *
<span class='line'> 12</span> * @param {object} context The jQuery context.
<span class='line'> 13</span> * @param {object} options This components options.
<span class='line'> 14</span> * @param {object} queue The event queue to pass events around.
<span class='line'> 15</span> */</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="NAME">minplayer.players.minplayer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">context</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">queue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 17</span>
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="COMM">// Derive from players flash.</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="NAME">minplayer.players.flash.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">queue</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 21</span>
<span class='line'> 22</span> </span><span class="COMM">/** Derive from minplayer.players.flash. */</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="NAME">minplayer.players.minplayer.prototype</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">minplayer.players.flash</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 24</span>
<span class='line'> 25</span> </span><span class="COMM">/** Reset the constructor. */</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="NAME">minplayer.players.minplayer.prototype.constructor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">minplayer.players.minplayer</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span>
<span class='line'> 28</span> </span><span class="COMM">/**
<span class='line'> 29</span> * @see minplayer.plugin.construct
<span class='line'> 30</span> * @this minplayer.players.minplayer
<span class='line'> 31</span> */</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="NAME">minplayer.players.minplayer.prototype.construct</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 33</span>
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="COMM">// Call the players.flash constructor.</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="NAME">minplayer.players.flash.prototype.construct.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span>
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="COMM">// Set the plugin name within the options.</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="NAME">this.options.pluginName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'minplayer'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span>
<span class='line'> 41</span> </span><span class="COMM">/**
<span class='line'> 42</span> * Called when the Flash player is ready.
<span class='line'> 43</span> *
<span class='line'> 44</span> * @param {string} id The media player ID.
<span class='line'> 45</span> */</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="NAME">window.onFlashPlayerReady</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">media</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">minplayer.get</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'media'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">media.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="KEYW">while</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">--</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="NAME">media</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">onReady</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 53</span>
<span class='line'> 54</span> </span><span class="COMM">/**
<span class='line'> 55</span> * Called when the Flash player updates.
<span class='line'> 56</span> *
<span class='line'> 57</span> * @param {string} id The media player ID.
<span class='line'> 58</span> * @param {string} eventType The event type that was triggered.
<span class='line'> 59</span> */</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="NAME">window.onFlashPlayerUpdate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">eventType</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">media</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">minplayer.get</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'media'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">media.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="KEYW">while</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">--</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">media</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">onMediaUpdate</span><span class="PUNC">(</span><span class="NAME">eventType</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 67</span>
<span class='line'> 68</span> </span><span class="COMM">/**
<span class='line'> 69</span> * Used to debug from the Flash player to the browser console.
<span class='line'> 70</span> *
<span class='line'> 71</span> * @param {string} debug The debug string.
<span class='line'> 72</span> */</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="NAME">window.onFlashPlayerDebug</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">debug</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">console</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">debug</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 78</span>
<span class='line'> 79</span> </span><span class="COMM">/**
<span class='line'> 80</span> * @see minplayer.players.base#getPriority
<span class='line'> 81</span> * @param {object} file A {@link minplayer.file} object.
<span class='line'> 82</span> * @return {number} The priority of this media player.
<span class='line'> 83</span> */</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="NAME">minplayer.players.minplayer.getPriority</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="COMM">// Force this player if the stream is set.</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">file.stream</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">100</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 88</span>
<span class='line'> 89</span> </span><span class="COMM">/**
<span class='line'> 90</span> * @see minplayer.players.base#canPlay
<span class='line'> 91</span> * @return {boolean} If this player can play this media type.
<span class='line'> 92</span> */</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="NAME">minplayer.players.minplayer.canPlay</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 94</span>
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="COMM">// If this has a stream, then the minplayer must play it.</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file.stream</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 99</span>
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">isWEBM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jQuery.inArray</span><span class="PUNC">(</span><span class="NAME">file.mimetype</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="STRN">'video/x-webm'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="STRN">'video/webm'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="STRN">'application/octet-stream'</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">isWEBM</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file.type</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'video'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">file.type</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'audio'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>106</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>107</span>
<span class='line'>108</span> </span><span class="COMM">/**
<span class='line'>109</span> * @see minplayer.players.base#create
<span class='line'>110</span> * @return {object} The media player entity.
<span class='line'>111</span> */</span><span class="WHIT">
<span class='line'>112</span> </span><span class="NAME">minplayer.players.minplayer.prototype.create</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>113</span>
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="COMM">// Make sure we provide default options...</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jQuery.extend</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="NAME">swfplayer</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'flash/minplayer.swf'</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>118</span>
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="NAME">minplayer.players.flash.prototype.create.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>120</span>
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="COMM">// The flash variables for this flash player.</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">flashVars</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="STRN">'id'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.options.id</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="STRN">'debug'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.options.debug</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="STRN">'config'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'nocontrols'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>126</span> </span><span class="WHIT"> </span><span class="STRN">'file'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.mediaFile.path</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT"> </span><span class="STRN">'stream'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.mediaFile.stream</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT"> </span><span class="STRN">'autostart'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.options.autoplay</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="STRN">'autoload'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.options.autoload</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>131</span>
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="COMM">// Return a flash media player object.</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.getFlash</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="NAME">swf</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.options.swfplayer</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.options.id</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'_player'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'100%'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'100%'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>138</span> </span><span class="WHIT"> </span><span class="NAME">flashvars</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">flashVars</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="NAME">wmode</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.options.wmode</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>141</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>142</span>
<span class='line'>143</span> </span><span class="COMM">/**
<span class='line'>144</span> * Called when the Flash player has an update.
<span class='line'>145</span> *
<span class='line'>146</span> * @param {string} eventType The event that was triggered in the player.
<span class='line'>147</span> */</span><span class="WHIT">
<span class='line'>148</span> </span><span class="NAME">minplayer.players.minplayer.prototype.onMediaUpdate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">eventType</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT"> </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">eventType</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'mediaMeta'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="NAME">this.onLoaded</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>153</span> </span><span class="WHIT"> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'mediaPlaying'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.minplayerloaded</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT"> </span><span class="NAME">this.onPlaying</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>157</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'mediaPaused'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT"> </span><span class="NAME">this.minplayerloaded</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>160</span> </span><span class="WHIT"> </span><span class="NAME">this.onPaused</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>161</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>162</span> </span><span class="WHIT"> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'mediaComplete'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT"> </span><span class="NAME">this.onComplete</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>165</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>166</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>167</span>
<span class='line'>168</span> </span><span class="COMM">/**
<span class='line'>169</span> * Resets all variables.
<span class='line'>170</span> */</span><span class="WHIT">
<span class='line'>171</span> </span><span class="NAME">minplayer.players.minplayer.prototype.clear</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT"> </span><span class="NAME">minplayer.players.flash.prototype.clear.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="NAME">this.minplayerloaded</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options.autoplay</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>174</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>175</span>
<span class='line'>176</span> </span><span class="COMM">/**
<span class='line'>177</span> * @see minplayer.players.base#load
<span class='line'>178</span> * @return {boolean} If this action was performed.
<span class='line'>179</span> */</span><span class="WHIT">
<span class='line'>180</span> </span><span class="NAME">minplayer.players.minplayer.prototype.load</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">file</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">minplayer.players.flash.prototype.load.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">file</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>182</span> </span><span class="WHIT"> </span><span class="NAME">this.player.loadMedia</span><span class="PUNC">(</span><span class="NAME">file.path</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">file.stream</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>185</span>
<span class='line'>186</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>187</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>188</span>
<span class='line'>189</span> </span><span class="COMM">/**
<span class='line'>190</span> * @see minplayer.players.base#play
<span class='line'>191</span> * @return {boolean} If this action was performed.
<span class='line'>192</span> */</span><span class="WHIT">
<span class='line'>193</span> </span><span class="NAME">minplayer.players.minplayer.prototype.play</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>194</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">minplayer.players.flash.prototype.play.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT"> </span><span class="NAME">this.player.playMedia</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>198</span>
<span class='line'>199</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>200</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>201</span>
<span class='line'>202</span> </span><span class="COMM">/**
<span class='line'>203</span> * @see minplayer.players.base#pause
<span class='line'>204</span> * @return {boolean} If this action was performed.
<span class='line'>205</span> */</span><span class="WHIT">
<span class='line'>206</span> </span><span class="NAME">minplayer.players.minplayer.prototype.pause</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">minplayer.players.flash.prototype.pause.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT"> </span><span class="NAME">this.player.pauseMedia</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>209</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>211</span>
<span class='line'>212</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>213</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>214</span>
<span class='line'>215</span> </span><span class="COMM">/**
<span class='line'>216</span> * @see minplayer.players.base#stop
<span class='line'>217</span> * @return {boolean} If this action was performed.
<span class='line'>218</span> */</span><span class="WHIT">
<span class='line'>219</span> </span><span class="NAME">minplayer.players.minplayer.prototype.stop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>220</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">minplayer.players.flash.prototype.stop.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>221</span> </span><span class="WHIT"> </span><span class="NAME">this.player.stopMedia</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>222</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>223</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>224</span>
<span class='line'>225</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>226</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>227</span>
<span class='line'>228</span> </span><span class="COMM">/**
<span class='line'>229</span> * @see minplayer.players.base#seek
<span class='line'>230</span> * @return {boolean} If this action was performed.
<span class='line'>231</span> */</span><span class="WHIT">
<span class='line'>232</span> </span><span class="NAME">minplayer.players.minplayer.prototype.seek</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">pos</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>233</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">minplayer.players.flash.prototype.seek.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pos</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>234</span> </span><span class="WHIT"> </span><span class="NAME">this.player.seekMedia</span><span class="PUNC">(</span><span class="NAME">pos</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>235</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>236</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>237</span>
<span class='line'>238</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>239</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>240</span>
<span class='line'>241</span> </span><span class="COMM">/**
<span class='line'>242</span> * @see minplayer.players.base#setVolume
<span class='line'>243</span> * @return {boolean} If this action was performed.
<span class='line'>244</span> */</span><span class="WHIT">
<span class='line'>245</span> </span><span class="NAME">minplayer.players.minplayer.prototype.setVolume</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">vol</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>246</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">minplayer.players.flash.prototype.setVolume.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">vol</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT"> </span><span class="NAME">this.player.setVolume</span><span class="PUNC">(</span><span class="NAME">vol</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>248</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>249</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>250</span>
<span class='line'>251</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>252</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>253</span>
<span class='line'>254</span> </span><span class="COMM">/**
<span class='line'>255</span> * @see minplayer.players.base#getVolume
<span class='line'>256</span> */</span><span class="WHIT">
<span class='line'>257</span> </span><span class="NAME">minplayer.players.minplayer.prototype.getVolume</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>258</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.isReady</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>259</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">this.player.getVolume</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>260</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>261</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>262</span>
<span class='line'>263</span> </span><span class="COMM">/**
<span class='line'>264</span> * @see minplayer.players.flash#getDuration
<span class='line'>265</span> */</span><span class="WHIT">
<span class='line'>266</span> </span><span class="NAME">minplayer.players.minplayer.prototype.getDuration</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>267</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.isReady</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>268</span>
<span class='line'>269</span> </span><span class="WHIT"> </span><span class="COMM">// Check to see if it is immediately available.</span><span class="WHIT">
<span class='line'>270</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">duration</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.player.getDuration</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">duration</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">duration</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>273</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>274</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>275</span>
<span class='line'>276</span> </span><span class="WHIT"> </span><span class="COMM">// If not, then poll every second for the duration.</span><span class="WHIT">
<span class='line'>277</span> </span><span class="WHIT"> </span><span class="NAME">this.poll</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">player</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>278</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>279</span> </span><span class="WHIT"> </span><span class="NAME">duration</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">player.player.getDuration</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>280</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">duration</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>281</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">duration</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>282</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">duration</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>287</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>288</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>289</span>
<span class='line'>290</span> </span><span class="COMM">/**
<span class='line'>291</span> * @see minplayer.players.base#getCurrentTime
<span class='line'>292</span> */</span><span class="WHIT">
<span class='line'>293</span> </span><span class="NAME">minplayer.players.minplayer.prototype.getCurrentTime</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>294</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.isReady</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">this.player.getCurrentTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>296</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>297</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>298</span>
<span class='line'>299</span> </span><span class="COMM">/**
<span class='line'>300</span> * @see minplayer.players.base#getBytesLoaded
<span class='line'>301</span> */</span><span class="WHIT">
<span class='line'>302</span> </span><span class="NAME">minplayer.players.minplayer.prototype.getBytesLoaded</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>303</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.isReady</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>304</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">this.player.getMediaBytesLoaded</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>305</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>306</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>307</span>
<span class='line'>308</span> </span><span class="COMM">/**
<span class='line'>309</span> * @see minplayer.players.base#getBytesTotal.
<span class='line'>310</span> */</span><span class="WHIT">
<span class='line'>311</span> </span><span class="NAME">minplayer.players.minplayer.prototype.getBytesTotal</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>312</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.isReady</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>313</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">this.player.getMediaBytesTotal</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>314</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>315</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>316</span> </span></pre></body></html>