It will also create two variables soundIcon and muteIcon to be used to change the icon of the button based on whether the audio is muted or not. This will add a soundButton variable, which will be the sound button element. Inside that container, we'll add the track "image" element.Ĭonst soundButton = document. We'll start by adding in the HTML the container. We'll just an icon from Heroicons to simulate that. It gives a nice style to the audio player. Usually, audio players have an image of the track playing. You can see the full demo on CodePen at the end of the section. Then with the help of Javascript bind the audio element's functionalities to these elements.Īll the icons used in this section are from Heroicons. We'll a nice looking player that uses different elements to achieve a good style. In this section, we'll create our own custom audio player. In the example below, we add a background color, a border radius, and some padding. To style the volume slider, which on Chrome appears after hovering the mute button, you can use the selector audio::-webkit-media-controls-volume-slider. In the example below, we add a background color and a border radius. when I checked directly the link of the file it works. I created player with almost 150 audio files and image, everything plays but almost 10 files they dont load into player, it cannot be size of the file b’coz bigger size files are playing without any trouble. To style the timeline you can use the selector audio::-webkit-media-controls-timeline. I bought the Amazing player, everything works great, but small problem. In the example below, we change the color of the text. To style the remaining time you can use the selector audio::-webkit-media-controls-time-remaining-display. To style the current time you can use the selector audio::-webkit-media-controls-current-time-display. In the example below, we change the background color of the play button as well as add a border-radius. To style the play button, you can use the selector audio::-webkit-media-controls-play-button. In the example below, we change the background color of the mute button as well as add a border-radius. To style the mute button, you can use the selector audio::-webkit-media-controls-mute-button. In the example below, we use the selector to change the background color. To style the control panel, which is the container of all the audio's controls, you can use the selector audio::-webkit-media-controls-panel. So, if you want to see how the audio element's style changes, please use Chrome. We'll see a few examples of how we can use some of these selectors to style the audio element.Īll the examples below will only work on Chrome. However, these only work on select browsers like Chrome. Using these selectors, you can give basic styling to audio elements. The last step is to publish the created audio player to HTML files, then you can insert it to an HTML editor, for example, Dreamweaver or Frontpage.Audio : :-webkit-media-controls-mute-buttonĪudio : :-webkit-media-controls-play-buttonĪudio : :-webkit-media-controls-timeline-containerĪudio : :-webkit-media-controls-current-time-displayĪudio : :-webkit-media-controls-time-remaining-displayĪudio : :-webkit-media-controls-volume-slider-containerĪudio : :-webkit-media-controls-volume-sliderĪudio : :-webkit-media-controls-seek-back-buttonĪudio : :-webkit-media-controls-seek-forward-buttonĪudio : :-webkit-media-controls-fullscreen-buttonĪudio : :-webkit-media-controls-rewind-buttonĪudio : :-webkit-media-controls-return-to-realtime-buttonĪudio : :-webkit-media-controls-toggle-closed-captions-button If you are good at CSS, you can further customise the player with your own CSS codes. On legacy web browsers, for example, Internet Explorer 7, 8, 9, where HTML5 is not supported or not supported very well, the audio player will use Flash to play MP3.Īfter you added the audio files, you can choose a skin for the player. If an optional OGG file is provided, the audio player will use HTML5 to play the audio, otherwise, it will use Flash to play MP3 files on these two browsers. On Firefox and Opera, MP3 format is not supported by its HTML5 player, OGG format is supported instead. On Chrome, Safari, Internet Explorer 10, iPhone, iPad and Android, the audio player will use HTML5 to directly play MP3 files. You can also specify a cover image for the audio file. In step 1, you can add MP3 files, edit the title, album and artist. With a wizard style and self-explanatory user interface, Amazing Audio Player is very easy to use. This is a quick start guide of how to create an HTML5 audio player for your website with Amazing Audio Player.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |