audio file is not playing in html - 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

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">

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

HTML video not working

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.

Playing audio file using HTML 5 and jsp

I am trying to play an audio file, it works when I have a .html file but when I am running the same code in a .jsp file the file cannot be played. I am using Netbeans IDE. Could someone please point out the mistake, Here is the jsp code.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
<audio controls>
<source src="C:\Users\Desktop\1.mp3" type="audio/mpeg">
</audio>
</body>
The src attribute should not be the file location of the audio file. Instead, it should be the URL for the file. So in your case, try
<audio controls>
<source src="http://localhost:8080/PathToMp3/1.mp3" type="audio/mpeg">
</audio>
where http://localhost:8080/PathToMp3/1.mp3 is the url of your mp3 file.
<audio controls>
<source src="http://localhost:8080/PathToMp3/1.mp3" type="audio/mpeg">
</audio>
if it's not working use this
<embed src="">

In firefox I am not able to open video tag

<!DOCTYPE HTML>
<html>
<body>
<video width="320" height="240" controls="controls">
<source src="tutorial.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
</body>
</html>
this tutorial.mps is stored in the same folder but I am not able to open that video I got that sentence Your browser does not support the video tag.
See this link about media format browser compatibility. The firefox doesn't support mp4 yet. Convert the file e.g. to ogg and add an additional source-tag.