Current location - Quotes Website - Personality signature - Using video tags to play local videos in HTML5
Using video tags to play local videos in HTML5
1. Create a new html file named test.html, and introduce how to use video to control video.

2. On the test.html page, use the button labels to create four buttons, namely Play/Pause, Large, Medium and Small, to control the video playback effect. At the same time, use the video tag to create a video.

3. Bind an onclick click event for each button, and when the button is clicked, execute the corresponding function to control the video playback effect.

4. Use document.getElementById () to get the video object, create the playPause () function of "play/Pause", use the play () method to control the video playback, and use the pause () to control the video pause.

5. Create the makeBig () function. When you click the "big" button, the video will be played with a width of 560px.

6. Create a makeNormal () function and a makeSmall () function. When you click the "Medium" button, the video will be played with a width of 420px, and when you click the "Small" button, the video will be played with a width of 320px.

7. Open the test.html file in the browser and test the effect of js controlling video playback.