MCPcopy Create free account
hub / github.com/CreateJS/SoundJS / testPlayerVersion

Function testPlayerVersion

lib/flashaudioplugin-NEXT.js:226–254  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

224 - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
225 */
226 function testPlayerVersion() {
227 var b = doc.getElementsByTagName("body")[0];
228 var o = createElement(OBJECT);
229 o.setAttribute("type", FLASH_MIME_TYPE);
230 var t = b.appendChild(o);
231 if (t) {
232 var counter = 0;
233 (function(){
234 if (typeof t.GetVariable != UNDEF) {
235 var d = t.GetVariable("$version");
236 if (d) {
237 d = d.split(" ")[1].split(",");
238 ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
239 }
240 }
241 else if (counter < 10) {
242 counter++;
243 setTimeout(arguments.callee, 10);
244 return;
245 }
246 b.removeChild(o);
247 t = null;
248 matchVersions();
249 })();
250 }
251 else {
252 matchVersions();
253 }
254 }
255
256 /* Perform Flash Player and SWF version matching; static publishing only
257 */

Callers 1

mainFunction · 0.70

Calls 2

createElementFunction · 0.70
matchVersionsFunction · 0.70

Tested by

no test coverage detected