Displaying Video on page
I am trying to embed a video on my page but it keeps showing as a Download link instead.
Can anyone assist me with the code please?
Attached is my current code.
Sorry. This is not working.
If I upload the file directly on my server and put it on my html page it works.
But when I upload using the CMS Admin, it is not showing on my php page.
Here is the code that works in the html page: <embed src="Odyssey.mp4" width="730" height="320" scale="aspect" controller="false" loop="true">
Why is it not working in my php page?
Maybe I am missing some code somewhere.
And this :
<?php foreach ($record['featured_video'] as $upload): ?>
<?php if ($upload['extension'] == 'mp4'): ?>
video == 1<br/>
<video width="360" height="230" controls>
<source src="<?php echo $upload['urlPath'] ?>" type="video/mp4">
<?php else: ?>
video == 0
<?php endif; ?>
<?php endforeach; ?>
The trick with cases like this is to get it working with some plain HTML code that links to the video, then view source on that and view source on viewer code and make the output identical. That's how we do it when we run into issues, we always start with getting the code working in plain HTML first. Then it's just an issue of making the viewer code that is output replicate the already working HTML code.
Let us know if you continue to have issues.
Thought you may be interested in this also - background video that I'm using for a new site. https://foodmach.com/
<video playsinline autoplay muted loop poster="static image url" id="bgvid">
<source src="insert webm video url" type="video/webm">
<source src="insert mp4 video url" type="video/mp4">
transform: translate(-50%, -50%);