Jump to content

Embedded video file not working.


Rewillis

Recommended Posts

Attention: W3schools.com forum members:

     Included below is some web server configuration code and hypertext markup language ( HTML ) code, respectively:

<VirtualHost *:80>
   ServerName www.holybible1.ddns.net
   ServerAlias holybible1.ddns.net
   DirectoryIndex index3_41.htm
   DocumentRoot "c:/Apache24/Apache24/htdocs/videoa"
   <Directory "c:/Apache24/Apache24/htdocs/videoa">
      Options Indexes FollowSymLinks
      AllowOverride none
      Require all granted
   </Directory>
</VirtualHost>
<center><video width="600" height="500" controls>
  <source src="http://localhost/The_book_of_Revelation_14a.mp4" type="video/mp4">
</video></center>

The web page ( i.e., "index3_41.htm" ) has been serving up fine for roughly the past year, since I initially posed a question regarding this subject on this user forum.  However, in the past week or so, the embedded video file ( i.e., "The_book_of_Revelation_14a.mp4" ) has not been working.  The two files ( i.e., "index3_41.htm" and "The_book_of_Revelation_14a.mp4" ) were originally stored in a different file path on my personal computer system running Microsoft Windows 10 ( Home ) Edition ( i.e., "c:/Apache24/Apache24/htdocs/pecm" ), but have been recently moved to the new file path ( i.e., "c:/Apache24/Apache24/htdocs/videoa" ).  Why is my above-mentioned embedded video file not working now?  I posted a similar question on another user forum recently, and was provided the following two suggestions regarding the "<source>" portion of the "<video></video>" tags ( given immediately above ):

<source src="The_book_of_Revelation_14a.webm" type="video/webm">

OR

<source src="./The_book_of_Revelation_14a.webm" type="video/webm">

 These two suggestions do not solve my problem.  Can anyone on this user forum tell me what needs to be done to get my embedded video file working in my above-mentioned web page again?  Thank you ( see Colossians 3:15, for example ) for your help and your patience.  Keep in touch. 😊

Sincerely in Christ,

Russell E. Willis

P.S. - Please read Proverbs 23:23.

Link to comment
Share on other sites

Hi Russel,

My experience with apache is that localhost normally serves from /htdocs/, so your webpage is possibly making you look for "C:/Apache24/Apache24/htdocs/The_book_of_Revelation_14a.mp4" instead of where it actually is.

Also is this website hosted on an external server? Or otherwise accessible by multiple devices?

There are three sorts of links that are common with most websites

  • Absolute Links. (http://localhost/The_book_of_Revelation_14a.mp4) I consider these only useful for external resources on another domain. These look at the exact address specified for resources and pages.
  • Relative Links. (./The_book_of_Revelation_14a.webm OR The_book_of_Revelation_14a.webm) I don't use these normally, because I end up having to move files around a lot. But they're quite nice for linking to other pages that you know are always going to be bundled together. They look for the file relative to the current page that is opened.
  • Relative to Root Links (/The_book_of_Revelation_14a.mp4) I find these links to be excellent, as they nicely translate from my testing environment to the production one without changes. These ones look at the current domain base to find the file.

May I recommend trying a relative to root link.  (Note the / only)

<source src="/The_book_of_Revelation_14a.webm" type="video/webm">

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...