Skip to content

Commit

Permalink
Move temporary URL parameter switches into _dcLoaded(), timing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Schiller committed Jul 31, 2011
1 parent fcc5c1b commit 19d86a7
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 60 deletions.
12 changes: 6 additions & 6 deletions script/soundmanager2-jsmin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions script/soundmanager2-nodebug-jsmin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 26 additions & 26 deletions script/soundmanager2-nodebug.js
Expand Up @@ -220,31 +220,6 @@ function SoundManager(smURL, smID) {
}
}

/*
* Temporary feature: allow force of HTML5 via URL params: sm2-usehtml5audio=0 or 1
* Ditto for sm2-preferFlash, too.
*/
/*
(function(){
var a = 'sm2-usehtml5audio=', l = _wl.toLowerCase(), b = null,
a2 = 'sm2-preferflash=', b2 = null, hasCon = (typeof console !== 'undefined' && typeof console.log !== 'undefined');
if (l.indexOf(a) !== -1) {
b = (l.charAt(l.indexOf(a)+a.length) === '1');
if (hasCon) {
console.log((b?'Enabling ':'Disabling ')+'useHTML5Audio via URL parameter');
}
_s.useHTML5Audio = b;
}
if (l.indexOf(a2) !== -1) {
b2 = (l.charAt(l.indexOf(a2)+a2.length) === '1');
if (hasCon) {
console.log((b2?'Enabling ':'Disabling ')+'preferFlash via URL parameter');
}
_s.preferFlash = b2;
}
}());
*/

/*
* public soundManager API
*/
Expand Down Expand Up @@ -3053,7 +3028,7 @@ function SoundManager(smURL, smID) {
if (_s.useHTML5Audio && _s.hasHTML5) {
for (item in _s.audioFormats) {
if (_s.audioFormats.hasOwnProperty(item)) {
tests.push(item + ': ' + _s.html5[item] + (!_s.html5[item] && _hasFlash && _s.flash[item] ? ' (using flash)' : (_s.preferFlash && _s.flash[item] && _hasFlash ? ' (preferring flash)': (!_s.html5[item] ? ' (' + (_s.audioFormats[item].required ? 'required, ':'') + 'and no flash)' : ''))));
tests.push(item + ': ' + _s.html5[item] + (!_s.html5[item] && _hasFlash && _s.flash[item] ? ' (using flash)' : (_s.preferFlash && _s.flash[item] && _hasFlash ? ' (preferring flash)': (!_s.html5[item] ? ' (' + (_s.audioFormats[item].required ? 'required, ':'') + 'and no flash support)' : ''))));
}
}
//_s._wD('-- SoundManager 2: HTML5 support tests ('+_s.html5Test+'): '+tests.join(', ')+' --',1);
Expand Down Expand Up @@ -3124,6 +3099,31 @@ function SoundManager(smURL, smID) {
_didDCLoaded = true;
_initDebug();

/*
* Temporary feature: allow force of HTML5 via URL params: sm2-usehtml5audio=0 or 1
* Ditto for sm2-preferFlash, too.
*/
/*
(function(){
var a = 'sm2-usehtml5audio=', l = _wl.toLowerCase(), b = null,
a2 = 'sm2-preferflash=', b2 = null, hasCon = (typeof console !== 'undefined' && typeof console.log !== 'undefined');
if (l.indexOf(a) !== -1) {
b = (l.charAt(l.indexOf(a)+a.length) === '1');
if (hasCon) {
console.log((b?'Enabling ':'Disabling ')+'useHTML5Audio via URL parameter');
}
_s.useHTML5Audio = b;
}
if (l.indexOf(a2) !== -1) {
b2 = (l.charAt(l.indexOf(a2)+a2.length) === '1');
if (hasCon) {
console.log((b2?'Enabling ':'Disabling ')+'preferFlash via URL parameter');
}
_s.preferFlash = b2;
}
}());
*/

if (!_hasFlash && _s.hasHTML5) {
//_s._wD('SoundManager: No Flash detected'+(!_s.useHTML5Audio?', enabling HTML5.':'. Trying HTML5-only mode.'));
_s.useHTML5Audio = true;
Expand Down

0 comments on commit 19d86a7

Please sign in to comment.