I open this issue to update the status and get feedback of the port to D7 of this module.

Currently, the main module is already ported.

TODO: use the new file and field api for sm2_plst_cck (it should be renamed, cck is now fieldAPI)

Discussion: use media module?

Comments

greg606’s picture

Title: Port soundmanager2 to Drupal 7 » Fatal error during enabling SoundManager 2 playlist File field formatter
Category: task » bug
Priority: Normal » Critical

Fatal error: Call to undefined function content_notify() in /var/www/leniwiec/sites/all/modules/soundmanager2/sm2_plst_cck/sm2_plst_cck.install on line 12

davebv’s picture

Only the soundmanager2 module is ported, the submodules does not work AT all, please be patient.
Anyway, thanks for reporting

davebv’s picture

Title: Fatal error during enabling SoundManager 2 playlist File field formatter » Port soundmanager2 to Drupal 7

By the way, please, do NOT change the issue title

davebv’s picture

Category: bug » task

I did not realized you changed everything about this "task"... this is not a bug, is a task, and the priority should be kept as normal. All the patches you may contribute are very welcome.

QW3RTy-1’s picture

Category: bug » task
Priority: Critical » Normal

Hi, thanks for your work !
i've just install sm2 module.. but i don't see it in cck displayfield ?? weird ^^
debug works ok
i also put this files "swftools_soundmanager2_adapted_26-10-2010" in sm2 module folder : is this the right place?
regards

QW3RTy-1’s picture

Category: task » bug

during uninstall :

Fatal error: Call to undefined function content_notify() in /homez.380/onchange/www/sites/all/modules/sound/soundmanager2/sm2_plst_cck/sm2_plst_cck.install on line 40

so i can't uninstall it ^^;)

davebv’s picture

This version does not work. After last time I upgraded the module I think d7 changed something on his api which makes this module break permissions and some other stuff.

I have not the time to port the module to D7, but any patches you provide will be tested.

m4olivei’s picture

Hey,

Would you accept a patch for Drupal 7 that cleaned all the code as a first step (adhering to Drupal coding standards)? Also, have you thought of using hook_library() for adding in the JS, and would you be alright with getting rid of the JS global variables?

If so, I have a project that needs soundmanager2 and I'd love to clean this module up a bit.

Thanks,
Matt

davebv’s picture

Oh, yes please. Feel free to contribute with any patches you would have done. If you post them I will add it for testing in the repository and commit them.

Thanks a lot for your effort.

m4olivei’s picture

StatusFileSize
new19.66 KB

Awesome! So here is a first patch toward cleaning up the module and finishing the implementation for Drupal 7. There are a number of changes in the patch, after applying the patch, run update.php to fix some variable names and also clear the cache and rebuild menus. Here is a list of changes so far:

  • Clean up the code according to Drupal coding standards
  • Remove references to audio module from the soundmanager2.module
  • Cleanup description text everywhere to uniformly refer to SoundManager 2 as "SoundManager 2"
  • Update hook_permissions() for Drupal 7
  • Clean up hook_requirements() to fix a couple display bugs
  • Cleaned up unsued or empty functions and old commented out code
  • Replaced use of ereg_replace with preg_replace (ereg_replace is decremented in PHP 5.3)
  • Added a hook_update_7200 function to update variable names to use underscores instead of dashes
  • Replaced hook_init() with hook_library() and adding in libraries where appropriate. This is so that the JS/CSS is only added where it is needed
  • Placed config setting under the Media category. They were not listed before when you went to admin/config.
  • Use form_set_value() in form validate hook instead of changing $form_state directly
  • Implement hook_field_formatter_info() and hook_field_formatter_view() to add the Page Player Formatter to File fields

At this point I have only worked on the main module and have only implemented a field formatter for the page player. I will finish the others over the coming week. You'll notice I put the field formatter definition in the main module. With file filed now in core, I didn't see the point in having those two hooks in their own module.

More to come, let me know if you have any questions, comments, concerns!

Thanks,
Matt

m4olivei’s picture

StatusFileSize
new158.66 KB

Hey,

Here is an updated patch, changes include:

  • Got rid of some dsm() calls I left in the last patch.
  • Deleted unused and unnecessary files and consolidated on a single module.
  • Added support for UI 360 player and Inline Player in their default configurations
  • Took the configuration JS files out of the libraries and instead added them via a theme function, making it easy for others to override the settings completely
  • Added a formatter setting for the UI 360 player to allow users to select inline or playlist display.
  • Don't show debug block if debug mode is off
  • Add in styles to show the debug window like SoundManager does on their demo site

The changes are pretty huge, but I think you'll see that its a much improved, easily extendable and overridable way to add SoundManager 2 to your Drupal site.

Let me know any feedback.

Thanks,
Matt

m4olivei’s picture

I should mention that the patch in #11 replaces the patch in #10.

davebv’s picture

Category: task » bug

Thank you for the patch.
I am trying to apply it but found errors concerning the image files (.gif).
The errors are:

error: cannot apply binary patch to 'players/ui360.png' without full index line
error: players/ui360.png: patch does not apply
error: cannot apply binary patch to 'players/ui360/360-button-pause-light.gif' without full index line
error: players/ui360/360-button-pause-light.gif: patch does not apply
error: cannot apply binary patch to 'players/ui360/360-button-pause-light.png' without full index line
error: players/ui360/360-button-pause-light.png: patch does not apply
error: cannot apply binary patch to 'players/ui360/360-button-pause.gif' without full index line
error: players/ui360/360-button-pause.gif: patch does not apply
error: cannot apply binary patch to 'players/ui360/360-button-pause.png' without full index line
error: players/ui360/360-button-pause.png: patch does not apply
error: cannot apply binary patch to 'players/ui360/360-button-play-light.gif' without full index line
error: players/ui360/360-button-play-light.gif: patch does not apply
error: cannot apply binary patch to 'players/ui360/360-button-play-light.png' without full index line
error: players/ui360/360-button-play-light.png: patch does not apply
error: cannot apply binary patch to 'players/ui360/360-button-play.gif' without full index line
error: players/ui360/360-button-play.gif: patch does not apply
error: cannot apply binary patch to 'players/ui360/360-button-play.png' without full index line
error: players/ui360/360-button-play.png: patch does not apply
error: cannot apply binary patch to 'players/ui360/empty.gif' without full index line
error: players/ui360/empty.gif: patch does not apply
error: cannot apply binary patch to 'players/ui360/icon_loading_dots.gif' without full index line
error: players/ui360/icon_loading_dots.gif: patch does not apply
error: cannot apply binary patch to 'players/ui360/icon_loading_spinner.gif' without full index line
error: players/ui360/icon_loading_spinner.gif: patch does not apply
error: cannot apply binary patch to 'players/ui360/icon_loading_spinner_bigger.gif' without full index line
error: players/ui360/icon_loading_spinner_bigger.gif: patch does not apply
error: cannot apply binary patch to 'players/ui360/icon_loading_spinner_bigger.gif.old' without full index line
error: players/ui360/icon_loading_spinner_bigger.gif.old: patch does not apply

I tried that against the latest 7.x-2.x.

davebv’s picture

by the way:
Thank you for the huge work!

m4olivei’s picture

Not sure why that patch didn't work .. I did remove a bunch of files that are no longer needed / weren't used. With commit access now, I just merged my local feature branch with the 7.x-2.x branch and pushed it to the server. Update to the latest on the 7.x-2.x branch to see the changes.

m4olivei’s picture

By the way thanks for the commit access, look forward to working on the project!

davebv’s picture

Thank you for your interest in the project and your work!

ldweeks’s picture

Glad to see some movement here! I'll take a look at your work for D7 when I get a chance and file issues. Thanks for your work!

ldweeks’s picture

Wow! I just had a chance to test this tonight, and I couldn't break anything. It even worked fine for what I need with views. Great work!

m4olivei’s picture

Awesome! Thanks for the feedback. There are a couple issues I am aware of, and when I get a moment I'll describe them in more detail (haven't had a chance to work on this in awhile). In the meantime, I've made the dev snapshot available on the project page so that more people can take a look.

ldweeks’s picture

Thanks for that! I was going to ask, but you beat me to it!

Anonymous’s picture

Hi all

I am testing and when i use the inline and the 360º player, which is great, my page stays bigger in height, without no chance to change, well i have to explore better css.

This case is with views

I will try without views and also with page-style

Great module

Best regards
ArchGalileu

www.gasparsantos.eu
www.quartetodouro.eu
www.cameratanovnorte.eu

RachelIsland’s picture

Hi,

Thanks for this great module.

I think I have the same problem as ArchGalileu : I have a 200 pixels of useless space in the bottom of my web page, after the footer, and I can't get rid of it.

http://promotionlovebirds.ca/publicit%C3%A9-audio

Using Firebug, I found out that it is

that seems to cause that space, but I couldn't find from where this div came from.

Thanks for the good work!

muschpusch’s picture

subscribe

carwin’s picture

The extra space is being caused by "#sm2-container"'s embed, which has a height of 100% on it. This comes from the js of SM2 itself I think. You can easily set #sm2-container{display:none;} or something similar to take care of it.

infines’s picture

This module shows the file name instead of the Node title. Will there be a fix for this?

andrew smith’s picture

"I think I have the same problem as ArchGalileu : I have a 200 pixels of useless space in the bottom of my web page, after the footer, and I can't get rid of it."

PLEASE - did you find a solution to this???????????????

Anonymous’s picture

Hi andrew smith

i could answer long time ago, so excuse me

add to you css, i advice you to install http://drupal.org/project/css_injector and add a rule with the css stuff because it will work even with updates.

The content:

/*
 * SoundManager 2 + useFlashBlock
 * Flash positioning and flashblock / clicktoflash handling
*/

#sm2-container {
 /*
  * where the SM2 flash movie goes. by default, relative container.
  * set relative or absolute here, and don't touch it later or bad things will happen (see below comments.)
 */
 position: absolute;
 width: 1px;
 height: 1px;
 overflow: hidden;
 /* screw IE 6, just make it display nice */
 _overflow: hidden;
}

#sm2-container object,
#sm2-container embed {
 /*
  * the actual SWF movie bit.
  * important: The SWF needs to be able to be moved off-screen without display: or position: changes.
  * changing display: or position: or overflow: here or on parent can cause SWF reload or other weird issues after unblock
  * e.g., SM2 starts but strange errors, no whileplaying() etc.
 */
 width: 48px;
 height: 48px;
 /* some flash blockers may also respect this rule */
 max-width: 48px;
 max-height: 48px;
}

#sm2-container.swf_timedout {
 /* expand to show the timed-out SWF content */
 position: relative;
 width: 48px;
 height: 48px;
}

#sm2-container.swf_timedout,
#sm2-container.swf_timedout object,
#sm2-container.swf_timedout embed {
 /* 
  * when SM2 didn't start normally, time-out case. flash blocked, missing SWF, no flash?
  * 48px square flash placeholder is typically used by blockers.
 */
 min-width: 48px;
 min-height: 48px;
}

#sm2-container.swf_unblocked {
 /* SWF unblocked, or was never blocked to begin with; try to collapse container as much as possible. */
 width: 1px;
 height: 1px;
}

#sm2-container.swf_loaded object,
#sm2-container.swf_loaded embed,
#sm2-container.swf_unblocked object,
#sm2-container.swf_unblocked embed {
 /* hide flash off-screen (relative to container) when it has loaded OK */
 left: -9999em;
 top: -9999em;
}

#sm2-container.swf_error {
 /* when there is a fatal error (flash loaded, but SM2 failed) */
 display: none;
}

#sm2-container.high_performance,
#sm2-container.high_performance.swf_timeout {
 /* "high performance" case: keep on-screen at all times */
 position: absolute;
 position: fixed;
}

#sm2-container.high_performance {
 overflow: hidden;
 _top: -9999px; /* IE 6 hax, no position:fixed */
 _left: -9999px;
 bottom: 0px;
 left: 0px;
 /*
  * special case: show at first with w/h, hide when unblocked.
  * might be bad/annoying.
  * try to stay within ClickToFlash "invisible" limits (so it won't be blocked.)
 */
 z-index: 99; /* try to stay on top */
}

#sm2-container.high_performance.swf_loaded,
#sm2-container.high_performance.swf_unblocked {
 z-index: auto;
}

#sm2-container.high_performance.swf_loaded,
#sm2-container.high_performance.swf_unblocked,
#sm2-container.high_performance.swf_unblocked object,
#sm2-container.high_performance.swf_unblocked embed {
 /*
  * 8x8px is required minimum to load in fx/win32 in some cases(?)
  * 6x6+ good for fast performance, even better when on-screen via position:fixed
  * also, clickToFlash (Safari <5.1) may auto-load "invisible" SWFs at this size
 */
 height: 8px;
 width: 8px;
}

#sm2-container.high_performance.swf_loaded {
 /* stay bottom/left */
 top: auto;
 bottom: 0px;
 left: 0px;
}

#sm2-container.high_performance.swf_loaded object,
#sm2-container.high_performance.swf_loaded embed,
#sm2-container.high_performance.swf_unblocked object,
#sm2-container.high_performance.swf_unblocked embed {
 /* high-performance case must stay on-screen */
 left: auto;
 top: auto;
}

#sm2-container.high_performance.swf_timedout {
 z-index: 99; /* try to stay on top */
}

Best regards
ArchGalileu

andrew smith’s picture

Thank you very much for responding - it worked for me and saved a LOT more time.

THANKS!

hugojoe’s picture

My Drupal6 site is hosted in Hostmonter where there is a file upload limitation 2MB. So I transfer 2MB+ audio files through ftp, then use them through module Swftools.
Now I'm configuring Drupal7 to deal with audio using module Media and SoundManager2 .
As the link below describes, it allows to upload files through browser then play(show) them:
http://blog.musicvm.com/install-and-configure-media-module-music-drupal-7 : module Media+SoundManager2

How could I use files 2MB+ transferred through ftp?

Best regards.
Hugo

andreas_jonsson’s picture

Are there any critical issues left that's blocking a beta version?
Running this on a clean d7 install and the latest soundmanager2 now with no major issues.

Solved the issue with the #sm2-container by adding a new css file with the following css, only targeting the injected container, which is placed one level deeper than the body tag in the dom. Using {display:none} mentioned in #25 caused sm2 to fail.

soundmanager2.css

body > #sm2-container {
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

Then adding a new css file containing the code above when using the page player.

soundmanager2.module, line 33

+      'css' => array(
+        $sm2_module_path . '/soundmanager2.css' => array(),
+      ),

An essential feature that's lacking is id3 support. It's being worked on in the getid3 module: "Merge getID3 with FileField Meta in Drupal 7" (http://drupal.org/node/780848)

**edit**
sm2-container height issue applies to all player types, not just page player. updated this post to reflect this.

infines’s picture

It doesn't seem to play nice with views 3 caching.

andreas_jonsson’s picture

gridbitlabs, can you elaborate? maybe open a separate issue for it too.

To answer my own question above, I consider this a release blocker: styles added in ui360 multiple times

swaroops1’s picture

Just put this in
.css file the problem will be solved..

#sm2-container {
height: 0;
overflow: hidden;
visibility: hidden;
}

swaroops1’s picture

Just put this in theme .css file the problem will be solved..

#sm2-container {
height: 0;
overflow: hidden;
visibility: hidden;
}

gagarine’s picture

davebv’s picture

What would be great is if anyone could integrate this with media module.

andyhawks’s picture

Status: Needs work » Needs review
StatusFileSize
new4.04 KB

@davebv - here's a first step to media module integration. this patch permits Soundmanager field handlers for Media type file fields and plays them as expected. hasn't been fully vetted but it's working for me so far. requires Media module.

andyhawks’s picture

patch in #38 committed to 7.x-2.x-dev

tr33m4n’s picture

@andyhawks, this patch works as needs be, but I was wondering, whether there's a way of better integrating it with a private filesystem setup? As in the player works fine, allowing media elements to be played, however you can right click and simply download the file... Which is not ideal. Or is this more of an issue with the Soundmanager2 library itself?

Cheers

andyhawks’s picture

@tr33m4n - yeah switching to a private file setup doesn't work yet with this patch. There are known issues with Media and private files as listed on the Media project page and http://drupal.org/project/issues/media?text=private&status=All. I'll be looking into solutions for this more next week; it's a top priority for a site I'm working on too.

andyhawks’s picture

Status: Needs review » Needs work
andyhawks’s picture

Assigned: davebv » andyhawks
Status: Needs work » Fixed

created beta release for 7.x-2.x.
moved comment #40 to #1877234: Private Files integration.

Status: Fixed » Closed (fixed)

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