Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This will enable HTML5 audio streaming with a Flash fallback for Firefox. This is for the D5 version of Audio, but I'm sure it could be modified for D6.
In your 1pixelout.inc file
$output = <<<EOT
<audio type="audio/mpeg" controls="controls" id="html5player" tabindex="0" preload="metadata">
<source src="$node->url_play"/>
</audio>
<div id="player_fallback"></div>
<script>
var flashvars = {};
flashvars = "$flashvars";
var params = {};
params.movie = "$url";
params.wmode = "transparent";
params.menu = "false";
params.quality = "high";
params.Flashvars = "$flashvars";
if (document.createElement('audio').canPlayType) {
if (!document.createElement('audio').canPlayType('audio/mpeg')) {
swfobject.embedSWF(
"/modules/audio/players/1pixelout.swf",
"player_fallback",
"700",
"24",
"9.0.0",
false,
flashvars,
params);
}
}
</script>
EOT;
return $output;
}
Comments
Comment #1
wylbur CreditAttribution: wylbur commentedWe're working on a Drupal 6 site that uses Audio. Here's simple code to use the HTML5 audio tag within the 1pixelout player. By embedding the flash code within the audio tag, it degrades automatically. Browsers with HTML5 support play HTML5, while other browsers will see the flash code. I did not add support for browsers without HTML5 or flash support.
Comment #2
djsilverfox CreditAttribution: djsilverfox commentedHi, this looks like it helps my issue, but as a non programmer where do I put this code please ?
Comment #3
rschletty CreditAttribution: rschletty as a volunteer commentedAha! This worked for me on my Drupal 6 site. I use SoundManager2 for my Audio pages. I used the above code in place of the existing $output code (lines 75-87) in the file sm2_audio.module (located in the folder sm2_audio within the soundmanager2 module.
Here is the result: http://www.topcatholicsongs.com/stronger-with-love
EDIT: Just discovered that the "Download audio file" text link (at the bottom of post) also plays the song (with timecode in text) rather than download the file! This is not good. Solution, anyone?
Comment #4
karnac CreditAttribution: karnac commentedComment #5
wylbur CreditAttribution: wylbur as a volunteer commentedComment #6
apadernoDrupal 6 is not supported anymore. That is why issues for a Drupal 6 version of a module are closed as outdated. In this case, the project doesn't have any version for Drupal 7; this feature request is not relevant for a Drupal 7 version, since it doesn't exist.