Permalink
Browse files

100% HTML5 mode by default: Now preferFlash: false is by default. Fir…

…efox does MP3 on Vista (and newer) via HTML5, and recently (via Firefox Aurora builds) on OS X - the last major hold-out.
  • Loading branch information...
scottschiller committed Nov 9, 2013
1 parent 7ddf289 commit 0bdbe93154367dd4c4227df7398bb6cfd557e073
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -385,8 +385,8 @@ if (window.is_home) {
}
soundManager.setup({
- // even if HTML5 supports MP3, prefer flash so the visualization features can be used.
- preferFlash: true,
+ // HTML5 by default.
+ preferFlash: false,
useFlashBlock: true,
useHighPerformance: true,
bgColor: '#ffffff',
@@ -516,7 +516,7 @@ if (window.is_home) {
for (item in s.audioFormats) {
if (s.audioFormats.hasOwnProperty(item)) {
needsFlash = (soundManager.filePattern.test('.' + item));
- items.push('<span class="' + (s.html5[item] ? 'true' : 'false') + (!s.html5[item] && needsFlash ? ' partial' : '') + '" title="' + (s.html5[item] ? 'Native HTML5 support found' : 'No HTML5 support found' + (needsFlash ? ', using Flash fallback' : ', no Flash support either')) + '">' + (s.html5[item] ? '&lt;' : '') + item + (s.html5[item] ? '&gt;' : '') + '</span>');
+ items.push('<span class="' + (s.html5[item] ? 'true' : 'false') + (!s.html5[item] && needsFlash ? ' partial' : '') + '" title="' + (s.html5[item] ? 'Native HTML5 support found' : 'No HTML5 support found' + (needsFlash ? ', using Flash fallback if present' : ', no Flash support either')) + '">' + (s.html5[item] ? '&lt;' : '') + item + (s.html5[item] ? '&gt;' : '') + '</span>');
}
}
View
@@ -30,9 +30,8 @@
// optional: version of SM2 flash audio API to use (8 or 9; default is 8 if omitted, OK for most use cases.)
// flashVersion: 9,
- // optional: use 100% HTML5 mode if available (based on required audio format support)
- // otherwise, Flash will be preferred and needed for MP3 + MP4 format playback, if those formats are 'required'
- // preferFlash: false
+ // optional: use Flash for MP3/MP4/AAC formats, even if HTML5 support present. useful if HTML5 is quirky.
+ // preferFlash: true
// use soundmanager2-nodebug-jsmin.js, or disable debug mode (enabled by default) after development/testing
// debugMode: false,
@@ -119,8 +118,6 @@ <h2 id="minimal">Template Code: Basic Version</h2>
&lt;script&gt;
soundManager.setup({
url: '<em><em>/path/to/swf-files/</em></em>',
- <span><span>// optional: use 100% HTML5 mode where available
- // <a href="../../doc/#soundmanager-preferflash" title="soundManager.preferFlash documentation" onclick="checkDomain()">preferFlash</a>: false,</span></span>
onready: function() {
var mySound = soundManager.createSound({
id: '<em><em>aSound</em></em>',
@@ -153,9 +150,6 @@ <h2 id="commented-template">Template Code: Commented Version</h2>
<span><span>// optional: version of SM2 flash audio API to use (8 or 9; default is 8 if omitted, OK for most use cases.)
// flashVersion: <em><em>9</em></em>,
- <span><span>// optional: use 100% HTML5 mode where available</span></span>
- <span><span>// <a href="../../doc/#soundmanager-preferflash" title="soundManager.preferFlash documentation" onclick="checkDomain()">preferFlash</a>: false,</span></span>
-
// use soundmanager2-nodebug-jsmin.js, <i>or</i> disable debug mode (enabled by default) after development/testing
// debugMode: <em><em>false</em></em>,
@@ -190,8 +184,7 @@ <h2 id="commented-template">Template Code: Commented Version</h2>
&lt;/script&gt;</code></pre>
<h2 id="html5-notes">HTML5 Support Notes</h2>
- <p>By default, SM2 presently prefers Flash for MP3 + MP4 playback even on clients that support it natively via HTML5 due to some inconsistencies between browsers. If you'd like to go for 100% HTML5 mode, include <code>preferFlash: false</code> in your <code>soundManager.setup()</code> call.</p>
- <p>Read up on <a href="../../doc/#soundmanager-usehtml5audio" onclick="checkDomain()">HTML5 audio support</a>, if you're feeling adventurous. iPad/iPhone and devices without flash installed will always use 100% HTML5 mode.</p>
+ <p>Read up on <a href="../../doc/#soundmanager-usehtml5audio" onclick="checkDomain()">HTML5 audio support</a>, if you're feeling adventurous. iPad/iPhone and devices without flash installed will always use 100% HTML5 mode. By default, SM2 will use 100% HTML5 mode where supported. If you want to override this, specify <code>preferFlash: true</code> and Flash will be used (if present) for playing MP3 and MP4 (AAC) formats.</p>
<h2 id="flashblock-handling">Handling flash blockers</h2>
<p>It's good to let users see the flash component of SM2, so those with flash blockers can unblock it and allow SM2 to start. For more info, see the <a href="../flashblock/" title="SoundManager 2 with Flash block handling" onclick="checkDomain()">Flashblock</a> example.</p>
View
@@ -463,7 +463,7 @@ <h3 id="soundmanager-setup">SoundManager Properties: soundManager.setup()</h3>
<li>
<div>useHTML5Audio: <em>true</em>,</div>
- <span>// use <a href="#soundmanager-usehtml5audio">HTML5 Audio()</a> where API is supported (most Safari, Chrome versions), Firefox (no MP3/MP4.) Ideally, transparent vs. Flash API where possible.</span>
+ <span>// use <a href="#soundmanager-usehtml5audio">HTML5 Audio()</a> where supported. Some browsers may not support "non-free" MP3/MP4/AAC codecs. Ideally, transparent vs. Flash API where possible.</span>
</li>
<li>
@@ -667,7 +667,7 @@ <h4 id="soundmanager-usehtml5audio">useHTML5Audio</h4>
<p>The SM2 API is effectively transparent, consistent whether using flash or HTML5 <code>Audio()</code> for sound playback behind the scenes. The HTML5 Audio API is roughly equivalent to the flash 8 feature set, minus ID3 tag support and a few other items. (Flash 9 features like waveform data etc. are not available in HTML5 mode.)</p>
<p>By default, "100% HTML5 mode" applies to Apple iPad 3.2+ (iPad version 1.0), iPhone / iOS 4.0+ devices and others without flash. In other cases, HTML5 support is tested and if MP3/MP4 aren't natively supported, flash will be used as a backup method of playing these "required" formats. (It is assumed MP3 playback is required by default, but this is user-configurable via <code><a href="#soundmanager-audioformats">soundManager.audioFormats</a></code>.) HTML5 may also enable support for additional formats such as OGG and WAV.</p>
- <p>In the case when HTML5 + Flash are present, Flash will presently get preference for MP3/MP4 because of SM2's default <code>preferFlash: true</code> setup option, as HTML5 audio is still buggy between browsers and platforms; where desired, you can use <code>soundManager.setup({ preferFlash: false })</code> and in some cases enjoy 100% HTML5 mode (eg., under Safari, IE 9 and Chrome.) For some browsers, Flash will be needed if support for formats like MP3 (not supported via HTML5 in Firefox) are "required."</p>
+ <p>On the desktop and other devices with flash support, SM2 will still try for 100% HTML5 mode by default. However, you can use <code>soundManager.setup({ preferFlash: true })</code> if you would like to have Flash play MP3 and MP4 (AAC) formats even when they are supported via HTML5.</p>
<h5>SoundManager 2 + useHTML5Audio: Init Process</h5>
@@ -681,13 +681,14 @@ <h5>"My browser does HTML5, why not MP3"?</h5>
<p>Despite best efforts, some browsers eg. Chrome on Windows may only return "maybe" for <code>Audio().canPlayType('audio/mpeg; codecs=mp3')</code> and variants; SoundManager 2 will presently assume a format is supported if a "probably" or "maybe" response is given. You can modify <code>html5Test</code> to be <code>/probably/i</code> if you want to be more strict, for example.</p>
- <p>Only Safari, IE 9 and Chrome (excluding Chromium?) support MP3 and MP4 formats. Other browsers have excluded them because MP3 and MP4 are not "free" formats. For these cases, flash is used as the fallback support for MP3/MP4 as needed. Additionally, if flash support is present, <code>soundManager.preferFlash</code> means that MP3/MP4 get flash by default as HTML5 is still a bit unstable and subject to bugs across many devices and OSes.</p>
+ <p>Safari, IE 9, and Chrome (excluding Chromium?) support the "non-free" MP3 and MP4 (including AAC) formats. Firefox, in some cases, does support the MP3 codec where the underlying OS has support for it. This includes Windows Vista (and newer), and as of November 2013, Firefox Aurora (development builds) also on OS X.</p>
+ <p>For the cases where MP3 is not supported via HTML5, flash is used as the fallback support for MP3/MP4 as needed. Additionally, if flash support is present, <code>soundManager.preferFlash</code> means that MP3/MP4 will be handled by flash even if HTML5 support is present for those formats.</p>
<h5>Additional HTML5 formats: OGG, WAV</h5>
- <p>WAVe (uncompressed audio) and OGG (a free/open-source alternative to MP3) are both supported in a majority of browsers via HTML5, so SoundManager 2 will also test for support for these formats. A flash fallback for these formats has not been implemented. Adobe have indicated they will support OGG audio and video (combined, the "WebM" format) in a future release of flash. As of July 2011, no official date has been set.</p>
+ <p>WAVe (uncompressed audio) and OGG (a free/open-source alternative to MP3) are both supported in a majority of browsers via HTML5, so SoundManager 2 will also test for support for these formats. A flash fallback for these formats has not been implemented. In 2011, Adobe suggested they would support OGG audio + video (combined, the "WebM" format) in a future release of flash. As of November 2013, this has yet to materialize.</p>
- <p>If you plan on serving OGG media to HTML5, you may need to make a few server configuration updates given the importance of MIME types and the use of certain HTTP headers when serving these files. See Mozilla's <a href="https://developer.mozilla.org/en/Configuring_servers_for_Ogg_media">Configuring Servers For Ogg Media</a> for more.</p>
+ <p>You may need to make a few server configuration updates given the importance of MIME types and the use of certain HTTP headers when serving audio to HTML5 clients. See <a href="../doc/technotes/#client-requests">Client Requests</a> for more.</p>
<p>HTML5 is not limited to OGG and WAV, of course, as the system is designed to be extensible. Support for other formats may exist, depending on what built-in support exists, and plug-ins or codecs the user has installed on their system.</p>
Oops, something went wrong.

0 comments on commit 0bdbe93

Please sign in to comment.