eddyjohn Posted August 8, 2012 Share Posted August 8, 2012 H! I noticed that the HTML5 AUDIO set-up is missing somebasic audio properties. Things like (back / Forth, a download or buy button would be great)Beneath the buy button you can tuck in code for a paypal or google checkout. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 8, 2012 Share Posted August 8, 2012 You can use the controls attribute to tell the browser to display the control buttons: http://www.w3schools.com/html5/att_audio_controls.asp That reference is about the audio element, it's not a tutorial on building a shopping cart. The audio element doesn't have anything to do with a buy button. PayPal and Google have tutorials about how to set up their services, third-party services are not in the scope of the tutorials on w3schools. Link to comment Share on other sites More sharing options...
eddyjohn Posted August 8, 2012 Author Share Posted August 8, 2012 H! Justsomeguy, The audio element is limited, because it missing an previous, next and download button.I don´t know if you ever heard of ITUNES (ITUNES SAYS THE AUDIO ELEMENT GOTEVERYTHING TO DO WITH THE BUY BUTTON) < II > V & Buy Link to comment Share on other sites More sharing options...
justsomeguy Posted August 8, 2012 Share Posted August 8, 2012 The audio element plays a single sound file. It's not a playlist, there's no "next" and "previous" because a single song doesn't need a next and previous button. The point of adding the audio element (and the video element) in HTML 5 is a way to allow a browser to natively play a media file without needing a third-party plugin like Flash. It's just a basic building block, like everything else in HTML. If you want to build a playlist then you can use the audio element as a base to play the song, but that's not the only part of it. You need a way to have a list of the different songs in the playlist, for example, that's not part of the audio element. That would be part of your implementation of a playlist that uses an audio element as a replacement for a Flash-based player, and it uses Javascript to control which song is playing. We can help you learn how to build something like that, but the audio element itself is just one piece of it. It's not the whole thing. Expecting the audio element to provide playlist management and purchasing controls is like asking how to set up a form with a search box so that it behaves exactly like Google search. There is a lot more to Google than a little form with a text input and submit button. I don´t know if you ever heard of ITUNES (ITUNES SAYS THE AUDIO ELEMENT GOT EVERYTHING TO DO WITH THE BUY BUTTON)That's a perfect example, thank you for illustrating that. iTunes is not just a single audio element and nothing else. It is a big, bloated program that contains playlist management, purchasing, synching to various devices, nagging you about updates, and several other things. None of those involve the HTML 5 audio element. Actually playing a single song (which is the only thing the audio element does) is just one small part of iTunes. Moreover: HTML does not have a "buy button". It has buttons, but other than a submit or reset button that controls a form the button's behavior is up to you to define. PayPal has a tutorial on how to build a button to buy a product through them, but the HTML markup they give you is not a single element, it's several elements possibly with Javascript. Just like Google Checkout, what you actually put on your page is not a single HTML element where your browser knows it's a Google Checkout button, it's a regular HTML button with a bunch of extra code that allows it to use Google's systems. PayPal and Google are the places to go to learn how to set those up, because they are their services (and they change). You're not going to find a tutorial about how to set up a PayPal button in a general-purpose web developer tutorial like you find here. The point of the w3schools tutorials is to give you information about the basic building blocks that you can use to build whatever you want, not specific instructions on how to build specific applications. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 8, 2012 Share Posted August 8, 2012 For more information about this, here is Mozilla's reference on the audio element: https://developer.mo...L/Element/Audio And the actual specification for it: http://www.whatwg.or...ent-work/#audio Note that there is a mediagroup attribute, which can be used to have a common media controller control several media elements, which may allow a browser to show playlist controls if that browser supports it. Although it looks like the mediagroup attribute is used to synchronize multiple media elements to play at the same time instead of playing them successively. http://www.whatwg.or...edia-mediagroup Link to comment Share on other sites More sharing options...
marry Posted August 9, 2012 Share Posted August 9, 2012 I have got the complete help through the replies. Thanks a lot! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.