[RESOLVED] html5 video, works local, but not on server
On local machine video works just fine, but as I upload it on server, I get just gray field with X in the middle
<video src="path/to/video.ogv" controls="controls" width="400" height="600" >Your browser does not support the video tag.</video>
no matter how the path is written... ('http://www...' or just 'path/to/video.ogv')
<video src="http://www.path/to/video.ogv" controls="controls" width="400" height="600" >Your browser does not support the video tag.</video>
As I try on local machine to put web path (www....) I get also same gray field with X in the middle...
Is the videos format ok?
Been here before, add the following to your .htaccess file on your server:
(depending of course, which types your are actually using).
AddType video/ogg .ogv .ogg
AddType video/webm .webm
AddType video/mp4 .mp4
I've switched careers...
I'm NO LONGER a scientist,
but now a web developer...
and thank you for prompt response.
Also sorry for delayed response, I just could not manage before...
Ok, I added .htaccess file in main domain, in subdomain (where site uses video) in folder where video resides.... none of that helped.... (I host on windows server, uploaded .htaccess with filezilla and file was visible on panel)
But I got it working by adding mime type in my control panel...
Here is site (for best performance you need html5 browser):
Thank you again aj_nsc for your input
Can you explain more detail about you did that made it work?
I tried as suggested, but that did not do the trick.
What I have is paying hosting, and I have c-panel, where I can create subdomains, mysql and other data bases and so on. On that same c-panel I have an option to set MIME types (for each domain/subdomain. I just added video formats as suggested to me (above in this thread) to my subdomain and that made it working...
I guess it is a difference between paid and your own server. I guess paid servers do not let you modify the .htacces file, you are supposed to do that in c-panel... but I was wrong before...
Keep us posted how it goes, or if I can help in any other way.
Thank you for the details.
I just want to correct a little bit. I have a paid server (well actually it's currently free) but I can access and do whatever I want with the files because I have the access to the OS through the use of SSH.
I will surely keep in mind what you have mentioned above. I am sure there will be more people benefiting from your explanation as well..
You have an SSH access on rented host?
That is a rare flower khaha... So, off topics,
you can access all folders on server, or just your folder?
As I said, I am not quite sure of right answer... But if it works I wouldn't mess with it, hehe...
I do believe that aj_nsc's approach is the right one,
if I had my server(s) I surly would not have c-panel,
so I would go aj_nsc's way.
As I tried to do that way on my paid host (FTP) it had no effect.
As I poked around I found out that I can set MIME types in my c-panel.
And that now works.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread