adriengibrat / jQuery-SoundManager

Use SoundManager2 with jQuery
67 stars 10 forks source link

Initialisation fails on safari in multi tab context #5

Closed lasconic closed 12 years ago

lasconic commented 12 years ago

How to reproduce:

Expected result : the demo should load successfully Actual result : the demo doesn't load

More info : when you switch on the tab here is the log : -- SoundManager 2 failed to load (security/load error) -- soundManager.disable(): Shutting down soundManager: Failed to initialise. soundManager: No Flash response within expected time. Likely causes: Flash blocked or JS-Flash security error. soundManager: Getting impatient, still waiting for Flash... soundManager::initMovie(): Waiting for ExternalInterface call from Flash.. soundManager::createMovie(): Trying to load /swf/soundmanager2_flash9_debug.swf -- SoundManager 2 V2.97a.20110801 (AS3/Flash 9) + HTML5 audio, MovieStar mode, normal polling -- -- SoundManager 2: HTML5 support tests (/^(probably|maybe)$/i): mp3: true (preferring flash), mp4: true (preferring flash), ogg: false (and no flash support), wav: true --

The log then quickly changes into : soundManager::init(): Already called? soundManager::init() soundManager::externalInterfaceOK() (~2 ms) -- SoundManager 2 failed to load (security/load error) -- soundManager.disable(): Shutting down soundManager: Failed to initialise. soundManager: No Flash response within expected time. Likely causes: Flash blocked or JS-Flash security error. soundManager: Getting impatient, still waiting for Flash... soundManager::initMovie(): Waiting for ExternalInterface call from Flash.. soundManager::createMovie(): Trying to load /swf/soundmanager2_flash9_debug.swf -- SoundManager 2 V2.97a.20110801 (AS3/Flash 9) + HTML5 audio, MovieStar mode, normal polling -- -- SoundManager 2: HTML5 support tests (/^(probably|maybe)$/i): mp3: true (preferring flash), mp4: true (preferring flash), ogg: false (and no flash support), wav: true --

adriengibrat commented 12 years ago

Thanks for the bug reporting

Same on Safari on Windows, but no pb with Chrome (webkit familly too).

Do you know a simple way to debug js on Safari?

Looks like a dom ready / load event not fired...

lasconic commented 12 years ago

Safari 5 has a web inspector similar to the one in Chrome, provided by WebKit I believe. To enable it, see http://developer.apple.com/library/safari/#documentation/AppleApplications/Conceptual/Safari_Developer_Guide/1Introduction/Introduction.html

adriengibrat commented 12 years ago

Thanks again for you report ;)

It seems to be resolved: I forced the useFlashBlockhttps://github.com/adriengibrat/jQuery-SoundManager/commit/980768683e077b8f3b78d5b3c3a67154cfebef26 setting to true, it's safer in most case... and openning page in background with safari does block flash until you have focus on the tab. The style is added when you focus on the tab, causing a strange "visual" effect, I'll try to solve that later.

lasconic commented 12 years ago

Merci ! I will test ASAP. We are currently using your plugin on http://musescore.com/sheetmusic so I may have some other bug reports. Thank you for your work and for the fast answer.

adriengibrat commented 12 years ago

Reaaly nice,

I like http://musescore.com/sheetmusic , great job!

Your bug reports are welcome anytime ;)

lasconic commented 12 years ago

It's fixed for me. I close the issue ! Thanks again.