问题
I'm trying to write a simple audio player for a website, and am using the EMBED... tag to embed the audio and setting HIDDEN="true" and using various javascript commands to control the audio playback. It works fine for realplayer and mplayer but the quicktime plugin doesn't respond to javascript if the hidden bit is set - is there any workaround for this?
回答1:
First, i suggest you to use the object
html tag which is standardized, embed
is not.
Then you could simply hide your embeded audio using CSS instead of this hidden
param.
Even better, you should hide it using CSS through JavaScript, because if you do it this way, people who don't have JavaScript enabled but support CSS are able use the plugin player directly.
回答2:
I found that setting height=0 width=0 worked the same as hidden=true and solved the problem
回答3:
Actually, the Quicktime plugin requires that at least a 12px squared area be shown, otherwise it will not load, and the JavaScript API will not be exposed. The area detection is done at short intervals, and if the visible area is ever reduced, the playback is stopped immediately. The plugin is extremely good at determining if it can actually be seen, you can't event cover it with other elements.
来源:https://stackoverflow.com/questions/71899/accessing-hidden-embedded-quicktime-audio