Category:Music softwareTutorial: My Pause button
In this tutorial, we are going to see how to implement a pause button in our Home page. You may already have a pause button in the website which is actually a video player. This tutorial just going to get started to create our own pause button and some html css with video.
Step 1.
I am using mediaelement.js to create my video player. In this step, we will create pause button inside our Home page. To do this, first add following code into home.html.
This step is basically to make sure that the video is auto play when the page loads. In our case, we should be able to click pause button and the video automatically pause itself.
Step 2.
So, we have done with the mediaelement and video player is ready. Now, let's create pause button. To do this, first add following code into index.html. You can add in home.html too if you prefer but it is just only a starter with a pause button.
The tag is created to make the pause button. You can simply create a button by adding in tag and give a class to the button. The tag has href attribute and it says, which page you will get once you click the pause button. I think this is actually what most people want because after clicking the pause button, we should get a new page which says, pause.
Step 3.
You can set the text you want to display with the tag. I used Youtube as an example to show how this pause button work. I simply wrote, play and Pause. I set the color with the tag as red. You can change the color of this pause button as you want.
Step 4.
Now, we are almost done with this pause button. In mediaelement, you need to set play and pause properties of the video player. So, we can add following code into mediaelement.js.
Now, we are done with the first step. Next step is to create some video with audio in.
Step 5.
Now, I am going to create some html video with audio. To do this, first create a new folder called video. Inside the video folder, create a new file called test.mp4. You can download the video from Youtube. Just add ac619d1d87
Related links:
Comments