| 6 |
$('.mp3player:not(.mp3player-processed)').each(function() { |
$('.mp3player:not(.mp3player-processed)').each(function() { |
| 7 |
var $thisPlayer = $(this); |
var $thisPlayer = $(this); |
| 8 |
var playerID = $thisPlayer.attr('id'); |
var playerID = $thisPlayer.attr('id'); |
| 9 |
|
var playerData = $thisPlayer.attr('data'); |
| 10 |
$thisPlayer.addClass('mp3player-processed'); |
$thisPlayer.addClass('mp3player-processed'); |
| 11 |
|
|
| 12 |
// Check variables so we dont get JS errors |
var playerSettings = new Array(); |
| 13 |
if (Drupal.settings.mp3player != undefined && AudioPlayer != undefined && Drupal.settings.mp3player[playerID] != undefined) { |
|
| 14 |
var playerValue = Drupal.settings.mp3player[playerID] |
var playerSettingParts = playerData.split("&"); |
| 15 |
var soundFileValue = playerValue.audio_url; |
|
| 16 |
|
for ( var i in playerSettingParts) { |
| 17 |
// Check for extras |
var parts = playerSettingParts[i].split("="); |
| 18 |
if (playerValue.extras != null) { |
playerSettings[parts[0]] = parts[1]; |
|
soundFileValue = soundFileValue + playerValue.extras; |
|
|
} |
|
|
|
|
|
// Create new player and add code |
|
|
var newPlayer = AudioPlayer.embed(playerID, { soundFile: soundFileValue }); |
|
| 19 |
} |
} |
| 20 |
|
|
| 21 |
|
// Create new player and add code |
| 22 |
|
var newPlayer = AudioPlayer.embed(playerID, playerSettings); |
| 23 |
}); |
}); |
| 24 |
} |
} |