Embed a video player into the webpage and play video files continuously on the server

Source: Internet
Author: User

<object classid="clsid:F3D0D36F-23F8-4682-A195-74C92B03D4AF" width="560" height="420" id="QvodPlayer" name="QvodPlayer" onError="downLoadQvod();">   <param name="url" id="qvodurl0" value="http://192.168.1.254:8089/ftp/ftpupload//2_1001_025201.AVI"> <param name="Autoplay" value="1">    <param name="Showcontrol" value="1">  </object>  


 

<Script type = "text/javascript"> function downLoadQvod () {if (window. confirm ('Please install the QvodPlayer software first, and then refresh this page to play normally! ') {Window. open ('<% = basePath %> video/qvod-setup.exe');} function play () {QvodPlayer. url = "F:/30230201/02 -53-02.AVI"; QvodPlayer. play () ;}var I = 0; function getState () {// encapsulate the request address as an array var urlArray = ["F:/30230201/02 -52-01.AVI", "F: /30230201/02 -53-02.AVI "," F:/30230201/02 -53-03.AVI "]; var state = QvodPlayer. playState; if (state = 0 & I <urlArray. length) {QvodPlayer. url = urlArray [I]; QvodPlayer. play (); I ++ ;}}// sets the timer. setInterval ("getState ()", 1000) is requested once in 1 S. </script>

You can also click the button to start the timer:

// Single video playback function singlePlay (path) {QvodPlayer. url = "$ {video_path}" + path; QvodPlayer. play () ;}// function multiPlay (index) {var urls =$ ("# s _" + index) for continuous playback of multiple videos ). text (); var I = 1; if (urls! = "") {Var urlArray = urls. split (","); singlePlay (urlArray [0]); setInterval (function () {var state = QvodPlayer. playState; if (state = 0 & I <urlArray. length-1) {singlePlay (urlArray [I]); I ++ ;}}, 1000 );}}


In this way, every 1 s is used to determine whether or not the previous video file has been played and automatically jumps to the next set after the video has been played. The disadvantage is that it does not automatically buffer the next set as quickly as it does, it's just a jump to an object !!

We can see a method in quickplay: QvodPlayer. playState; it calls an attribute in quickplay, and quickplay provides corresponding interfaces for js and vb, precisely because of the existence of these interfaces, we can play with quickplay on the page.

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.