Changeset 2255
- Timestamp:
- 07/06/07 01:38:34 (1 year ago)
- Files:
-
- 1 modified
-
trunk/plugins/media/jquery.media.js (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/media/jquery.media.js
r2074 r2255 9 9 * 10 10 * @author: M. Alsup 11 * @version: 0. 66 (6/08/2007)11 * @version: 0.70 (7/05/2007) 12 12 * @requires jQuery v1.1.2 or later 13 13 * … … 26 26 * Other: bmp, html, pdf, psd, qif, qtif, qti, tif, tiff, xaml 27 27 * 28 * Thanks to Mark Hicken for helping me debug this on Safari!28 * Thanks to Mark Hicken and Brent Pedersen for helping me debug this on the Mac! 29 29 */ 30 30 (function($) { … … 70 70 71 71 // post-conversion callback, passes original element, new div element and fully populated options 72 if (typeof f2 == 'function') f2(this, $div[0], o );72 if (typeof f2 == 'function') f2(this, $div[0], o, player.name); 73 73 break; 74 74 } … … 87 87 $.fn.mediabox = function(options, css) { 88 88 return this.click(function() { 89 if (typeof $.blockUI == 'undefined' || typeof $. fn.displayBox == 'undefined') {89 if (typeof $.blockUI == 'undefined' || typeof $.blockUI.version == 'undefined' || $.blockUI.version < 1.26) { 90 90 if (typeof $.fn.mediabox.warning != 'undefined') return this; // one warning is enough 91 91 $.fn.mediabox.warning = 1; 92 alert('The mediabox method requires blockUI v1.2 0or later.');92 alert('The mediabox method requires blockUI v1.26 or later.'); 93 93 return false; 94 94 } 95 var o, div=0, $e = $(this).clone();95 var o, p, div=0, $e = $(this).clone(); 96 96 $e.appendTo('body').hide().css({margin: 0}); 97 97 options = $.extend({}, options, { autoplay: 1 }); // force autoplay in box mode 98 $e.media(options, function(){}, function(origEl, newEl, opts ) {98 $e.media(options, function(){}, function(origEl, newEl, opts, player) { 99 99 div = newEl; 100 100 o = opts; 101 p = player; 101 102 }); 102 103 if (!div) return false; … … 117 118 $div.displayBox( { width: o.width, height: o.height }, function(el) { 118 119 // quirkiness; sometimes media doesn't stop when removed from the DOM (especially in IE) 119 $( el).find('object,embed').each(function() {120 $('object,embed', el).each(function() { 120 121 try { this.Stop(); } catch(e) {} // quicktime 121 122 try { this.DoStop(); } catch(e) {} // real 122 123 try { this.controls.stop(); } catch(e) {} // windows media player 123 124 }); 124 } );125 }, p == 'flash'); // <-- mac/ff workaround 125 126 return false; 126 127 }); … … 178 179 $.fn.media.defaults.players = { 179 180 flash: { 181 name: 'flash', 180 182 types: 'flv,mp3,swf', 181 183 oAttrs: { … … 190 192 }, 191 193 quicktime: { 194 name: 'quicktime', 192 195 types: 'aif,aiff,aac,au,bmp,gsm,mov,mid,midi,mpg,mpeg,mp4,m4a,psd,qt,qtif,qif,qti,snd,tif,tiff,wav,3g2,3gp', 193 196 oAttrs: { … … 200 203 }, 201 204 realplayer: { 205 name: 'real', 202 206 types: 'ra,ram,rm,rpm,rv,smi,smil', 203 207 autoplayAttr: 'autostart', … … 211 215 }, 212 216 winmedia: { 217 name: 'winmedia', 213 218 types: 'asf,avi,wma,wmv', 214 219 autoplayAttr: 'autostart', … … 225 230 // special cases 226 231 iframe: { 232 name: 'iframe', 227 233 types: 'html,pdf' 228 234 }, 229 235 silverlight: { 236 name: 'silverlight', 230 237 types: 'xaml' 231 238 }
