Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba

MP3 / Audio management


Go to End


6 Posts   1254 Views

Avatar
CHD

Community Member, 219 Posts

16 September 2010 at 4:09am

Hi guys,

couple of questions:

1) how do i enable "drag and drop re-ordering" on the MP3/ Audio tab of the CMS?
2) is it possible to read the file length and display it in the front end? I need a call that i can place in my .XML template...

any ideas?

thanks!

Avatar
UncleCheese

Forum Moderator, 4102 Posts

16 September 2010 at 4:37am

You can enable drag-and-drop by adding to your _config.php:

SortableDataObject::add_sortable_class('YourDataObject');

and run /dev/build

For the file size, you can use $FileObject.Size.

--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

Avatar
CHD

Community Member, 219 Posts

16 September 2010 at 4:39am

amazing. every time!

to clarify, will $FileObject.Size show the length of the audio? not the size in MB?

Avatar
CHD

Community Member, 219 Posts

16 September 2010 at 5:00am

hmmmm...

$FileObject.Size did nothing.
and $File.Size just shows the file size in MB :)

what should i try next?

P.S - the drag and drop worked like a dream!

Avatar
UncleCheese

Forum Moderator, 4102 Posts

16 September 2010 at 5:03am

Oh, no.. the length of the audio is not something that can be calculated by PHP. I don't even think ffmpeg can do that.

--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

Avatar
CHD

Community Member, 219 Posts

16 September 2010 at 5:07am

hmmmm... there must be a way?

otherwise how do all the other audio player in the world show play times? i dont think its done manually...
plus my player shows the play time next to the "slide bar" as in... 00:07 of 03:24

so its working it out somehow! lol i just want it to appear in the XML feed so that the player can show the time next to the track before you play it. see here: http://www.silentrepublic.com/listen/