Is it possible to view mp4 files and pdf using HTML5, i can see we can preview them when uploading
View mp4 and pdf using HTML5
-
- User
- Posts: 3
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.
-
- User
- Posts: 67
- Location: Surabaya - East Java - Indonesia
- Contact:
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
-
- User
- Posts: 67
- Location: Surabaya - East Java - Indonesia
- Contact:
I try this code :
<video width="120" height="160" autoplay>
<source src="<?=urlencode(CurrentPage()->video_field->CurrentValue)?>" type="video/mp4">
Your browser does not support the video tag.
</video>
And still not working :(
-
- User
- Posts: 9396
- 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.
-
- User
- Posts: 67
- Location: Surabaya - East Java - Indonesia
- Contact:
- 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