Javascript controls webpage players including mediaplayer and RealPlayer

Source: Internet
Author: User

Media Player Control

Player. Controls. Play (); play
Player. Controls. Stop (); stop
Player. Controls. Pause (); pause
Player. Controls. currentposition: returns the current time and position of the playback file (in seconds)
Player. Controls. currentpositionstring string in time format "0: 32"
Player. currentmedia. Duration returns the total length of the playback file (in seconds)
Player. currentmedia. durationstring Time Format String "4: 34"
Player. settings. Volume volume (0-100)
Player. settings. Balance channel, which can be used to control the stereo, left and right audio channels. However, the values are unclear.
Player. settings. Mute = s mute (S values: true and false)
Player. closedcaption. captioningid: ID of the container with subtitles displayed on the webpage
Player. closedcaption. samifilename subtitle file address
Player. playstate: Player status (3: Playing, 2: paused, 1: stopped)

Bytes --------------------------------------------------------------------------------------------------------------

Real Player Control

Player. doplay () playback
Player. dopause () pause
Player. dostop () Stop
Player. getlength () returns the total length of the playback file (in milliseconds)
Player. getposition () returns the current time and position of the playback file (in milliseconds)
Player. getplaystate () returns the player status (0: stopped, 1: connected, 2: buffered, 3: played, 4: paused, 5: searched)
Player. setposition (n) the time point jumps to n (n is measured in milliseconds)
Player. setvolume (n) sets the volume (N ranges from 0 to 100)
Player. setmute (s) Mute (S values: true and false)
Player. setfullscreen () Full Screen
Player. setsource () sets the File Source

 

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.