Play an MP4 inside of a post

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
JackW
Registered User
Posts: 2
Joined: Mon Jan 06, 2020 12:34 am

Play an MP4 inside of a post

Post by JackW »

Hello and I am trying to play an mp4 attachment in a post. I have tried tons of bbcodes and extensions and I can't get it to work. Does anyone know a solution?

User avatar
John connor
Registered User
Posts: 2464
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: Play an MP4 inside of a post

Post by John connor »

Have you tried this BBcode? viewtopic.php?p=15354316#p15354316

You would need to host the MP4 from your board or external resource like a cloud or FTP link.

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 3497
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Play an MP4 inside of a post

Post by thecoalman »

The reason is because the file is served with the mimetype application/octet-stream which is just generic file type that most browser will give the option to download.

This topic covers the issue: viewtopic.php?f=461&t=2383226

Extension in development here: viewtopic.php?f=456&t=2523206
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison

KYPREO
Registered User
Posts: 318
Joined: Fri Feb 02, 2018 9:56 am
Contact:

Re: Play an MP4 inside of a post

Post by KYPREO »

I am able to play MP4 attachments with BBCode on my board. Tested in Windows Chrome and Firefox and Android Chrome and Firefox. Admittedly I haven't tried in Mac/Safari/iOS.

I don't have an example for guest users, but this is the BBCode I am using:

BBCODE USAGE

Code: Select all

[mp4]{URL}[/mp4]
HTML REPLACEMENT

Code: Select all

<video src="{URL}" style="width:100%;max-width:720px" controls>
Your browser does not support the video tag.
</video>
HELPLINE

Code: Select all

[mp4]http://example.com/video.mp4[/mp4]
To use an attachment, I grab the URL for the attachment and place it within the BBCode using the following format:

Code: Select all

http://myboard.com/download/file.php?mode=view&id=####
phpBB user since 2002
www.AusRotary.com

JackW
Registered User
Posts: 2
Joined: Mon Jan 06, 2020 12:34 am

Re: Play an MP4 inside of a post

Post by JackW »

@KYPREO The code plays the audio of the video but I don't see any video. Any way to fix this?

Post Reply

Return to “phpBB Custom Coding”