Is it possible to view mp4 files and pdf using HTML5, i can see we can preview them when uploading
For mp4, simply use Custom View Tag (see Field Setup in help file) to show your field value with your HTML 5
Thank you, works perfectly
could someone please explain how to do this? i don’t understand the custom tag suggestion. I need to be able to view a PDF file instead of downloading it. Thank you for your help.
Hello,
My custom view tag for view mp4 files didn’t work.
This is my code for view mp4 using html5 (v2021)
<video width="120" height="160" autoplay>
<source src="<?CurrentPage()->video_field->CurrentValue?>" type="video/mp4">
Your browser does not support the video tag.
</video>
Any suggest will be appreciated, thank you
You should use <?= ... ?> to output the current value, see PHP tags.
I try this code :
- Are you sure your field variable name is “video_field”? Read Database, Table and Field Variable Names.
- If your field value only contains the file name, you need to add the correct path to the src attribute.
- Yes, I’m sure that my variable name is “video_field”
- I add the path to the src attribute like this : <source src=“https://mydomain.net/project1/files/”<?= urldecode(CurrentPage()->video_field->CurrentValue) ?> type=“video/mp4”>
Still nothing happens
You should check HTTP response.