Recently, the customer requested to use Javascript For video carousel:
If you are interested, you can take a look.
The following describes a program for video carousel, which can be implemented on both pc and mobile terminals,
However, mobile terminals have some bugs;
Copy codeThe Code is as follows:
<! DOCTYPE html PUBLIC "-// W3C // dtd html 4.01 Transitional // EN" "http://www.w3.org/TR/html4/loose.dtd">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "textml; charset = UTF-8">
<Title> Insert title here </title>
</Head>
<P> video carousel 11 </p>
<Div id = "container"> </div>
<P> video carousel 22 </p>
</Body>
<Ml>
<Script type = "text/javascript">
Var index = 0;
Var arr = new Array ("71da9e4b6985a7b5951dd62ce7bb020d_7", "71da9e4b691a41961dcd6524593d39ee_7", "login ");
Var container = document. getElementById ("container ");
Function printPlayer (index ){
// Alert (arr. length );
If (index> arr. length-1 ){
Index = 0;
}
// Container. removeElement;
Container. innerHTML = "";
Var vid = arr [index];
If (navigator. userAgent. match (/iP (od | hone | ad)/I )){
Var video = document. createElement ("video ");
Video. src = "http://v.polyv.net/uc/video/getMp4? Vid = "+ vid;
Video. onended = s2j_onPlayOver;
// Video. addEventListener ('enabled', j2s_onPlayOver, false );
Video. autoplay = "true ";
Video. controls = "controls"
Container. appendChild (video );
} Else {
Varswf = "http://player.polyv.net/player_polyv_20130926a.swf? Vid = "+ vid;
Container. innerHTML = "<OBJECT width = '000000' height = '000000'> <param name = movie VALUE = '" + vid + "'> <param name = 'allowScriptAccess' value = 'always'>"
+ "<Param name = 'allowfullscreen 'value = 'true'/>"
+ "<EMBED src = '" + swf + "'width = '000000' height = '000000' TYPE = 'application/x-shockwave-flash' allowscriptaccess = 'alway' allowFullScreen = 'true'/> </EMBED>"
+ "</OBJECT> ";
<! -- Container. innerHTML = "<OBJECT>" + swf + "</OBJECT>"; -->
}
}
PrintPlayer (index );
/* Function j2s_onplayover (){
Index ++;
PrintPlayer (index );
}*/
Function s2j_onPlayOver (){
Alert ('sssss ');
Index ++;
PrintPlayer (index );
}
</Script>
Running effect: