Jump to:

7938 Posts in 1541 Topics by 945 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » MP3 / Audio management

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 896 Views
  • CHD
    Avatar
    Community Member
    218 Posts

    MP3 / Audio management Link to this post

    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!

  • UncleCheese
    Avatar
    4085 Posts

    Re: MP3 / Audio management Link to this post

    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

  • CHD
    Avatar
    Community Member
    218 Posts

    Re: MP3 / Audio management Link to this post

    amazing. every time!

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

  • CHD
    Avatar
    Community Member
    218 Posts

    Re: MP3 / Audio management Link to this post

    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!

  • UncleCheese
    Avatar
    4085 Posts

    Re: MP3 / Audio management Link to this post

    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

  • CHD
    Avatar
    Community Member
    218 Posts

    Re: MP3 / Audio management Link to this post

    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/

    896 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.