Changeset 13701
- Timestamp:
- 05/12/08 09:24:09 (6 months ago)
- Location:
- dojox/trunk/embed
- Files:
-
- 2 modified
-
Quicktime.js (modified) (4 diffs)
-
tests/quicktime.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dojox/trunk/embed/Quicktime.js
r13642 r13701 162 162 if(!dojo.isIE){ 163 163 // FIXME: Opera does not like this at all for some reason, and of course there's no event references easily found. 164 qtVersion = { major: 0, minor: 0, rev: 0 };164 qtVersion = dojox.embed._quicktime.version = { major: 0, minor: 0, rev: 0 }; 165 165 var o = qtMarkup({ path: testMovieUrl, width:4, height:4 }); 166 if(!dojo._initFired){ 167 var s='<div style="top:0;left:0;width:1px;height:1px;overflow:hidden;position:absolute;" id="-qt-version-test">' 168 + o.markup 169 + '</div>'; 170 document.write(s); 171 } else { 172 var n = document.createElement("div"); 173 n.id="-qt-version-test"; 174 n.style.cssText = "top:0;left:0;width:1px;height:1px;overflow:hidden;position:absolute;"; 175 dojo.body().appendChild(n); 176 n.innerHTML = o.markup; 177 } 178 179 function qtGetInfo(){ 180 var qt=document[o.id], n=dojo.byId("-qt-version-test"), v = [ 0, 0, 0 ]; 166 167 function qtInsert(){ 168 if(!dojo._initFired){ 169 var s='<div style="top:0;left:0;width:1px;height:1px;;overflow:hidden;position:absolute;" id="-qt-version-test">' 170 + o.markup 171 + '</div>'; 172 document.write(s); 173 } else { 174 var n = document.createElement("div"); 175 n.id="-qt-version-test"; 176 n.style.cssText = "top:0;left:0;width:1px;height:1px;overflow:hidden;position:absolute;"; 177 dojo.body().appendChild(n); 178 n.innerHTML = o.markup; 179 } 180 } 181 182 function qtGetInfo(mv){ 183 var qt, n, v = [ 0, 0, 0 ]; 184 if(mv){ 185 qt=mv, n=qt.parentNode; 186 } else { 187 qtInsert(); 188 if(!dojo.isOpera){ 189 setTimeout(function(){ qtGetInfo(document[o.id]); }, 50); 190 } else { 191 var fn=function(){ 192 setTimeout(function(){ qtGetInfo(document[o.id]) }, 50); 193 }; 194 if(!dojo._initFired){ 195 dojo.addOnLoad(fn); 196 } else { 197 dojo.connect(document[o.id], "onload", fn); 198 } 199 } 200 return; 201 } 202 181 203 if(qt){ 182 204 try { … … 196 218 } 197 219 198 // dojo.body().removeChild(n); 199 } 200 201 if(dojo.isOpera){ 202 setTimeout(qtGetInfo, 50); 203 } else { 204 qtGetInfo(); 205 } 206 } 207 208 if(dojo.isIE && installed){ 220 try { 221 if(!mv){ 222 dojo.body().removeChild(n); 223 } 224 } catch(e){ } 225 } 226 227 qtGetInfo(); 228 } 229 else if(dojo.isIE && installed){ 209 230 dojox.embed._quicktime.onInitialize(); 210 231 } … … 238 259 // Returns a reference to the HTMLObject/HTMLEmbed that is created to 239 260 // place the movie in the document. You can use this either with or 240 // without the new operator. Note that if the QuickTime engine isn't 241 // available yet, this will throw an Error. 261 // without the new operator. Note that with any other DOM manipulation, 262 // you must wait until the document is finished loading before trying 263 // to use this. 242 264 // 243 265 // example: … … 257 279 // | }, myWrapperNode); 258 280 259 if(dojox.embed._quicktime.initialized){ 260 return dojox.embed._quicktime.place(kwArgs, node); // HTMLObject 261 } 262 throw new Error("dojox.embed.Quicktime:: you must wait for the Quicktime engine to be initialized."); 281 return dojox.embed._quicktime.place(kwArgs, node); // HTMLObject 263 282 }; 264 283 })(); -
dojox/trunk/embed/tests/quicktime.html
r13276 r13701 11 11 dojo.require("dojox.embed.Quicktime"); 12 12 13 var v=dojox.embed._quicktime.version; 14 console.log("while loading: ", v); 15 16 dojo.addOnLoad(function(){ 13 function getVersion(){ 17 14 var v=dojox.embed._quicktime.version || { major: 0, minor: 0, rev: 0 }; 18 15 dojo.byId("results").innerHTML = v.major 19 16 + '.' + v.minor 20 17 + '.' + v.rev; 21 } );18 }; 22 19 </script> 23 20 </head> … … 27 24 This page is testing the base QuickTime movie generator. See the Firebug log for details. 28 25 </p> 29 < p>Note that at this time, version detection before load in Opera is not supported.</p>26 <input type="submit" value="Get Quicktime Version" onclick="getVersion()" /> 30 27 <p>Installed QuickTime version: <span id="results"></span></p> 31 28 </body>