When using audio field and soundmanager2 player everything works fine when logged in, but after logging out the player stops working. On closer inspection firebug showed the following errors:

TypeError: window.Animator is undefined
TypeError: threeSixtyPlayer is undefined

Comparing the source of a logged in page vs a logged out page showed that the following javascript files where not included in the correct order:

/script/soundmanager2.js
/demo/360-player/script/360player.js

Still an issue on 7.x-1.0

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

evoltech’s picture

Status: Needs work » Needs review
FileSize
946 bytes
jucedogi’s picture

This didn't work for me on 7.x-1.0.
What actually worked was placing the line:

drupal_add_js($player_base_path . '/script/soundmanager2.js');

After the other drupal_add_js commands:
drupal_add_js($player_base_path . '/demo/360-player/script/berniecode-animator.js');
drupal_add_js($player_base_path . '/demo/360-player/script/360player.js');

So basically you end with at line ~250 of audiofield.players.inc:
drupal_add_js($player_base_path . '/demo/360-player/script/berniecode-animator.js');
drupal_add_js($player_base_path . '/demo/360-player/script/360player.js');
drupal_add_js($player_base_path . '/script/soundmanager2.js');

jucedogi’s picture

Version: 7.x-1.0-beta8 » 7.x-1.0
Issue summary: View changes
imonemus’s picture

I found that it was necessary to weight the 360player.js line to ensure that it is loaded after the berniecode-animator.js, i.e. so that they are loaded in the exact order they appear in the audiofield.players.inc file.

Mine works only if I have:

drupal_add_js($player_base_path . '/script/soundmanager2.js', array('weight' => 0));

//360 viewer
drupal_add_js($player_base_path . '/demo/360-player/script/berniecode-animator.js', array('weight' => 1));
drupal_add_js($player_base_path . '/demo/360-player/script/360player.js', array('weight' => 2));

Anyone agree? If so, I'll happily make a new patch.

Anonymous’s picture

Status: Needs review » Patch (to be ported)

Tested & patch ported.

Anonymous’s picture

Status: Patch (to be ported) » Fixed

Patch pushed to git.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

robert.kandzia’s picture

FileSize
807 bytes

I got this error on the version 7.x-1.2. You have to change the weight of JS file upload.