Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Mod Requests => Topic started by: aj113 on December 04, 2016, 01:02:26 PM

Title: How to Play mp3 Attachment?
Post by: aj113 on December 04, 2016, 01:02:26 PM
I want to allow users not only to upload mp3 files to my music forum, but to play them directly from the post.

So:

1. Users can attach a file to a post.
2. Other users can play that file immediately from within the post itself, without having to leave the forum.

Is this possible? What's the best way of doing it?
Title: Re: How to Play mp3 Attachment?
Post by: Kindred on December 05, 2016, 07:10:24 PM
no, not really....

one of the gallery mods MIGHT allow that, but it's questionable, at best
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 06, 2016, 04:34:27 AM
Well that's a bit of a letdown. Hundreds of forums have this capability, I'm surprised it's not a stanard feature, let alone a mod.
Title: Re: How to Play mp3 Attachment?
Post by: Kindred on December 06, 2016, 06:59:44 AM
really? I am a user on hundreds of forums and don't think I have ever actually seen it, myself...
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 06, 2016, 07:05:03 AM
Are any of them music forums?

I guess this discussion is moot anyway. If the feature doesn't exist it doesn't exist.
Title: Re: How to Play mp3 Attachment?
Post by: Antes on December 06, 2016, 07:19:16 AM
We can move this topic to mod request board, so maybe an author come forward and offer a solution.
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 06, 2016, 07:29:03 AM
Sounds like a plan, thank you!
Title: Re: How to Play mp3 Attachment?
Post by: Colin on December 06, 2016, 02:09:30 PM
Definitely possible. I think this would be a useful mod.
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 06, 2016, 03:19:55 PM
Excellent! Do I need to place a request?
Title: Re: How to Play mp3 Attachment?
Post by: Colin on December 06, 2016, 04:16:13 PM
Quote from: aj113 on December 06, 2016, 03:19:55 PM
Excellent! Do I need to place a request?

Your post here is just that. Hopefully we have a taker who wants to create it. :). Thanks for the idea!
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 06, 2016, 04:19:01 PM
You're welcome, I mean, if it needs remuneration I'll certainly consider it.
Title: Re: How to Play mp3 Attachment?
Post by: dougiefresh on December 06, 2016, 09:42:06 PM
Looking for something like this?  I've got most of the new mod written, but I've still got to add the mime detection stuff to it yet....  It'll work on any HTML5 browser....
Title: Re: How to Play mp3 Attachment?
Post by: Colin on December 06, 2016, 09:52:38 PM
Boom ^ that was fast
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 06, 2016, 10:22:44 PM
Quote from: dougiefresh on December 06, 2016, 09:42:06 PM
Looking for something like this?  I've got most of the new mod written, but I've still got to add the mime detection stuff to it yet....  It'll work on any HTML5 browser....
That is exactly what I am looking for!
Title: Re: How to Play mp3 Attachment?
Post by: JeanpaulFX on December 07, 2016, 04:17:53 PM
HTML5 supports playing audio/video content by default.  Just use <audio> tag. but it supports only mp3, wav or ogg format.
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 07, 2016, 04:27:37 PM
As explained earlier, the requirement is for an attached file to be played within the post to which it is attached.
Title: Re: How to Play mp3 Attachment?
Post by: dougiefresh on December 07, 2016, 09:51:41 PM
Attached is a screenshot of the mod in action.  Here is the mod: Play Media Attachments (http://www.xptsp.com/board/index.php?topic=686.0)

If you want to donate/pay for the mod, then please donate to donate@xptsp.com using Paypal.  Thanks!
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 08, 2016, 03:03:24 AM
Thank you. The download link is not working for me.

Also, 'link to mod' goes to:


An Error Has Occurred!
Sorry but no mod was found
Title: Re: How to Play mp3 Attachment?
Post by: Shambles on December 08, 2016, 06:29:57 AM
The mod is there - it's just awaiting approval.
Title: Re: How to Play mp3 Attachment?
Post by: dougiefresh on December 08, 2016, 09:11:44 AM
Quote from: aj113 on December 08, 2016, 03:03:24 AM
Thank you. The download link is not working for me.
Working on this issue....  It should work now.

Yeah, I wish I could just submit a new mod and it be visible to all in the Customization Area immediately.....  The Customization Area doesn't work like that, though.  Putting it on my website (or attaching it) is the only way to "get around" that issue...
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 08, 2016, 10:15:10 AM
I've downloaded and installed the mod. It's not working for me, no player appears in the post after uploading a file. Do I need to do anything else when uploading an mp3?

http://hairymonsteraudio.co.uk/recordandrewind/index.php/topic,28.0.html
Title: Re: How to Play mp3 Attachment?
Post by: Antes on December 08, 2016, 10:47:55 AM
Quote from: dougiefresh on December 08, 2016, 09:11:44 AM
Quote from: aj113 on December 08, 2016, 03:03:24 AM
Thank you. The download link is not working for me.
Working on this issue....  It should work now.

Yeah, I wish I could just submit a new mod and it be visible to all in the Customization Area immediately.....  The Customization Area doesn't work like that, though.  Putting it on my website (or attaching it) is the only way to "get around" that issue...

That is something I don't like as well, that area should be open for everyone who wants to do a beta release/test on products (with use your own risk).
Title: Re: How to Play mp3 Attachment?
Post by: Kindred on December 08, 2016, 10:54:37 AM
given some of the errors we have found in mods over the years.... no, that would be a terrible idea.
Additionally, until/unless the customize site is completely redesigned, and it can be made celar that things are untested, users assume that anything on our site has been validated as "not dangerous"
Title: Re: How to Play mp3 Attachment?
Post by: dougiefresh on December 08, 2016, 05:10:26 PM
I know, but it's nice to dream.....  And I never said my mods never have errors :p
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 08, 2016, 05:40:19 PM
So...what happens now? Sorry, I'm new to this. Do I need to place another request for someone else to make one?
Title: Re: How to Play mp3 Attachment?
Post by: Dzonny on December 08, 2016, 05:45:55 PM
aj113, you already got a link to external forum where dougiefresh attached mod pack itself. Just follow the download button and you can download it.
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 08, 2016, 05:50:34 PM
I've done that already. Please see my post five above your own.  Is there a procedure for when a mod doesn't work? I'm just looking for guidance here.
Title: Re: How to Play mp3 Attachment?
Post by: Dzonny on December 08, 2016, 05:53:58 PM
Did you get any errors during the mod installation?
Mod works fine on my test forum though, are you sure that you tried to attached supported file formats though?

I can't see attachments on your forum, so the URL you posted isn't really helpful.
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 08, 2016, 06:03:18 PM
The first post in the topic has an mp3 file attached.
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 08, 2016, 06:07:02 PM
OK this is getting weird now. I have logged out of the forum and the attachment has disappeared. But if you read the post below the first one obviously that guy can see the attachment.

Edit:
OK so to see the attachment you have to be logged in as a member. That solves that issue, but it doesn't explain why the mod is not working.

Edit:
I enabled guests to view attachments. Now, not only can guests see attachments, but the mod works as described.

So to the author:

1. Thank you very much
2. I think there's maybe a slight bug since the mod doesn't work if guests are not enabled to view attachments.
Title: Re: How to Play mp3 Attachment?
Post by: Dzonny on December 08, 2016, 06:52:47 PM
^ cant reproduce that though, on my forum guests can't see attachments but mod still works just fine.
Title: Re: How to Play mp3 Attachment?
Post by: Colin on December 08, 2016, 06:53:26 PM
Perhaps a link to your forum would be helpful.
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 08, 2016, 07:03:49 PM
Quote from: Colin on December 08, 2016, 06:53:26 PM
Perhaps a link to your forum would be helpful.

Please see post #20

Another note to author:

Mod does not work when core theme is enabled.
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 08, 2016, 07:09:10 PM
Ah, I think the guest thing was a red herring. When I enabled guests to view attachments, I also changed to the SMF default Curve theme at the same time. It seems that this is the issue - the mod only works with the default theme.
Title: Re: How to Play mp3 Attachment?
Post by: dougiefresh on December 08, 2016, 08:33:07 PM
I've been at work since 10am (it's 7:30pm here).  I'm back and will look into the bug reports that have been given....

Regarding your bug reports, I will work on them, but I may need/request more information....
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 08, 2016, 08:52:35 PM
OK thank you. To save you some time, try changing your theme, that stops the mod from working for me.
Title: Re: How to Play mp3 Attachment?
Post by: dougiefresh on December 08, 2016, 09:30:22 PM
I just installed the mod on my localhost forum, with the Core theme checked during install.  (See attachment)  I was able to play the attached file(s) using the mod in the Core theme.

So my question is this: When you were installing the mod, did you check the Core theme before pressing Install Now?  If you didn't (and I strongly suspect you didn't), then that would be why the mod doesn't work on the Core theme for you.....

Also, if guests can't see attachments, they will not be able to play the attachments.  Perhaps something can be done to make that happen, but I doubt it.....  More investigation is required to answer that particular question, and that may not happen for a few days...
Title: Re: How to Play mp3 Attachment?
Post by: aj113 on December 09, 2016, 10:05:53 AM
You are correct on all counts, the mod is working fully now, sorry to have troubled you.
Title: Re: How to Play mp3 Attachment?
Post by: Steve on December 09, 2016, 02:22:25 PM
Brilliant awesome mod Dougie!
Title: Re: How to Play mp3 Attachment?
Post by: dougiefresh on December 09, 2016, 09:00:46 PM
@aj113:  I'm glad that it is working for you.  You haven't troubled me.  Thank you for the feedback....

@Steve:  Thanks!
Title: Re: How to Play mp3 Attachment?
Post by: Ghislain.Dejoie on December 26, 2016, 01:26:01 PM
The mod works fine with firefox but not with internet explorer and chrome?
Title: Re: How to Play mp3 Attachment?
Post by: Steve on December 26, 2016, 04:12:29 PM
Works fine for me in Chrome. I don't use IE.
Title: Re: How to Play mp3 Attachment?
Post by: Colin on December 26, 2016, 10:16:47 PM
Same, no issues in Chrome.
Title: Re: How to Play mp3 Attachment?
Post by: Ghislain.Dejoie on December 27, 2016, 04:17:33 AM
Ok, i look on every navigator :
work fine with Firefox

don't work with : (all latest version)
Chrome
Safari
IE 11
Edge
Title: Re: How to Play mp3 Attachment?
Post by: Steve on December 27, 2016, 07:14:46 PM
Again, two of us know it works fine on Chrome so there is something in your setup causing a problem. Are you trying it with a clean version of Chrome (no addons etc.)?
Title: Re: How to Play mp3 Attachment?
Post by: dougiefresh on December 27, 2016, 09:25:31 PM
Can you upload the song/file that you are trying to use with the mod and send me the link through PM?  I'd almost suggest attaching it to the post, but then remember that copyright infringement issues make that a dangerous suggestion....  O:)

I should also mention that the mod, like the HTML5 audio tag, only supports MP3, WAV and OGG files.
Title: Re: How to Play mp3 Attachment?
Post by: Ghislain.Dejoie on December 28, 2016, 03:38:45 AM
Hum hum, how to say?
I am ridiculous !
I did not see anything because I was not connected!
When connecting, the mod works perfectly with all browsers:
Firefox
Chrome
Safari
IE 11
Edge
Excuse me for losing you time!
Title: Re: How to Play mp3 Attachment?
Post by: dougiefresh on December 28, 2016, 09:06:56 AM
Good to hear!
Title: Re: How to Play mp3 Attachment?
Post by: Steve on December 28, 2016, 09:52:50 AM
Quote from: Ghislain.Dejoie on December 28, 2016, 03:38:45 AMExcuse me for losing you time!

It's never a waste of time to have a problem solved, no matter how simple. Believe me, we've all made those kind of mistakes. :)
Title: Re: How to Play mp3 Attachment?
Post by: dougiefresh on January 03, 2017, 09:24:05 AM
Play Media Attachment (http://custom.simplemachines.org/mods/index.php?mod=4131) mod has been approved!
Title: Re: How to Play mp3 Attachment?
Post by: Ghislain.Dejoie on January 04, 2017, 05:46:38 AM
Hello,
It's still "the hindrance to turn in circles!"
I note a concern:
I am connected, I attach an MP3 file to a subject and I click on "Submit"
The subject is published, the file is attached BUT the reading bar does not appear!
I leave the subject published.
I uninstall the Mod (without erasing it)
I reinstall the Mod AND the playbar appears!
Bizarre
Title: Re: How to Play mp3 Attachment?
Post by: dougiefresh on January 04, 2017, 08:59:29 AM
Since the mod has been approved, I will not be answered questions about it in this thread.  Please use the Play Media Attachment (http://www.simplemachines.org/community/index.php?topic=550923.0) thread for bug reports!  Thank you!