Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: dougiefresh on December 30, 2016, 11:43:52 PM

Title: Play Media Attachments
Post by: dougiefresh on December 30, 2016, 11:43:52 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=4131)


PLAY MEDIA ATTACHMENTS v2.6
By Dougiefresh (http://www.simplemachines.org/community/index.php?action=profile;u=253913) -> Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=4131)


Introduction
This mod allows MP3, WAV, WMA, AAC, and audio OGG files that has been attached to a post to be played without manually downloading the attachment using the HTML5 audio tag.

This mod also allows a MP4, M4A, M4V, WebM, WMV, MOV, and video OGG files that has been attached to a post to be played without manually downloading the attachment using the HTML5 video tag.

Note: OGG format files are assumed to be video if the extension is OGV.  Detection has yet to be improved upon for determining the difference between audio and video OGG-formatted files.

Admin Settings
In Admin -> Forum -> Attachments and Avatars -> Attachment Settings, there are two new options:
o Width of Audio Player element
o Width of Video Player element

Inspiration & Credit
The Javascript code used was copied and adapted from this webpage: JavaScript spoiler with a twist (collapsing up or down) (http://mxii.eu.org/2017/09/07/javascript-spoiler-with-a-twist-collapsing-up-or-down/)

Compatibility Notes
This mod was tested on SMF 2.0.14, but should work on SMF 2.0 and up, as well as SMF 2.1 RC2.  SMF 2.1 RC1 and before, as well as SMF 1.x will not be supported.

PM Attachments (http://custom.simplemachines.org/mods/index.php?mod=1974) should be installed before this mod (not required).  Only PM Attachments mod version 2.1 and above are supported!

Changelog
The changelog can be viewed at XPtsp.com (http://www.xptsp.com/board/free-modifications/play-media-attachments/?tab=1).

License
Copyright (c) 2016 - 2019, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Title: Re: Play Media Attachments
Post by: dougiefresh on December 31, 2016, 10:39:19 AM
Uploaded v1.1 - December 31st, 2016
o Changed text string in the <audio> tag to localizable string.
o Added support for SMF 2.1 Beta 2.
Title: Re: Play Media Attachments
Post by: Steve on January 03, 2017, 07:03:04 PM
Still working beautifully. :D
Title: Re: Play Media Attachments
Post by: dougiefresh on January 04, 2017, 09:05:23 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
Obviously, the mime type didn't get put into the database properly.  I'll look into this bug report!
Title: Re: Play Media Attachments
Post by: dougiefresh on January 04, 2017, 09:38:14 AM
Uploaded v1.2 - January 4th, 2016
o Changed code so that audio/video MIME detection takes place if no MIME type detected.
Title: Re: Play Media Attachments
Post by: Steve on January 04, 2017, 10:09:52 AM
Hmm ... can't seem to get this to work for some reason now ... attaching an mp3 just shows it as an attachment with no player.
Title: Re: Play Media Attachments
Post by: Ghislain.Dejoie on January 04, 2017, 10:45:18 AM
Hello,
Result of the implementation of version 1.2:
I did my tests on 5 browsers and it works!
I have allowed single visitors to view attachments, and it also works
THANK YOU
Title: Re: Play Media Attachments
Post by: dougiefresh on January 06, 2017, 06:33:05 PM
@Steve: Can't reproduce your bug report about the MP3 file.  Can you upload the file somewhere (not here) and PM me with the link to it?  Thanks!

@Ghislain.Dejoie:  Thank you for your feedback!
Title: Re: Play Media Attachments
Post by: Steve on January 07, 2017, 09:55:35 AM
After your request I checked and other mp3's work fine so it's something about the particular one I'm trying to use. Where's a good place to upload it?
Title: Re: Play Media Attachments
Post by: dougiefresh on January 07, 2017, 02:42:44 PM
Dropbox, 4shared, or similar services would work.  Just Google file sharing services and pick one....
Title: Re: Play Media Attachments
Post by: Steve on January 07, 2017, 03:26:48 PM
PM sent.
Title: Re: Play Media Attachments
Post by: dougiefresh on January 07, 2017, 08:54:32 PM
Uploaded v1.3 - January 7th, 2017
o Fixed MIME detection for MP3 files.



@Steve:  This update should address the issue, as the magic byte detection was incorrect for MP3 files.  Thank you for the bug report!
Title: Re: Play Media Attachments
Post by: Steve on January 07, 2017, 09:04:52 PM
@Steve:  This update should address the issue ... Thank you for the bug report!

Works great now! Thanks Dougie!
Title: Re: Play Media Attachments
Post by: Dave J on February 21, 2017, 07:57:32 AM
Hi Dougie,

Unfortunately after I install this mod I get the errors below.

I'm using SMF 2.0.13. I am using a custom theme but I don't think that would that cause the Display errors.

There are no errors prior to the mod install and none once it's been removed.

Any ideas?
Title: Re: Play Media Attachments
Post by: dougiefresh on February 21, 2017, 09:45:08 AM
Uploaded v1.4 - February 21st, 2017
o Fixed invalid array index error in Sources/Display.php.



@davejo:  This update should take care of the undefined array index errors you saw.  Thank you for the bug report!
Title: Re: Play Media Attachments
Post by: Dave J on February 21, 2017, 11:52:39 AM
Thanks Dougie, I will let you know how I get on tomorrow (Wednesday)
Title: Re: Play Media Attachments
Post by: Dave J on February 22, 2017, 04:47:03 AM
Uploaded v1.4 - February 21st, 2017
o Fixed invalid array index error in Sources/Display.php.



@davejo:  This update should take care of the undefined array index errors you saw.  Thank you for the bug report!

Yep it works a treat Dougie, thanks very much for the quick reply and fix it's much appreciated.
Title: Re: Play Media Attachments
Post by: ircsiinci on February 22, 2017, 05:23:16 AM
Dougiefresh Hi!

Unfortunately for me it does not work.
I'm using SMF 2.0.13

To ask for help.

Thanks in advance.

Otherwise, great job, thank you., :)

Have a nice day!
Title: Re: Play Media Attachments
Post by: Steve on February 22, 2017, 10:49:55 AM
What does not work? What is it not doing?
Title: Re: Play Media Attachments
Post by: dougiefresh on February 22, 2017, 09:16:45 PM
Dougiefresh Hi!

Unfortunately for me it does not work.
I'm using SMF 2.0.13

To ask for help.

Thanks in advance.

Otherwise, great job, thank you., :)

Have a nice day!
If you are thinking that the mod is supposed to automatically play the attachment, then you are mistaken.  Is that the issue?

EDIT:  Or does the audio player not play the audio file you attached?  If this is the case, you should upload the file somewhere (not here, potential copyright issues) and PM me the link to the file, so that I can see what the issue is with the file.....

Without more information, attempting to reproduce this bug report is damn near impossible.....
Title: Re: Play Media Attachments
Post by: ircsiinci on February 23, 2017, 03:08:59 AM
Dougiefresh Hi!

I found the error.
I'm sorry, forgiveness and thousands of inattention measured.   :(  :'(
Opera36.0.2130.80 I'm using and did not work.
For Firefox works fine Attachments Media Play.

Perhaps there is an Opera browser which you work?

Have a nice day!
Title: Re: Play Media Attachments
Post by: dougiefresh on February 23, 2017, 09:17:47 AM
Uploaded v1.5 - February 23rd, 2017
o Added fallback audio player as an embed to the mod.



@ircsiinci:   I've added a fallback audio player to the mod, but you may have to download a plug-in in order to use it if the HTML5 code doesn't work for you.  The HTML5 AUDIO tag not working in Opera (http://stackoverflow.com/questions/23961534/html5-audio-tag-not-working-in-opera) topic over at StackOverflow states this:
Quote
Opera does NOT support 320Kbps / 48kHz audio formats.

Opera only works with 192x44, 128x44 and 48x22 OGG subformats.
Personally, I use Firefox to develop all of my mods.  I check other browsers only if issues are found and reported by other users.....
Title: Re: Play Media Attachments
Post by: ircsiinci on February 23, 2017, 01:33:40 PM
Hello dougiefresh!

Thank you for your trouble.
Title: Re: Play Media Attachments
Post by: Kinsman on February 26, 2017, 01:34:55 AM
Unsure if others have this problem but I uninstalled this, as it stopped my forum generating thumbnails of attachments.
Title: Re: Play Media Attachments
Post by: dougiefresh on February 26, 2017, 08:13:17 PM
Unsure if others have this problem but I uninstalled this, as it stopped my forum generating thumbnails of attachments.
Will look into this bug report!  Thank you for reporting it!
Title: Re: Play Media Attachments
Post by: musicus on February 28, 2017, 04:45:34 AM
Works fine!!!

But for the next version, perhaps the possibility of using tracks from other pages, e.g. Wordpress.
Title: Re: Play Media Attachments
Post by: dougiefresh on February 28, 2017, 10:16:31 AM
Unsure if others have this problem but I uninstalled this, as it stopped my forum generating thumbnails of attachments.
I just tested this mod on a clean SMF 2.0.13 localhost forum, and attached an image to a post after attaching a mp3 to another post.  It did generate the thumbnail of the 1600x1000 PNG file that I attached to the post.

But for the next version, perhaps the possibility of using tracks from other pages, e.g. Wordpress.
This mod only makes attachments that are audio/music files into playable files through the forum.  Unless the files were stored in the SMF database and processed in similar ways, I would not be able to do the same thing for other pages, nor could I pull tracks from other pages with the code that I have.
Title: Re: Play Media Attachments
Post by: musicus on March 01, 2017, 06:36:47 AM
Pity, but is there a player, via html5 player, which plays MP3s over other sides?
I do not want to install a Flashplayer anymore. Flash has a very bad security.
Title: Re: Play Media Attachments
Post by: dougiefresh on March 01, 2017, 09:25:51 AM
Pity, but is there a player, via html5 player, which plays MP3s over other sides?
I do not want to install a Flashplayer anymore. Flash has a very bad security.
Look at the HTML5 Audio and Video BBCodes (http://custom.simplemachines.org/mods/index.php?mod=2819) mod.  It may be what you're looking for.
Title: Re: Play Media Attachments
Post by: dougiefresh on March 19, 2017, 11:26:15 AM
Uploaded v1.6 - March 19th, 2017
o Attempted thumbnail generation fix when no audio/video MIME type present.


Unsure if others have this problem but I uninstalled this, as it stopped my forum generating thumbnails of attachments.
I've attempted to fix this issue, but since I couldn't reproduce the bug, I'm guessing at what might be causing the issue.....
Title: Re: Play Media Attachments
Post by: Dave J on March 24, 2017, 08:12:57 AM
Dougie,

Just so you know this doesn't install on 2.1 beta 3. The only other mod I have installed on the test site is 'SCM Player for SMF'

regards

Dave

Title: Re: Play Media Attachments
Post by: dougiefresh on March 24, 2017, 08:59:28 AM
Just so you know this doesn't install on 2.1 beta 3. The only other mod I have installed on the test site is 'SCM Player for SMF'
2.1 Beta 3 isn't an official beta yet.  I define official as downloadable from this site, not GitHub.  Until it becomes one, I'm not supporting it.
Title: Re: Play Media Attachments
Post by: Arantor on March 24, 2017, 09:17:09 AM
Given that "beta 3" covers a year's worth or more of development, you can't really write a mod that targets beta 3 sanely.

-- someone that has a very complex beta 3 only mod on his GitHub.
Title: Re: Play Media Attachments
Post by: nofapturkiye on March 29, 2017, 05:09:09 AM
Quote
Introduction
This mod allows a MP3, WAV or OGG file that has been attached to a post to be played without manually downloading the attachment using the HTML5 audio tag.

Hello dougiefresh thanks for making our forums pretty  :)

i have question ;sometimes scm music player tries to download when we press lay button .( something about internet download manager.)
i wonder if this mod can fix that bug. what do you think?
Title: Re: Play Media Attachments
Post by: dougiefresh on March 29, 2017, 12:13:52 PM
i have question ;sometimes scm music player tries to download when we press lay button .( something about internet download manager.)
i wonder if this mod can fix that bug. what do you think?
In addition, the SCM Music Player mod is for site-wide music.  This mod only allows you to play music files that have been attached to a post.  So, no, I completely and very seriously doubt this mod will fix any issues found with that mod.....
Title: Re: Play Media Attachments
Post by: engrz on May 05, 2017, 12:43:15 AM
Please make this mod possible of playing of video attachments, like MP4, FLV file... small clips to be played without downloading.
Title: Re: Play Media Attachments
Post by: Arantor on May 05, 2017, 02:59:39 AM
That's primarily dependent on the browser having support, rather than anything else.
Title: Re: Play Media Attachments
Post by: engrz on May 05, 2017, 04:55:30 AM
That's primarily dependent on the browser having support, rather than anything else.

what kind of support? google chrome and firefox plays almost every video inside the browser.
Title: Re: Play Media Attachments
Post by: aegersz on June 17, 2017, 11:59:36 PM
damn, this conflicts with the "Post_and_PM_Inline_Attachments" mod, which i can't easily remove (doesn't install due to mods to Display.template.php).

i knew that too many mods will get me in this sort of trouble !

I made the code change manually but still only see the attachment - something is wrong with my system, i think ...

I did try it on another less modified clone and it worked there though.
Title: Re: Play Media Attachments
Post by: aegersz on June 18, 2017, 01:15:28 AM
I managed to trace it back to the "Images with Margins and Borders" mod so i uninstalled it also.

Then i installed your mod (which worked) ... then i reinstalled the "Post_and_PM_Inline_Attachments" mod and the install worked as far as Package Manager is concerned but the player didn't show up so those two mods cannot coexist.

If you get a moment, could you figure out why it installs but doesn't work ? There are no errors in the logs that could help, sorry.
Title: Re: Play Media Attachments
Post by: aegersz on July 06, 2017, 07:27:28 AM
oh yeah, i tried this on a VANILLA SMF system so you do have a logic conflict ...
Title: Re: Play Media Attachments
Post by: dougiefresh on July 06, 2017, 10:01:50 AM
I apologize for being away from the forum for so long.  Other projects, plus life itself, has conspired to keep me away....  Then my computer crashed, so I had to fix it, too.....  :(

Please make this mod possible of playing of video attachments, like MP4, FLV file... small clips to be played without downloading.
Yeah, I'll add support for playing small clips....

oh yeah, i tried this on a VANILLA SMF system so you do have a logic conflict ...
I've installed this mod on a clean 2.0.14 system and it works for me. 

I strongly suspect that the file-type detection isn't working correctly with this file.  Can you send me the media file in question, so that maybe I can figure out what is going on?  (Prefer via PM if possible, to avoid possibility of copyright infringement claim against the forum!)  Or maybe even a link to where it is being hosted on your forum?
Title: Re: Play Media Attachments
Post by: aegersz on July 06, 2017, 10:52:37 AM
no, i can't - it's on my home system.

the mod works fine BY ITSELF but not with the Post_and_PM_Inline_Attachments mod also on.

does it work for you with both on ?
Title: Re: Play Media Attachments
Post by: dougiefresh on July 06, 2017, 11:04:29 AM
Uploaded v1.7 - July 6th, 2017
o Added support for SMF 2.1 Beta 3.
o Removed support for SMF 2.1 Beta 2.
o Added admin setting to set the audio player width.



@aegersz: Honestly, I didn't check.  And I've got a few other mods to fix for SMF 2.1 Beta 3 compatibility before I can work on this particular bug report....
Title: Re: Play Media Attachments
Post by: dougiefresh on July 07, 2017, 02:44:49 PM
UPDATE:  I was trying to modify my Post and PM Inline Attachments (http://custom.simplemachines.org/mods/index.php?mod=3770) mod and discovered that SMF 2.1 Beta 3 intregrates a completely new approach to inserting attachments.  In the near future, I will be adding a 128x128 mp3 and video image, representing their respective file types, in order to better show what kind of file is attached in the posting UI.
Title: Re: Play Media Attachments
Post by: dougiefresh on July 08, 2017, 11:58:11 AM
Uploaded v1.8 - July 8th, 2017
o Fixed incorrect operation in Display.template.php.



@aegersz:  This update should fix the compatibility bug between this mod and the Post and PM Inline Attachments (http://custom.simplemachines.org/mods/index.php?mod=3770) mod.  Please note that the issue wasn't in this mod, so you will need to install the updated Post and PM Inline Attachments (http://custom.simplemachines.org/mods/index.php?mod=3770) mod (available in a few minutes from this post)....
Title: Re: Play Media Attachments
Post by: Steve on July 08, 2017, 05:07:41 PM
If the issue wasn't in this mod, why the update Dougie? Are both updates required to fix the compatibility bug?


Edit: just realized what you changed may have also fixed other issues.
Title: Re: Play Media Attachments
Post by: dougiefresh on July 08, 2017, 11:36:42 PM
If the issue wasn't in this mod, why the update Dougie? Are both updates required to fix the compatibility bug?
This update fixes an issue where one of the operations in the mod didn't install correctly....  Not sure whether it just became an issue with 2.0.14, or whether Post and PM Inline Attachments has to be installed for the bug to show up.  It was definitely noticable with the Post and PM Inline Attachments mod install, as this mod wouldn't install otherwise....
Title: Re: Play Media Attachments
Post by: BSD2000 on July 10, 2017, 07:40:24 AM
Does this support playing .wav files? If not, can it be modified to play too?
Title: Re: Play Media Attachments
Post by: Steve on July 10, 2017, 10:19:32 AM
Did you read the first post? It has an example link which shows it working for mp3, wav and ogg files. ;)
Title: Re: Play Media Attachments
Post by: aegersz on July 11, 2017, 08:25:53 AM
Uploaded v1.8 - July 8th, 2017
o Fixed incorrect operation in Display.template.php.



@aegersz:  This update should fix the compatibility bug between this mod and the Post and PM Inline Attachments (http://custom.simplemachines.org/mods/index.php?mod=3770) mod.  Please note that the issue wasn't in this mod, so you will need to install the updated Post and PM Inline Attachments (http://custom.simplemachines.org/mods/index.php?mod=3770) mod (available in a few minutes from this post)....

OK, after a bit of mucking around, removing and reinstallling mods, it works but not with any of my WAV files.

here is a link to a tiny one at my site: https://forum.drugs-and-users.org/index.php/topic,3780
Title: Re: Play Media Attachments
Post by: dougiefresh on July 11, 2017, 10:21:43 AM
Uploaded v1.9 - July 11th, 2017
o Fixed WAV audio file type detection code.



@aegersz:  Thanks for the bug report!  It was definitely an issue with the file type detection code, but not a problem I would have expected when I wrote the code....
Title: Re: Play Media Attachments
Post by: aegersz on July 11, 2017, 11:12:22 AM
it works well now EXCEPT the last two versions give a duplication effect (one with the download option ?) ... sorry to be a pain.
Title: Re: Play Media Attachments
Post by: dougiefresh on July 11, 2017, 11:35:52 AM
Please attach your Themes\default\Display.php file so that I can see what's going on....
Title: Re: Play Media Attachments
Post by: aegersz on July 11, 2017, 12:09:23 PM
do you mean /var/www/html/Sources/Display.php (the only file with that name) or /var/www/html/Themes/default/Display.template.php ? here is both:
Title: Re: Play Media Attachments
Post by: dougiefresh on July 11, 2017, 12:11:10 PM
 :o  Sorry, I meant Themes/default/Display.template.php, not Display.php.....   O:)  I suspect an operation was double-done for the template modification....
Title: Re: Play Media Attachments
Post by: aegersz on July 11, 2017, 12:11:41 PM
i gave you both, see above
Title: Re: Play Media Attachments
Post by: dougiefresh on August 02, 2017, 02:37:15 PM
@aegersz:  I'm sorry about the delay in responding....  I kinda forgot about this thread.  O:)

 I removed first of the two audio attachment additions (the first being from an older version) in Display.template.php file and have attached it to this post.  If you have modified that file, search for is_audio in that file and remove the first occurrance.
Title: Re: Play Media Attachments
Post by: dougiefresh on August 02, 2017, 03:54:12 PM
v1.10 - August 2nd, 2017
o Added code to display supported video clips stored as attachments.
o Added video width option to settings.
o Adjusted audio operation to use new audio width option.
o Added audio width option to settings.
Title: Re: Play Media Attachments
Post by: WishyWash on September 01, 2017, 05:29:54 PM
Hi dougiefresh, I've just installed version 1.10 of your mod. After attaching an MP3 file to a post, the player appears as advertised. However, when I press play, nothing happens. No sound, counter is stuck at 0:00. I've tried Firefox, Safari and Chrome (no IE/Edge, I'm on a Mac). Any idea what could be wrong? Thank you!
Title: Re: Play Media Attachments
Post by: aegersz on September 01, 2017, 08:46:52 PM
@aegersz:  I'm sorry about the delay in responding....  I kinda forgot about this thread.  O:)

 I removed first of the two audio attachment additions (the first being from an older version) in Display.template.php file and have attached it to this post.  If you have modified that file, search for is_audio in that file and remove the first occurrance.

sweet. will test it shortly.
Title: Re: Play Media Attachments
Post by: dougiefresh on September 02, 2017, 10:28:13 AM
@WishyWash:  Attach your file somewhere (not here - don't want SMF to deal with copyright claims) and PM me the link, that way I can see what is going on.
Title: Re: Play Media Attachments
Post by: WishyWash on September 02, 2017, 01:15:45 PM
Sent, thank you!

The track was purchased from the iTunes Store, then converted from AAC to MP3 using iTunes 12 (256 kBit/s VBR).
Would adding AAC support (m4a/m4p) to your mod be a possibility?
Title: Re: Play Media Attachments
Post by: Arantor on September 02, 2017, 01:34:39 PM
Do browsers even support AAC yet?
Title: Re: Play Media Attachments
Post by: dougiefresh on September 02, 2017, 02:03:01 PM
Browsers, by default, have zero support via HTML5 tags.  There is fallback ability for existing media types.....  But I'd have to look into it AAC files can be played via other means...

@WishyWash:. I'll look into it when I get some time.  I'm working 10 hour shifts today and tomorrow....
Title: Re: Play Media Attachments
Post by: Arantor on September 02, 2017, 02:06:26 PM
HTML5 assumes that you're the content creator and can easily transcode to provide different formats for different browsers.

I did a lot of research on this in 2014 for Levertine Gallery but in the end just provided a player that had a Silverlight and Flash fallbacks for everything - but things have changed since then... seems that support is much better now unless you're using Firefox: http://caniuse.com/#feat=aac
Title: Re: Play Media Attachments
Post by: WishyWash on September 02, 2017, 05:12:20 PM
@WishyWash:. I'll look into it when I get some time.  I'm working 10 hour shifts today and tomorrow....

Many thanks, dougiefresh! There's no hurry.
Title: Re: Play Media Attachments
Post by: dougiefresh on September 04, 2017, 10:32:41 AM
Uploaded v1.11 - September 4th, 2017
o Fixed HTML code that displays the attachment audio/video elements.
o Updated file signature detection code to catch M4A and M4V files.



@WishyWash:  I couldn't upload the file you sent via PM, but your MP3 file did play just fine in Media Player Classic.  So I tried uploading a MP3 file that I know works.  That file didn't play.  So I looked closely at the html code and found that the audio/video tags were messed up.  So I fixed it and my MP3 file worked just fine....   This update should resolve these issues...

As for supporting AAC files, I can't find anything on the file signature of AAC files.  It seems that most browsers can play AAC files, so I really need an original AAC file in order to try to support it correctly.  I haven't been able to find a free AAC file to test with....

EDIT:  Figured out that I needed to bump up the file upload limits on my localhost significantly in order to test that file.  Once I did so, the file uploaded just fine....  Also paid attention to the PM you sent regarding the file extension....

EDIT2:  Updated file signature detection code....
Title: Re: Play Media Attachments
Post by: Steve on September 06, 2017, 09:21:05 AM
Something seriously wrong dougie. Soon as I click 'Install' I get a white screen and had to restore from a backup.
Title: Re: Play Media Attachments
Post by: dougiefresh on September 06, 2017, 11:15:37 AM
Uploaded v1.11.1 - September 6th, 2017
o Fixed stupid typo in Subs-MediaAttachments.php.



@Steve:  Thanks for reporting the bug!  Evidently, I was on a roll with typos....  O:)
Title: Re: Play Media Attachments
Post by: Steve on September 06, 2017, 02:28:42 PM
Still something wrong dougie. Getting this error now:
Title: Re: Play Media Attachments
Post by: Juanchoartes on September 07, 2017, 03:01:02 PM
First of all, thank you very much for this great mod and for your work.

I am getting an error when I attach a jpg file to a post. It seems like the mod thought that the attached jpg file was a video file. I attached a capture of an example. The text in the capture says the following: "No video found that has a supported MIME format and type".

In Error log, appears the following:

8: Undefined index: attachmentVideoPlayerWidth
Archivo: /home/.../Themes/Exodus/Display.template.php (main sub template - eval?)
Línea: 554


By the way, in my local installation, is working fine.

My version is SMF 2.0.14
Theme: Exodus
I am using Firefox

I tried to uninstall and reinstalling the mod, but still not working fine.

Any idea of what is happening?

Thanks in advance.
Title: Re: Play Media Attachments
Post by: dougiefresh on September 07, 2017, 11:17:24 PM
@Juanchoartes:  You're welcome.  Regarding the MIME-detection issue you found, I need the file in question in order to determine what is wrong with my mod.  I'll also fix the undefined index error you found.

@Steve:  I've got a fix in place for the next version.  Waiting on Juanchoartes for the picture so that I can see what is going on....
Title: Re: Play Media Attachments
Post by: Juanchoartes on September 08, 2017, 04:39:05 AM
Hi dougiefresh

I attached to this post the file: Display.template.php

Thanks!
Title: Re: Play Media Attachments
Post by: dougiefresh on September 08, 2017, 10:03:22 AM
Sorry, I meant the JPG file that you are having an issue with, not the template file.  Thanks!
Title: Re: Play Media Attachments
Post by: Juanchoartes on September 08, 2017, 11:36:40 AM
Sorry. I have attached to this post the jpg file.
Title: Re: Play Media Attachments
Post by: dougiefresh on September 08, 2017, 05:04:48 PM
Okay, I've posted the image on my localhost forum with both mod version 1.11.1 and the unpublished 2.0.  Both posts came up as expected, not as any sort of video tags...

Before I tested the image you attached, I made a change to version 2.0 so that the file extension is also checked before attempting MIME detection on the image.  That alone may fix your issue, however, I can't reproduce the bug report you gave.....
Title: Re: Play Media Attachments
Post by: dougiefresh on September 08, 2017, 08:23:19 PM
Uploaded v2.0 - September 8th, 2017
o Added support for the PM Attachments mod.
o Fixed variable type-casting error in Subs-MediaAttachments.php.
o Added stuff to redetect MIME types in Attachment File Maintanence area.
o Added code to restrict additional MIME testing to audio/video files.



@Juanchoartes and @Steve:  Hopefully, this update fixes the issues both of you found!  Thanks for the bug reports!
Title: Re: Play Media Attachments
Post by: Juanchoartes on September 09, 2017, 07:34:19 AM
Hi @dougiefresh

Thank you very much.

Before installing the new version of your mod, I have downloaded the forum from my server and installed on my localhost (I did this because I wanted to work with exactly the same version of the forum and the database). I checked the post with the jpg attached to make sure that it was not working fine, and the same error appears, the video tag was there.

Then, I have uninstalled the mod and installed the new version. There was an error trying to write the file "PersonalMessage.template.php". I have attached a capture where you can see that error (by the way, "Añadir antes" means "Add before" and "Prueba fallida" means "Test failed". The forum is in Spanish).

Anyway, in spite of that error, I have installed the mod and it works perfect with jpg files. The video tag is gone.

But, when I tried to attach an mp3 file, the following error appears on my browser:

Fatal error: Call to undefined function PMA_mime_type() in C:\xampp\htdocs\foro_notiempo3\Sources\Subs-MediaAttachments.php on line 25

I am going to send you a private message with a link to download the mp3 file, in case that you want to test it in your local installation.

Title: Re: Play Media Attachments
Post by: dougiefresh on September 09, 2017, 10:28:59 AM
Uploaded v2.0.1 - September 9th, 2017
o Fixed another stupid typo in Subs-MediaAttachments.php.



@Juanchoartes:  OMG!!!  Another stupid typo!  :-[  Thanks for the report!  It's been fixed!
Title: Re: Play Media Attachments
Post by: Juanchoartes on September 09, 2017, 11:40:01 AM
Hi @dougiefresh

Before the installation, it appears again the error in the capture that I attached in my last post, about writing the file "PersonalMessage.template.php" of the theme.

After installing, appears the message you can see in the capture attached to this post.
("¡Un error ha ocurrido!" means "An error has occured!").
("Falla al enviar el formulario. La sesión ha expirado" means "Failed to submit form. The session has expired").

I don't know if those two errors or messages are important for the correct functioning of the mod, but it works perfect now. The video tag is gone and there is no error when I attached a mp3 file.

Great! Thank you very much for your work!  ;D
Title: Re: Play Media Attachments
Post by: aegersz on September 10, 2017, 01:42:12 AM
@dougiefresh - this is now working for me ... just the Automatic Attachment Rotation install conflict to sort out to get me back to where I was.

no code mods were required.
Title: Re: Play Media Attachments
Post by: aegersz on September 10, 2017, 01:44:23 AM
I also got a "your session has timed out" at the point where the Package Installer redirects you to the settings for the mod - but only on my test system !

weird.
Title: Re: Play Media Attachments
Post by: aegersz on September 10, 2017, 06:52:38 AM
sorry to be a pain in the arse but is there any support for .wma files ?
Title: Re: Play Media Attachments
Post by: dougiefresh on September 10, 2017, 04:12:13 PM
I've included mime detection for WMA and WMV files in the mod and fixed the mod installer so that the session expires message doesn't appear.  Please note that it does not promise that the browser will support them....  It'll be in the next release.... 
Title: Re: Play Media Attachments
Post by: Juanchoartes on September 11, 2017, 06:31:55 AM
Perfect. Thanks again!
Title: Re: Play Media Attachments
Post by: dougiefresh on September 11, 2017, 11:48:20 AM
Uploaded v2.1 - September 10th, 2017
o Fixed expired session error upon mod install.
o Added file signatures and mime types for WMA, WMV and AAC files.



@aegersz and @Juanchoartes:  Hopefully, this update addresses each of the issues you brought up, with exception of the Automatic Attachment Rotation install conflict, which literally has nothing to do with this mod....  O:)
Title: Re: Play Media Attachments
Post by: aegersz on September 11, 2017, 10:51:49 PM
sweet. sorry about the Image Rotation mod mention - I get derailed so easily.

thanks again !
Title: Re: Play Media Attachments
Post by: Juanchoartes on September 12, 2017, 11:54:42 AM
Hi @dougiefresh

Today I have tested the 2.0.1 version in my server (I had tested it some days ago in my local installation but not in the server) and the Video tag is still there! There is not Video tag in my local installation, but it appears in the remote installation. Is the same version of my forum, no changes.

I have uninstalled the 2.0.1 version of the mod and installed the 2.1 and the Video tag still appears. Any idea about what is happening?

By the way, the "expired session error" is gone, but instead, another error appears. I have attached to this post a screen capture with the error.

Title: Re: Play Media Attachments
Post by: Juanchoartes on September 14, 2017, 05:08:20 AM
Hello again

I have updated Mozilla Firefox to the last version (55.0.3) but that has not fixed the error of the video tag. I attached a capture of a post with two jpg images attached. The video tag appearance has changed, I guess is because the new version of Firefox.

In my local installation, the mod works fine, the video tag doesn't appear. But in my remote SMF installation, every time I attach a jpg file (or png), the video tag appears.

If anyone who is using this mod in a remote installation, had this problem and fixed it, please let me know. Maybe could be an issue with the hosting... I don't know.
Title: Re: Play Media Attachments
Post by: Steve on September 14, 2017, 10:07:01 AM
Or a conflict with another mod. What other mods do you have installed?
Title: Re: Play Media Attachments
Post by: dougiefresh on September 14, 2017, 11:10:09 AM
@Juanchoartes:  Please attach your Sources/Display.php so that I can see if there is anything I can see that might cause this conflict....
Title: Re: Play Media Attachments
Post by: Juanchoartes on September 14, 2017, 03:00:11 PM
Hi @Steve and @dougiefresh

Finally, I fixed.

The problem was a conflict with the "PDF Tag" mod (the only one mod that I have installed ). Thank you very much Steve. Your comment was very helpful!

If someone has the same problem, these are the steps I followed to fix the conflict with that mod:
Code: [Select]
// PDF [pdf]example.pdf[/pdf]
         array(
            'tag' => 'pdf',
            'type' => 'unparsed_content',
            'content' => ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'] ? '<object type="application/pdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" data="$1" width="800" height="600"><param name="src" value="$1"><embed src="$1" width="500" height="400" /><noembed><a href="$1" target="_blank">$1</a></noembed></object>' : '<embed type="application/pdf" src="$1" width="500" height="400" /><noembed><a href="$1" target="_blank">$1</a></noembed>'),
            'validate' => create_function('&$tag, &$data, $disabled', '
               if (isset($disabled[\'url\']))
                  $tag[\'content\'] = \'$1\';'),
            'disabled_content' => '<a href="$1" target="_blank">$1</a>',
         ),


That's all. Now works perfect!


Well, finally I fixed it. The mod is working great. Surely I should have tested earlier if some mod was causing some conflict but since I only had one installed, I did not realize. Sorry about that.

Thank you very much @dougiefresh and @Steve!  ;)
Title: Re: Play Media Attachments
Post by: dougiefresh on September 14, 2017, 03:44:57 PM
Weird.  I don't see a connection between the two, but I'm at work and haven't looked at that other mod,  either.  Good to know you solved your issue!

I can write an admin function to rescan all attachments to assign proper mime types.  The catch is that some "new" formats, like SVG, aren't likely to be detected correctly....
Title: Re: Play Media Attachments
Post by: Steve on September 14, 2017, 05:45:49 PM
No worries Juanchoartes. Thanks for letting dougie know what the problem was and your solution.
Title: Re: Play Media Attachments
Post by: Juanchoartes on September 15, 2017, 06:52:37 AM
I did a lot of test and right now I am not sure about it, but I am almost sure that in one of the tests I did in one of my local installations, the mod worked fine without uninstalling the mod "PDF Tag".

Anyway, the only thing that worked for me in my remote installation was to uninstall the mod "PDF Tag".

That admin function would be great although I would not need it because I did not have many attachments in the forum. I reattached the files manually.

Thank you @dougiefresh and thank you @Steve.
Title: Re: Play Media Attachments
Post by: dougiefresh on September 15, 2017, 01:33:28 PM
I did a lot of test and right now I am not sure about it, but I am almost sure that in one of the tests I did in one of my local installations, the mod worked fine without uninstalling the mod "PDF Tag".

Anyway, the only thing that worked for me in my remote installation was to uninstall the mod "PDF Tag".
I've had a chance to sit down and look at the PDF Tag mod.  What I don't understand is why you are having the issues you are, cause there is literally NOTHING there that I can see that would conflict and/or interfere with this mod....

That admin function would be great although I would not need it because I did not have many attachments in the forum. I reattached the files manually.
Okie-dokie....
Title: Re: Play Media Attachments
Post by: Juanchoartes on September 16, 2017, 10:16:07 AM
Hi @dougiefresh

The only thing that worked for me in my remote installation was to uninstall the "PDF Tag" mod and now "Play Media Attachments" works perfectly but maybe there is something that I have not considered, I don't know... I haven't made any changes in my remote installation that could fix the problem there was. Only uninstalling and deleting the "PDF Tag" mod.

Anyway, if there is any information I can look at my remote installation that could help you, let me know.
Title: Re: Play Media Attachments
Post by: Steve on September 17, 2017, 01:16:45 PM
Am getting an error anytime I play an attached file (the file plays) ... see attached.

Also attached is my display.template if you need it.
Title: Re: Play Media Attachments
Post by: Juanchoartes on September 18, 2017, 06:02:09 AM
Hi

I have noticed that in Firefox, the attached audio doesn't play well. The audio plays but the total duration of the audio doesn't appear and you can't go forward in the timeline. When the audio finishes, the following appears in the place where the audio duration was: "Infinity: NaN: NaN". I have attached an image with the explanation. In Chrome, the audio plays perfect and you can click in the timeline to move forward or backward.

I have been researching and it seems that this problem would be more related to Firefox. In this link they say something about that: https://stackoverflow.com/questions/6887867/html5-audio-video-tag-duration-on-firefox (https://stackoverflow.com/questions/6887867/html5-audio-video-tag-duration-on-firefox)

"Make sure that your server sets the content-length and content-range properties in his response-header." (which I haven't understood).

Any idea of why in Firefox the audio file is playing wrong?
Title: Re: Play Media Attachments
Post by: Arantor on September 18, 2017, 06:04:22 AM
Because this stuff is actually *hard* to get right.

SMF attachments never provide content-range out of the box, not 100% sure if this mod does it, because it's also hard to get right as ranged headers in general are the devils work. (For more information, take a look at LevGal which has a lot of code that might be useful to you)
Title: Re: Play Media Attachments
Post by: dougiefresh on September 18, 2017, 10:31:30 AM
OH MY GOD!!!   SERIOUSLY??!?!?!?   ARGHHH!!!

Okay, now that I got that out of my system, I can try to fix the mod using this new information.  I was completely unaware that I was missing anything in this regard.  Thanks, Juanchoartes and Arantor for providing the clues I needed to get this right.



@Arantor:  Nope, this mod does not provide content-range or content-length as a part of it's standard response.  SMF 2.0.x provides content-length, but only if either we're doing compressed output or the file size is greater than 4M....

EDIT:  Looks like SMF 2.1 Beta 3 is pretty similar to SMF 2.0.x in this regard.

@Juanchoartes:  I'll try to implement a fix for this issue.
Title: Re: Play Media Attachments
Post by: Steve on September 18, 2017, 10:48:07 AM
And the error I'm getting?
Title: Re: Play Media Attachments
Post by: dougiefresh on September 18, 2017, 11:09:22 AM
And the error I'm getting?
Whoops!  Sorry I missed that message!  I've fixed it for the next version.
Title: Re: Play Media Attachments
Post by: Juanchoartes on September 18, 2017, 11:34:09 AM
Thank you very much @dougiefresh!
Title: Re: Play Media Attachments
Post by: dougiefresh on September 22, 2017, 10:49:18 PM
UPDATE:  I've been trying to integrate code into the attachment download function in order to do ranged downloads and it is screwing up my test install (where it concerns media files)....  It is being a complete b#tch... 

Also, Levertine Gallery (http://levertine.com/products/levgal/) (which I assume is LevGal) is still live, but registering on the forum is disabled, purchasing is disabled (as if I had the money!), plus the ability to downloading it is non-existent....  So I'm at a loss on how to look at that project to see how it was done....  Frankly, from what little is available on their forum, that project might be dead and buried....

I've found a few more minor bugs and have fixed them for the next version.  I'll release the fixed version probably tomorrow, as I'm going to sleep now.
Title: Re: Play Media Attachments
Post by: lurkalot on September 23, 2017, 04:06:51 AM

Also, Levertine Gallery (http://levertine.com/products/levgal/) (which I assume is LevGal) is still live, but registering on the forum is disabled, purchasing is disabled (as if I had the money!), plus the ability to downloading it is non-existent....  So I'm at a loss on how to look at that project to see how it was done....  Frankly, from what little is available on their forum, that project might be dead and buried....


You will find a very generous post by Arantor right here, where you can pick up a copy of Levgal https://www.simplemachines.org/community/index.php?topic=525210.msg3921971#msg3921971
Title: Re: Play Media Attachments
Post by: dougiefresh on September 23, 2017, 09:59:18 AM
Holy sheep!  I missed that (although not suprised, since attachments don't show up on Yahoo search....)  Thanks a bunch, lurkalot!
Title: Re: Play Media Attachments
Post by: dougiefresh on December 08, 2017, 10:51:46 PM
Uploaded v2.2 - December 8th, 2017
o Fixed several undefined element/variable errors in the mod.
Title: Re: Play Media Attachments
Post by: Steve on December 09, 2017, 04:11:45 PM
Why when uninstalling the previous version do I get a test failed with 'ignore errors' in parenthesis? (see attachment)
Title: Re: Play Media Attachments
Post by: Rock Lee on December 13, 2017, 07:40:12 PM
I thought you had left the translation, I leave it attached although I have a question with the MIME itself, that's why I translated it to my opinion if something is wrong you let me know.


Regards!
Title: Re: Play Media Attachments
Post by: dougiefresh on December 15, 2017, 03:12:04 PM
Uploaded v2.3 - December 15th, 2017
o Added Spanish Latin translation, courtsey of Rock Lee (https://www.simplemachines.org/community/index.php?action=profile;u=322597)!
o Added missing add/remove hooks entry for proper mod uninstallation.



@Rock Lee:  Thank you for the translation!  It's been included in this version!
Title: Re: Play Media Attachments
Post by: Steve on December 15, 2017, 04:51:04 PM
So what do I do about the errors uninstalling the previous version? Ignore them or not?
Title: Re: Play Media Attachments
Post by: dougiefresh on December 15, 2017, 04:54:40 PM
@Steve:  Sorry for getting back to you so late.  The PersonalMessage.php file has a single operation, which I'm pretty sure is related to PM Attachments.  If you don't have that mod installed, then you can ignore the error.  If you do have it installed, then you need to fix the issue before uninstalling.  Is that the file you are having an issue with?  Your picture shows so much....  ::)
Title: Re: Play Media Attachments
Post by: Steve on December 15, 2017, 05:15:35 PM
Sorry about the image. I deserved that verbal spanking lol ...

I don't have PM Attachments installed but attached is the full width image.
Title: Re: Play Media Attachments
Post by: dougiefresh on December 15, 2017, 08:23:48 PM
@Steve: Verbal spanking...   O:)  I LOL'ed at that...   8) That operation is to properly support an installation with the PM attachment mods installed....


I have noticed that in Firefox, the attached audio doesn't play well. The audio plays but the total duration of the audio doesn't appear and you can't go forward in the timeline. When the audio finishes, the following appears in the place where the audio duration was: "Infinity: NaN: NaN". I have attached an image with the explanation. In Chrome, the audio plays perfect and you can click in the timeline to move forward or backward.

I have been researching and it seems that this problem would be more related to Firefox. In this link they say something about that: https://stackoverflow.com/questions/6887867/html5-audio-video-tag-duration-on-firefox (https://stackoverflow.com/questions/6887867/html5-audio-video-tag-duration-on-firefox)

"Make sure that your server sets the content-length and content-range properties in his response-header." (which I haven't understood).

Any idea of why in Firefox the audio file is playing wrong?
I've tried integrating the content-range and content-length and other range-related s#@t into the download code, without success.  I'm working on a seperate script to provide the video download; failing that, the attachment system will be modified to do direct downloads of the video file.  I hate doing that last one, though....  I at least have some control with a script....
Title: Re: Play Media Attachments
Post by: Steve on December 16, 2017, 01:42:31 PM
The mod works fine but the attached is what the player looks like after it's done playing the file.

Is that normal?
Title: Re: Play Media Attachments
Post by: Steve on December 18, 2017, 09:10:24 AM
Any chance you've looked at this Dougie?
Title: Re: Play Media Attachments
Post by: dougiefresh on December 18, 2017, 09:14:11 AM
When I run the mod in localhost, the video just stops at (what I assume is) the last frame of the video.  I'm using the attached video to test with....
Title: Re: Play Media Attachments
Post by: Steve on December 18, 2017, 10:57:24 AM
Okay ... that's bizarre. Tried your video and it worked fine so I was going to attach the audio file I had tested but I tried it again before I did and it worked fine.

So I guess whatever gremlin was messing with me left town. :P
Title: Re: Play Media Attachments
Post by: dougiefresh on April 29, 2018, 05:10:55 AM
Uploaded v2.4 - April 28th, 2018
o Added mime detection for QuickTime (.mov) movies.
o Added code fragment to exclude mime type from HTML when playing QT movies.
o Fixed conditional statement so that video embed tag works if needed.



@Everybody:  A request was made via PM to see if I could support mov (QuickTime movie) files.  I managed to get the mod to do so.  WORD OF WARNING:  I do not know if any browser plugins may be required for the video file to work properly...
Title: Re: Play Media Attachments
Post by: Drakkon on April 29, 2018, 11:38:31 PM
Thank you! I can confirm that it works with .mov files.

An issue I'm having is that the videos(mp4, mov) don't play when I visit the forum through my phone. I'm using an iPhone 8 plus.
Title: Re: Play Media Attachments
Post by: Drakkon on May 02, 2018, 09:06:02 PM
I've noticed that the videos don't play on mobile because it's linking to the attachment url instead of the actual file. Is there a way to fix this?
Title: Re: Play Media Attachments
Post by: dougiefresh on May 03, 2018, 09:55:46 AM
I'm looking into this....
Title: Re: Play Media Attachments
Post by: Drakkon on May 03, 2018, 09:44:12 PM
Thank you for all your hard work.
Title: Re: Play Media Attachments
Post by: Drakkon on May 22, 2018, 01:27:10 AM
Any progress?
Title: Re: Play Media Attachments
Post by: Steve on May 25, 2018, 08:33:19 AM
I have been trying to rest the last two weeks or so, as I have gotten exhausted trying to keep up with everything....
Title: Re: Play Media Attachments
Post by: aegersz on July 21, 2018, 12:38:45 PM
MINOR bug fix for 8: Undefined index: PMAt_no_audio

find:
Code: [Select]
, $txt['PMAt_no_audio'], '
change:
Code: [Select]
, $txt('PMAt_no_audio'), '
                                                                                       
repeat this for the video code also
Title: Re: Play Media Attachments
Post by: Arantor on July 21, 2018, 12:43:07 PM
Um... no, that's a REALLY bad idea.

Changing out the [] for () means trying to treat it as a function, and $txt isn't a function and doesn't contain a callable.

Better suggestion: actually define the language string in Modifications.english.php...
Title: Re: Play Media Attachments
Post by: aegersz on July 21, 2018, 02:14:56 PM
Ok, thanks - i assumed it was a function inserting a text sting ... so i decided to change it to:

Code: [Select]
', 'PMAt_no_audio' , 'and
Code: [Select]
', 'PMAt_no_video' , '
seems to work; FYI, the HTML <audio> and <video> tags are used like this:

Code: [Select]
<audio controls>
  <source src="horse.ogg" type="audio/ogg">
  Your browser does not support the audio tag.
</audio>

i am not sure what Modifications.english.php does yet ...
Title: Re: Play Media Attachments
Post by: Arantor on July 21, 2018, 02:19:13 PM
Um. Modifications.english.php is the home of all the language strings given by mods...
Title: Re: Play Media Attachments
Post by: aegersz on July 21, 2018, 02:22:53 PM
thank you ...
Title: Re: Play Media Attachments
Post by: dougiefresh on August 16, 2018, 10:41:09 PM
MINOR bug fix for 8: Undefined index: PMAt_no_audio

find:
Code: [Select]
, $txt['PMAt_no_audio'], '
change:
Code: [Select]
, $txt('PMAt_no_audio'), '
                                                                                       
repeat this for the video code also
I couldn't find any reference to PMAt_no_audio within any of the mod files.  Are you running the latest version?
Title: Re: Play Media Attachments
Post by: aegersz on August 18, 2018, 07:47:08 PM
i don't believe so but i was sure that it must've been in your code.

will do some digging when i recover from my huge night out.

thanks ... it's only a harmless little thing anyway.
Title: Re: Play Media Attachments
Post by: engrz on October 15, 2018, 02:57:24 AM
how to manually install this mod on any other theme than default? also is it compatible on mobile theme?
Title: Re: Play Media Attachments
Post by: dougiefresh on October 15, 2018, 12:04:07 PM
how to manually install this mod on any other theme than default? also is it compatible on mobile theme?
In order to manually install the mod on any other theme than the default theme, you would have to find where the appropriate place to insert the code.  Naturally, if the theme doesn't support attachments, then no, it is not compatible with that theme.  I would think it'd be compatible with mobile themes, but only actual use would reveal that little detail....
Title: Re: Play Media Attachments
Post by: engrz on October 16, 2018, 12:19:11 AM
how to manually install this mod on any other theme than default? also is it compatible on mobile theme?
In order to manually install the mod on any other theme than the default theme, you would have to find where the appropriate place to insert the code.  Naturally, if the theme doesn't support attachments, then no, it is not compatible with that theme.  I would think it'd be compatible with mobile themes, but only actual use would reveal that little detail....

My theme supports attachments (https://www.engrz.org (https://www.engrz.org)) but not support this mod to show player as attachment. if you can guide me where to place code for this mod to appear, i will be thankful to you.
Title: Re: Play Media Attachments
Post by: dougiefresh on October 16, 2018, 08:48:29 PM
Without knowing the name of the theme you are using (or if it is a complete or paid theme), it would be impossible for me to advise you on how to manually install the mod on your forum.  if it is a paid mod, I will probably need access to your form in order to either make change myself or advise on how to make changes.  if this is just a customized mod, I would need to know which one it is based on before I could advise.
Title: Re: Play Media Attachments
Post by: dougiefresh on October 23, 2018, 12:32:49 PM
Uploaded v2.5 - October 23rd, 2018
o No functionality change.
o Updated documentation to point to new website.
Title: Re: Play Media Attachments
Post by: mic1011 on January 06, 2019, 11:05:49 PM
Hello everyone,

I installed Play media Attachments(latest version)

The attachments work, but no player appears. I tested with standard .mp3 files.  I can download the attachments just fine, but no player on the default theme.

I tried with different themes but the attachments don't work at all with those.

Any ideas Doug or anyone?  Thanks so much for all the hard work i'm sure you have done on this. 
Title: Re: Play Media Attachments
Post by: dougiefresh on May 22, 2019, 09:23:49 PM
Uploaded v2.6 - May 22nd, 2019
o Added support for SMF 2.1 RC2.
o Removed support for SMF 2.1 Beta 3.



@mic1011:  I apologize for the long wait for an answer.  I don't know the answer to the question.  I will start looking into this bug report.  Thanks!
Title: Re: Play Media Attachments
Post by: shadav on September 08, 2019, 05:45:33 PM
this doesn't seem to be working, i attached an mp3 but no player showed up, only the option to download the file
have I missed something?
2.0.15 on a modified curve theme
Title: Re: Play Media Attachments
Post by: Dave J on October 05, 2019, 08:48:52 AM
Hi Dougie,

This wont install on the Github 2.1 RC2.

It looks for
Code: [Select]
a.width, a.height in Display.php but that text is not in the file.
Title: Re: Play Media Attachments
Post by: engrz on October 09, 2019, 09:36:44 PM
hello

im unable to attach any file, getting error "Call to undefined function PMA_mime_type()" if im removing the mod im getting http error 500
Title: Re: Play Media Attachments
Post by: engrz on December 02, 2019, 04:31:36 AM
Anyone Please reply to this error.
Title: Re: Play Media Attachments
Post by: Rock Lee on December 02, 2019, 09:53:18 AM
What version of SMF are you using? and of PHP?


Regards!
Title: Re: Play Media Attachments
Post by: engrz on December 02, 2019, 10:34:55 PM
What version of SMF are you using? and of PHP?


Regards!

SMF 2.0.15 and PHP 7.1

tried to uninstall the mod, installed fresh copy but the issue is same.
Title: Re: Play Media Attachments
Post by: Rock Lee on December 03, 2019, 10:14:03 AM
I have to do some tests but basically it can't call that function it could be because of the PHP version used but in the SMF / hosting error log does it mark something? Now I am away from my computer but I have to do some tests locally!


Regards!

ADD: A medium-fast test without much problem makes me a mistake in the database because I did not create a particular table which makes me think that is why you have that error in the call (it does not call because it has nowhere ... I will try to put a solution later).
Title: Re: Play Media Attachments
Post by: lor300 on April 10, 2020, 02:37:17 AM
Is it working on iPhone, iPad, iOS Safari?
Could you post a links to example of forums with the mod installed?

Title: Re: Play Media Attachments
Post by: misheles on August 03, 2020, 05:22:15 AM
Уже в SMF2017 ЭТОТ мод не  работает :-[