HTML video not working - html

I am trying to get a video to play locally but it isn't working. the file is 'wildlife.mp4,' however, it doesn't play it is just a blank video box? Any help will be much appreciated, thanks.
<!DOCTYPE html>
<html>
<head>
<title>video</title>
</head>
<body>
<video width="320" height="240" controls>
<source src="wildlife.mp4" type="video/mp4">
<source src="wildlife.ogg" type="video/ogg">
Your browser does not support the video tag.
</body>
</html>

Video tag is not closed.
Add autoplay if you want the video to play automatically.
<!DOCTYPE html>
<html>
<head>
<title>video</title>
</head>
<body>
<video width="320" autoplay="autoplay" height="240" controls>
<source src="wildlife.mp4" type="video/mp4">
<source src="wildlife.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
</body>
</html>

If you are running the script on Windows the browser can check the file type associated with the video ( wildlife.mp4 ). On my system ( W7) I clicked the -Properties- on the video file and CHANGed the -Type of file- from VLC (which is the default on my system) to Windows Media player and all was sorted.
Hope this helps.

Related

Audio won't autoplay

<!DOCTYPE html>
<html>
<body>
<audio controls autoplay>
<source src="Rick Roll.mp3" type="audio/mpeg">
</audio>
</body>
</html>
For some reason, it won't play automatically. Is it because the file is too big?
Media like video or audio will not play automatically anymore. This is a security thing. In order to play the media, user must interact with the page, like with a click.
There is a space in your src that is invalid.
<source src="Rick Roll.mp3" type="audio/mpeg">
Try for fix that(if is this):
<source src="RickRoll.mp3" type="audio/mpeg">

Autoplay attribute of video element of HTML 5 working in Firefox but not in Chrome or Opera

I have the following code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<video width="400" autoplay>
<source src="../Videos/mov_bbb.mp4" type="video/mp4">
<source src="../Videos/mov_bbb.ogg" type="video/ogg">
<source src="../Videos/mov_bbb.webm" type="video/webm">
Your browser does not support autoplay HTML5 video tag.
</video>
<p><span>Video courtesy of </span>Big Buck Bunny</p>
</body>
</html>
Upon opening the file in Firefox everything is working as expected.
But, upon opening the file in Chrome or Opera a still image is coming and nothing is happening.
Why is it so?
I am using Ubuntu 18.04
A bit of a workaround. Adding the following after the closing /video tag could work.
<script>
document.getElementById('vid').play();
</script>
Does that work for you?
EDIT: After some extra digging I stumbled across this post https://stackoverflow.com/a/42414858/6524598. It seems to be the case that chrome only respects autoplaying of a video if the audio of it is muted. This would mean that the following would perhaps work for you as well:
<video width="400" autoplay muted >
<source src="../Videos/mov_bbb.mp4" type="video/mp4">
<source src="../Videos/mov_bbb.ogg" type="video/ogg">
<source src="../Videos/mov_bbb.webm" type="video/webm">
Your browser does not support autoplay HTML5 video tag.
</video>

audio file is not playing in html

I am unable play audio file in my html.Below code is sample
<html>
<body>
<audio controls>
<source src="http://localuat.virinchihospitals.com/vfImg/UploadAudio/1529667425971.mp3" type="audio/mpeg">
</audio>
</body>
</html>
I do not have privileges to comment, but it seems to me that your mp3 file does not exist, follow an example
<!DOCTYPE html>
<html>
<body>
<audio controls>
<source src="http://www.orangefreesounds.com/wp-content/uploads/2016/12/Horse-and-carriage-passing-by.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</body>
</html>
Your audio file is not right/valid its not working, Open this in your tab and see
http://localuat.virinchihospitals.com/vfImg/UploadAudio/1529667425971.mp3

How to play video in a new tab?

I am a beginner in web development. I have a video file in my web page.
I want to play that video in a new tab.
I gave the target="_blank" attribute into my video tag but it's still not working.
Is there is any other way to play videos in a new tab?
Please help me!
Thank you!!
Do you try this way?
<!DOCTYPE html>
<html>
<body>
<h2>Click the Link to Play the Object</h2>
Play a video file
</body>
</html>
Or you can create a blank page with following code:
<!DOCTYPE html>
<html>
<body>
<video width="90%" height="90%" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
</body>
</html>
And then link to that page:
See the video

html5 video only works in safari

Im new to HTML 5 and learning from w3schools
I tries to get the html video code working for a file I have. Trouble is that the html only works in safari but not the other browsers I have.
Any ideas please?
thanks
<!DOCTYPE html>
<html>
<body>
<video width="320" height="240" controls="controls">
<source src="candonjoel.mp4" type="video/mp4" />
<source src="candonjoel.webm" type="video/webm" />
<source src="candonjoel.ogg" type="video/ogg" />
Your browser does not support the video tag.
</video>
</body>
</html>
Does candonjoel.webm exist? Can you show the URL of your code please?
https://github.com/kaihendry/recordmydesktop2.0/ is project to make screencasts easier from Linux to all browsers.