Page 2 of 2
Re: [THEME] Editorial
Posted: Thu Jun 28, 2018 12:08 am
by geonao
Sorry for the <script> paste above. js is not needed to stream mp4 video . So, only the <video> tag is OK to display (play) local video on the page
Code: Select all
<video width="100%" controls>
<source src="bl-content/uploads/myvideo.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
</video>
But, this doesn't work with Categories and Tags. It only works from Home page listing and page itself
When I assign Category or Tag to the page with video, the Cat or Tag listing will not play the video.
Re: [THEME] Editorial
Posted: Thu Jun 28, 2018 9:40 am
by geonao
The code will be for example:
Code: Select all
<video width="320" height="240" controls>
<source src="/bl-content/uploads/myvideo.mp4" type="video/mp4">
<source src="/bl-content/uploads/myvideo.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
Should use:
Code: Select all
<source src="bl-content/uploads/myvideo.mp4" type="video/mp4">
Or, like I use the "video" tag to make it responsive
Code: Select all
<script>
function fallback(video) {
// replace <video> with its contents
while (video.hasChildNodes()) {
if (video.firstChild instanceof HTMLSourceElement)
video.removeChild(video.firstChild);
else
video.parentNode.insertBefore(video.firstChild, video);
}
video.parentNode.removeChild(video);
}
</script>
<video width="100%" controls>
<source src="bl-content/uploads/myvideo.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
onerror="fallback(parentNode)">
</video>
Re: [THEME] Editorial
Posted: Fri Jun 29, 2018 11:39 pm
by geonao
I solved my issue with displaying my video clip in Category and Tag listings.
Since I don't run the CMS from web server's root dir, but its own, then I needed to use absolute path of the CMS dir, as below:
Code: Select all
<video width="100%" controls>
<source src="/mycms/bl-content/uploads/myvideo.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
</video>
Now, it works great
Re: [THEME] Editorial
Posted: Sat Jun 30, 2018 12:40 am
by Edi
Great! Thank you for your feedback. Would have been hard to find the problem.
You can try the following setting in .htaccess:
Code: Select all
# Base directory
#RewriteBase /mycms/
instead of