Play Media Attachments

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

Previous topic - Next topic

Juanchoartes

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

aegersz

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

aegersz

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

aegersz

sorry to be a pain in the arse but is there any support for .wma files ?
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

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

Juanchoartes


dougiefresh

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

aegersz

sweet. sorry about the Image Rotation mod mention - I get derailed so easily.

thanks again !
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

Juanchoartes

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.


Juanchoartes

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.

Steve

Or a conflict with another mod. What other mods do you have installed?
DO NOT pm me for support!

dougiefresh

@Juanchoartes:  Please attach your Sources/Display.php so that I can see if there is anything I can see that might cause this conflict....

Juanchoartes

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:

  • Uninstall and delete the "PDF Tag" mod.
  • Before uninstalling the "PDF Tag" mod, an error warning about editing the /Source/Subs.php file appears. In spite of that, I uninstalled the mod. "PDF Tag" mod adds the following code to the /Source/Subs.php file:
// 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>',
         ),



  • Edit the file, delete that code and save (remember to make a backup of the file in case you make some mistake).
  • Install "Play Media Attachments" mod.
  • IMPORTANT: You have to reattach every jpg file (or any other format) that gave the error of the video tag.

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!  ;)

dougiefresh

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

Steve

No worries Juanchoartes. Thanks for letting dougie know what the problem was and your solution.
DO NOT pm me for support!

Juanchoartes

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.

dougiefresh

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

Quote from: Juanchoartes on September 15, 2017, 06:52:37 AM
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....

Juanchoartes

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.

Steve

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.
DO NOT pm me for support!

Juanchoartes

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

"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?

Advertisement: