Insert Video into HTML

Asked

Viewed 281 times

2

I’m trying to insert a video into a page that uses html and php.

I tried to use this tag <video src="video.mp4"></video> tried also as <video><source="video.mp4" type="video/mp4"></video>when I open the page in my browser, it works, but when I open it through the site it is inserted, the message appears Video Format or MIME type not supported.

I already tried to convert the video to "Webm", but continues the same message.

The browser is Firefox.

  • 1

    What you mean by "through the site that it is inserted"?

  • 1

    @Uzumakiartanis the extension does not define the type, the extension is more for Desktop computers and "magicmime" servers assume one that may be a specific type at the time of sending Content-Type via Apache for example, but if the file is corrupted as I assume it is (since the video works locally) then the problem may be in the upload ;)

  • Also compare the size of the local file with the remote, in bytes. Another thing you can do to see if it’s the same is to calculate the file md5, create a simple page by doing this check and compare the location with the remote: https://www.w3schools.com/php/func_string_md5_file.asp (Edit) only note that if the file is too large, routine can take too long...

1 answer

4

Probably you are going up the video via FTP and maybe you are taking the upload as ASCII, so that you do not lose data upload as binary, for example in Filezilla go to:

Transfer > Transfer type > and change Auto for Binary

As in the image:

filezilla

Then upload it again.

  • 1

    Boy, until then I didn’t know what this Binary guy was for here from my FTP Program and so I never risked using. After this answer I will know how to make use if necessary. + 1

  • So, I didn’t need to upload, because it’s Windows Server, I downloaded the folder directly and pasted the video there

  • @Kcpirola89 open the browser console and see if any error 404 or 403 appears and answer me, if you have another error inform, I am suspicious, since you are using IIS probably.

  • HTTP loading failed with 404 status.

  • @kcpirola89 in which folder is your HTML and in which folder is your video?

  • my index is php, but it’s in the same folder yes

  • @Kcpirola89 is sure it is the right folder? What is the name of the video file and in which folder exactly did you put it?

  • both index.php and video file are in the same folder, the video is called "quantity1.mp4"

  • @Kcpirola89 What is the name of the full folder? Take a screenshot of the console please.

Show 4 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.