BooKwiznak Posted May 23, 2011 Share Posted May 23, 2011 I wanted to mute the audio in the video and was going through the HTML5 video tutorial section which covered the audio attribute section here:http://www.w3schools.com/html5/tryit.asp?f...ml5_video_audioThe code is: <!DOCTYPE HTML><html><body><video controls="controls" audio="muted"> <source src="movie.ogg" type="video/ogg" /> <source src="movie.mp4" type="video/mp4" /> <source src="movie.webm" type="video/webm" />Your browser does not support the video tag.</video> </body></html> When I press play, I still hear the audio. I've tried putting in audio="muted" on another example and I'm having the same issue. Link to comment Share on other sites More sharing options...
Ingolme Posted May 23, 2011 Share Posted May 23, 2011 I suppose that the audio attribute still isn't supported by most, if any, browsers. Link to comment Share on other sites More sharing options...
deepak.ramineni Posted October 15, 2011 Share Posted October 15, 2011 Hi Mate I am trying to add a youtube video(an exact link copied off youtube website) to this document, my safari/chrome is not returning anything out of the code can u pls give a hand on this. <!doctype.html><html><head><title>my first youtube video</title></head><body><object height="200" width="300"/><param name="movie" value="http://www.youtube.com/watch?v=5P6UU6m3cqk"></param><embed height="200" width="300" src="http://www.youtube.com/watch?v=5P6UU6m3cqk"></body></html> and may i please know how to add an audio or a video file through my local computer. your help is appreciated on this. regards Link to comment Share on other sites More sharing options...
Ingolme Posted October 15, 2011 Share Posted October 15, 2011 This code wasn't copied directly from youtube, you've made a lot of modifications. First of all, the object tags should surround all the rest of the tags. The URL isn't that of the video page, it should be the link to the flash document itself ( http://www.youtube.com/embed/5P6UU6m3cqk ) <object height="200" width="300"> <param name="movie" value="http://www.youtube.com/embed/5P6UU6m3cqk"></param> <embed height="200" width="300" src="http://www.youtube.com/embed/5P6UU6m3cqk"></object> Currently, youtube has finally decided to drop the <embed> tag, which is not valid HTML. They're using an iframe instead. You could do this instead: <iframe width="300" height="200" src="http://www.youtube.com/embed/5P6UU6m3cqk" frameborder="0" allowfullscreen></iframe> Link to comment Share on other sites More sharing options...
deepak.ramineni Posted October 15, 2011 Share Posted October 15, 2011 Hi Duotone how are you...thnks for your help over this.. pls lemme know how i can add a song from my local computer into an audio tag. u hv gr8 weekend... cheers Link to comment Share on other sites More sharing options...
Ingolme Posted October 15, 2011 Share Posted October 15, 2011 Convert a file to one of the valid formats, upload it to your server and use the audio tag as shown here: http://w3schools.com/html5/tag_audio.asp Link to comment Share on other sites More sharing options...
deepak.ramineni Posted October 16, 2011 Share Posted October 16, 2011 Hi Duotone... sorry i am new to this...how do i upload to server cheersDeepak Link to comment Share on other sites More sharing options...
Ingolme Posted October 16, 2011 Share Posted October 16, 2011 You'll have to ask your web host about that. It can be done through an online file manager or through an FTP client. How do you currently put pages on your site? Link to comment Share on other sites More sharing options...
deepak.ramineni Posted October 17, 2011 Share Posted October 17, 2011 Hi Duotone I'm currently learning HTML through w3schools, and saving notepad/textedit files as html and putting them into a folder.Could you please advise whats the best way to put my pages into a site. cheersDeepak Link to comment Share on other sites More sharing options...
Ingolme Posted October 17, 2011 Share Posted October 17, 2011 OK, if it's on your computer, just put the audio file in a folder and point to the folder from the <audio> element. To put your pages on the internet, you have to find a web host. Look on Google for web hosts. Some are free, some aren't. The free ones usually have a lot of drawbacks. Link to comment Share on other sites More sharing options...
deepak.ramineni Posted October 17, 2011 Share Posted October 17, 2011 Hi Duotone thnks 4 the reply. i hv created a folder and named it "root" and have dropped an audio file into the root folderand have tried to play audio through the following:- <audio controls="controls" height="50px" width="25px"><source src="song.mp3" type="audio/mp3"/><source src="song.wav" type="audio/wav"/></audio> and it doesnot play the audio which was saved under my root folder, same case with video as well. cheersDeepak. Link to comment Share on other sites More sharing options...
thescientist Posted October 18, 2011 Share Posted October 18, 2011 where is this HTML file relative to the audio file? Are they both in this same root folder? If the root folder is in the same folder as the HTML file, then you need to point to audio file as such <source src="root/song.mp3" type="audio/mp3"/> Link to comment Share on other sites More sharing options...
deepak.ramineni Posted October 18, 2011 Share Posted October 18, 2011 Hi Scientist i have created a root folder and placed song.mp3 file into it, and have placed the html file with the following and have put it into the root folder, but it doesn't play the file <audio controls="controls" height="40px" width="50px"><source src="root/song.mp3" type="audio/mp3"/><source src="root/song.wav" type="audio/wav"/></audio> pls help on this.. thnk you Link to comment Share on other sites More sharing options...
thescientist Posted October 18, 2011 Share Posted October 18, 2011 you need to understand how file paths and system directories work. If the HTML AND the audio file are in the SAME folder, then the path to the audio file is just the filename. It wasn't clear where each file was. So if they are both in the SAME root folder, then the path to the audio file shouldn't have anything before it. <source src="song.mp3" type="audio/mp3"/> before, since you had the HTML in a folder, and THEN a root folder with the audio file in it, that's why you needed root before it in the src. You have to think like the computer, you need to tell it where to look, relative to the file that is making the request for the asset. Link to comment Share on other sites More sharing options...
deepak.ramineni Posted October 19, 2011 Share Posted October 19, 2011 Hi Mate I have saved song.mp3 on the following path , where the html code above was also saved in the same folder /Users/deepakshowri/Desktop/HTML/root it still doesnot work for some reason/it definitely comesup with a player but just says loading.... pls advice deepak. Link to comment Share on other sites More sharing options...
thescientist Posted October 19, 2011 Share Posted October 19, 2011 what code are you using then? How about in one post, show the exact code you are using AND tell us the folder structure. It's getting too confusing cause it seems like you keep changing both things instead of making one match the other. Link to comment Share on other sites More sharing options...
deepak.ramineni Posted October 23, 2011 Share Posted October 23, 2011 Hi Scientist I have a folder called root and i have saved a file named song.mp3 in the same folder.jsut for your clarity the path to the folder was /Users/deepakshowri/Desktop/HTML/root/song.mp3 and then i tried the following code to play the song:- <audio controls="controls" height="50px" width="25px"><source src="root/song.mp3" type="audio/mp3"/><source src="root/song.wav" type="audio/wav"/><source src="root/song.ogg" type="audio/ogg"/></audio> Link to comment Share on other sites More sharing options...
thescientist Posted October 26, 2011 Share Posted October 26, 2011 ok but what about the HTML file. Using that path you gave us, which folder is the HTML file in that has the audio tags in it? And you have made sure your browser supports the audio tag, yes? Link to comment Share on other sites More sharing options...
deepak.ramineni Posted October 26, 2011 Share Posted October 26, 2011 Hi Mate I have the HTML file saved in the same "root" folder of the path as song.mp3 isi am using google chrome 15.0.874.102 versionsafari 5.0.5 thanks Link to comment Share on other sites More sharing options...
Ingolme Posted October 26, 2011 Share Posted October 26, 2011 If they are in the same folder then you don't need to specify the directory in the pathname, just put the filename in the src attribute. Link to comment Share on other sites More sharing options...
deepak.ramineni Posted October 26, 2011 Share Posted October 26, 2011 Hi I hv tried without the directory and just the file name..it still shows me the player but it doesnot play the song thnks Link to comment Share on other sites More sharing options...
thescientist Posted October 27, 2011 Share Posted October 27, 2011 Hi I hv tried without the directory and just the file name..it still shows me the player but it doesnot play the song thnks you're not following us very well. I highly encourage you to read on file structures and how relative paths work in order for you understand how documents relate to themselves on the web. let me try and explain it one more time. The src is relative to the HTML document requesting the file. So you are telling it to look in root. This means that the HTML file must be one level up. OR, you remove the root, and have all three files in the same folder. However, it is preferable to organize your documents to keep things organized. So in staying with your root example, let's try this one more time. you have a folder/Users/deepakshowri/Desktop/HTML this is the obvious location for your html file. so leave it as it <audio controls="controls" height="50px" width="25px"><source src="root/song.mp3" type="audio/mp3"/><source src="root/song.wav" type="audio/wav"/><source src="root/song.ogg" type="audio/ogg"/></audio> now, you are telling the HTML file to look in a folder called root WITHIN the folder that the html file is in, in order to find the audio files. So, using the root folder /Users/deepakshowri/Desktop/HTML/root make sure all your audio files are in there. so at the end of it all you should have an HTML folder with an html file in it, and a root folder. Inside the root folder are your audio files. Link to comment Share on other sites More sharing options...
thescientist Posted October 27, 2011 Share Posted October 27, 2011 dp Link to comment Share on other sites More sharing options...
deepak.ramineni Posted October 28, 2011 Share Posted October 28, 2011 Hi Scientist sry for my hassle....i finally got this to work.. cheers Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.