How to play video in a new tab? - html

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

Related

How to make the video appear on html

I am trying to play a video on HTML using video tag. However, it is not playing at all. I'm thinking maybe it is the path problem.
https://imgur.com/sGyzvbx "screenshot of the file path"
I tried to use multiple video formats like WebM, mp4, and avi to test it out. However, the result is the same.
<video width="420" height="345" src="../test.mp4">
</video>
Try like this. video inside source tag. In your code you are miss controls. Html video can not play automatically. so we need control
<!DOCTYPE html>
<html>
<body>
<video width="400" controls>
<source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
</video>
<video width="400" controls src="../video.mp4"></video>
</body>
</html>

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

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.

How to embed html video without using youtube

Apparently I'm a total noob when it comes to web development. I just need help making a simple html file that embeds a video. I can't use youtube. I just need to embed the local file and it's not working.
<!DOCTYPE html>
<head>
<title>Testing</title>
</head>
<body>
<video id="0" controls width="502" height="479">
<source src="OWA tutorial.webm" type='video/webm'>
<source src="OWA tutorial.mp4" type='video/mp4'>
<p>Video is not visible, most likely your browser does not support HTML5 video</p>
</video>
</body>
</html>
This doesn't work. "OWA tutorial.mp4" is in the same folder as the html file. What am I doing wrong?
Tried this:
<!DOCTYPE html>
<head>
<title>Testing</title>
</head>
<body>
<video id="0" width="502" height="479" controls>
<source src="loop.ogv" type="video/ogg">
<p>Video is not visible, most likely your browser does not support HTML5 video</p>
</video>
</body>
</html>
Worked well. Just replace the ogg with mp4, in your case.
Edit:
I'm not saying that you should use .ogv instead of .mp4.
I just used it as example because I've tried with a .ogv file (just because I don't have a .mp4 file here right now).
Your code should work if you copy mine and just replace the "loop.ogv" with your filename and the "video/ogg" with "video/mp4".
Sorry if it was misleading.

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.