How create a video or audio player in WordPress with HTML

Another day I need to insert a video in a wordpress website, just one video and I thought that use a plugin for that is so heavy.

So I had a idea: create a HTML5 player! It’s so easy and you don’t need to know HTML!

In addition, a HTML player can be customized, you just need to upload to “media” seccion any video or audio.

Once you have uploaded the archive you have to open a new post or page and change the “visual” option to “text” or “html” option, then copy and paste this code:

<audio src=”copy and paste the url of your archive uploaded to ‘MEDIA’ ” autoplay=”autoplay” controls=”controls”>
</audio>

With “autoplay” the audio will start just when somebody visit the post or page, this is so interesting to capture visitors attention but It could be annoying too, so just delete: autoplay=”autoplay”.

¿do you want to create a video?

Just copy and paste the last code and change the word “audio” for “video”.

IN addition using “height” and “width” you can change the size of your video.

The code will be like that:

<video src=”copy and paste the url of your archive uploaded to ‘MEDIA’ ”   height=”400″, with=”300″ autoplay=”autoplay” controls=”controls”>
</video>

Height and width is just number of pixels, if you want to choose a % just add It. For example: height=”50%”.

My own example:

 

This is my code for my example: <video src=”https://yourwpweb.com/wp-content/uploads/2017/07/Screencast_10-07-17_190038.webm ” controls=”controls” height=”20%” width=”60%”>
</video>



Acepto donaciones de BAT's mediante el navegador Brave 🙂



Leave a Reply

Your email address will not be published. Required fields are marked *