News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Play Media Attachments

Started by dougiefresh, December 30, 2016, 11:43:52 PM

Previous topic - Next topic

aegersz

Quote from: 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.

sweet. will test it shortly.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

dougiefresh

@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.

WishyWash

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?

Arantor

Do browsers even support AAC yet?

dougiefresh

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....

Arantor

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

WishyWash

Quote from: dougiefresh on September 02, 2017, 02:03:01 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.

dougiefresh

#67
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....

Steve

Something seriously wrong dougie. Soon as I click 'Install' I get a white screen and had to restore from a backup.
DO NOT pm me for support!

dougiefresh

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:)

Steve

Still something wrong dougie. Getting this error now:
DO NOT pm me for support!

Juanchoartes

#71
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.

dougiefresh

#72
@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....

Juanchoartes

Hi dougiefresh

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

Thanks!

dougiefresh

Sorry, I meant the JPG file that you are having an issue with, not the template file.  Thanks!

Juanchoartes

Sorry. I have attached to this post the jpg file.

dougiefresh

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.....

dougiefresh

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!

Juanchoartes

#78
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.


dougiefresh

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!

Advertisement: