

#Html5 audio controls plus#
Click the plus button in the top left corner or in the body of the post/page.Go to your WordPress Admin interface and open a post or page editor.This plugin add a Gutenberg Block Called Html5 Audio Player Under Common Category.if you want to publish a player in template file use Past the shortcode in post, page, widget areas To publish them.Copy Shortcode for player you wanna publish.You will get Shortcode for every player On the player list.After installation you can see a sidebar menu in the dashboard called “Html5 Audio Player “.Control the audio speed by setting button.Show / Hide Setting button in the Player.Hide / Show audio duration in the player.

Increase Page load speed by changing Preload Options.The plugin will play the appropriate one based on the device. Ability to specify both the mp3 and ogg version of your audio files.Use autoplay option to play an audio/mp3 file as soon as the page loads.If you are selling audio files from your site then you can use this plugin to offer a preview.If you do podcasting then this audio player can be used to embed the audio files on your WordPress posts or pages.Works on all major browsers – IE7, IE8, IE9, Safari, Firefox, Chrome.HTML5 compatible so the audio files embedded with this plugin will play on iOS devices.It’s very easy to use which means you don’t have to be an expert to use this plugin.The audio player is compact so it does not take a lot of real estate on your webpage.Embed audio player in the post, page, widget area, and theme templates.It Has tons of options that can fit your audio player needs. You can Play embed a nice audio player in the post, page, and widgets areas as well as template files. A Simple, accessible, Easy to Use & fully Customizable audio player that works on all devices. For example, the Fast Forward, Rewind, and Restart functions throw “InvalidStateError” DOMExceptions if there is no audio file playing or loaded.Play. With the try/catch statements, these conditions fail silently, but you can see the errors if you open either the Console or Script tab in Internet Explorer 9 F12 tools. One cause of exceptions is if the user tries to play a file that does not exist, rewind when no file is loaded, or a connection to a file cannot be made. Try/catch statements are used in conjunction with methods that can throw exceptions. If HTML5 audio is supported, there are other errors that might happen.
#Html5 audio controls code#
If the audio element does not exist no code is executed. Each function tests by using if (window.HTMLAudioElement) to see if the audio element exists. The first is when you check for HTML5 audio support. In the JavaScript section of the code, there are areas where errors are likely. Fail silently but show in F12 developer tools console

}// Tests the paused attribute and set state. Var audioURL = document.getElementById(‘mylist’) //Skip loading if current file hasn’t changed. Var btn = document.getElementById(‘play’) Var oAudio = document.getElementById(‘myaudio’) Var currentFile = “” //Global variable to track current file If these values are different, the src property is set to the new file URL, the “currentFile” variable is updated, and the load method is called. When the user clicks the Play button, the “currentFile” variable is compared to the value in the text field that is specified by “audioURL.value”. The global variable “currentFile” is defined so that it keeps track of the URL for the file that is currently playing. To play more than one file, you can set the audio object’s src property to a URL of an audio file from within JavaScript. In the JavaScript portion, using document.getElementById, the audio object is returned in oAudio, the button object is returned in btn and list object is returned in audioURL. When a file is first loaded, the paused property returns true (playback is paused) even though the pause method has not explicitly been called. If the file is paused, the paused property returns true, and the play method is called, the button label is updated to Pause. If the audio file is playing, the paused property returns false, and the pause method is called to pause the playback. The state is checked every time the “playAudio” function is called. The button object is retrieved so that the button label can be toggled between Play and Pause, depending on the state of the audio object’s paused property. The play and pause methods are used to provide playback control.
