[THEME] Editorial

geonao
Ssr. Bludit
Posts: 11
Joined: Thu Jun 28, 2018 7:33 am

Thu Jun 28, 2018 12:08 am

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.
I prefer FreeBSD :evil:
geonao
Ssr. Bludit
Posts: 11
Joined: Thu Jun 28, 2018 7:33 am

Thu Jun 28, 2018 9:40 am

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>
I prefer FreeBSD :evil:
geonao
Ssr. Bludit
Posts: 11
Joined: Thu Jun 28, 2018 7:33 am

Fri Jun 29, 2018 11:39 pm

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 :)
I prefer FreeBSD :evil:
User avatar
Edi
Site Admin
Posts: 1295
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Sat Jun 30, 2018 12:40 am

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

Code: Select all

# Base directory
#RewriteBase /
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
Post Reply