JS control HTML5 video playback and stop in the "Video" tab

Source: Internet
Author: User

Tag:rip   strong   document   title    Success      solution    post   cti   name   

Requirements: There are 2 normal buttons on the page, A, B. There is also a video tag that can successfully play out videos. I want the effect is, click the A button, the video starts playing, click the B button, video playback Stop!!! <br><br>---------------------------------------------------- Code---------------------------------------------------------------------------<br><br><! DOCTYPE html> 

  [Solution]:

var myvideo = document.getelementsbytagname (' video ') [0]; can be converted to document.getElementById (' videoid '); <video src= "mymovie.m4v" poster= "poster.jpg" id= "videoid" ></video>[solution] amount. Come late ... Stop the words ... myvideo.currenttime = 0;    Property sets or returns the current position (in seconds) of audio/video playback. When this property is set, playback jumps to the specified location. Myvideo.pause ();------Solution--------------------  Mark

  

JS control HTML5 video playback and stop in the "Video" tab

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.