Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit bd95f26

Browse files
committed
Fix soundManager load : do not check for registry.
1 parent 018ac27 commit bd95f26

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

core/src/plugins/editor.soundmanager/class.SMPlayer.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* The latest code can be found at <http://pyd.io/>.
1919
*/
2020
window.SM2_DEFER = true;
21-
if(!$$("html")[0].hasClassName("no-canvas") && !window.soundManager && pydio.Registry.findEditorById("editor.soundmanager")){
21+
if(!$$("html")[0].hasClassName("no-canvas") && !window.soundManager){
2222
var conn = new Connexion();
2323
conn._libUrl = (ajxpBootstrap.parameters.get('SERVER_PREFIX_URI')?ajxpBootstrap.parameters.get('SERVER_PREFIX_URI'):'')+'plugins/editor.soundmanager/sm/';
2424
conn.loadLibrary('360-player/script/berniecode-animator.js');
@@ -243,7 +243,16 @@ soundManager.setup({\n\
243243

244244
getPreview : function(ajxpNode, rich){
245245
if(!window.soundManager || !window.soundManager.enabled){
246-
return new Element('img', {src:resolveImageSource(ajxpNode.getIcon(),'/images/mimes/ICON_SIZE',64),align:"absmiddle"});
246+
if(console) console.log("Returning simple image, window.soundManager is not loaded");
247+
var simpleImage = new Element('img', {src:resolveImageSource(ajxpNode.getIcon(),'/images/mimes/ICON_SIZE',64),align:"absmiddle"});
248+
simpleImage.resizePreviewElement = function(element){
249+
simpleImage.setStyle({
250+
width:Math.min(64, element.width) + 'px',
251+
height:Math.min(64, element.height) + 'px'
252+
});
253+
};
254+
simpleImage.destroyElement = function(){};
255+
return simpleImage;
247256
}
248257
addVolumeButton();
249258
var url = ajxpBootstrap.parameters.get('ajxpServerAccess')+'&get_action=audio_proxy&file='+encodeURIComponent(base64_encode(ajxpNode.getPath()));

0 commit comments

Comments
 (0)