Ckplayer.js Video Playback Plugin

Source: Internet
Author: User

The common function of the webpage is to play the video, the ckplayer.js described below can be played either on the PC side or on the mobile Web page.

Callable Flash can also call the HTML5 player:
<div id= "A1" ></div><script type= "Text/javascript" src= "Ckplayer/ckplayer.js" charset= "Utf-8" > </script><script type= "Text/javascript" >    var flashvars={        f: '/http Movie.ks.js.cn/flv/other/1_0.mp4 ',        C:0,        loaded:' Loadedhandler '    };     var video=[' Http://movie.ks.js.cn/flv/other/1_0.mp4->video/mp4 '];    Ckobject.embed (' ckplayer/ckplayer.swf ', ' A1 ', ' Ckplayer_a1 ', ' ' all ', ' + ',false, Flashvars, Video); </script>

Ckobject.embed (

' Flash Player file path ',

' Container ID ',

' Player ID ',

' width, can be percent ',

' height, can be percent ',

Priority call setting, false= priority call to Flash Player, true= priority call to HTML5 player

Flash Player initialization parameters, as well as HTML5 initialization parameters, such as default play/pause and other settings, detailed can refer to the "description of parameters in Flashvars" This section

HTML5 video playback address, array form, detailed reference to HTML5 Video Call description

)

only flash players are called:
<DivID= "A1"></Div><Scripttype= "Text/javascript"src= "Ckplayer/ckplayer.js"CharSet= "Utf-8"></Script><Scripttype= "Text/javascript">    varFlashvars={f:'http://movie.ks.js.cn/flv/other/1_0.flv', C:0, B:1    }; varparams={bgcolor:'#FFF', allowFullScreen:true, allowScriptAccess:' always', Wmode:'Transparent'}; CKOBJECT.EMBEDSWF ('ckplayer/ckplayer.swf','A1','CKPLAYER_A1',' -',' -', Flashvars,params); </Script>

ckobject.embedswf (' Flash Player path ',

' Place the player's container ID ',

' Player ID ',

' width, percent of support ',

' Height, percent of support ',

Flashvars object, initializes the player parameters,

Related configurations, such as: background color, whether to allow fullscreen, whether to allow interaction, whether the player is transparent

);

call only the HTML5 player:
<DivID= "A1"></Div><Scripttype= "Text/javascript"src= "Ckplayer/ckplayer.js"CharSet= "Utf-8"></Script><Scripttype= "Text/javascript">    varFlashvars={p:1, E:1    }; varVideo=['Http://movie.ks.js.cn/flv/other/1_0.mp4->video/mp4','HTTP://WWW.CKPLAYER.COM/WEBM/0.WEBM->VIDEO/WEBM','Http://www.ckplayer.com/webm/0.ogv->video/ogg']; var Support=[' All']; CKOBJECT.EMBEDHTML5 ('A1','CKPLAYER_A1', -, -, video,flashvars,support);</Script>

CKOBJECT.EMBEDHTML5 (' ID of the container where the player is placed ',

' Player ID ',

' Wide-height, percent support ',

' Height, percent of support ',

Video addresses, arrays, because different platforms support different video formats, so it takes as many video formats as possible to be compatible,

Initializes the configuration parameters, such as whether the default is to play,

Which platforms are used, all means that all platforms are called

);

which

/** Note that the parameters in Flashvars: V:ckplayer_volume, video default volume 0-100, default is 85.    P:ckplayer_play, whether AutoPlay, can be 1 or 0, the default is 1, the parameter is not 1 o'clock when the player is loaded is paused. f:ckplayer_flv, video address, default is empty, can be a separate video address, URL address list file, XML address list file, Flash address file of four cases.    (note corresponding to modify the value of the s parameter, that is, Ckplayer_style) i:ckplayer_loadimg, the video player initial image address, that is, the cover picture, the default is empty.    D:ckplayer_pauseflash, the ad that plays when paused, only supports Flash and picture, default is empty.    U:ckplayer_pauseurl, the link address to play the ad picture when paused, default is empty.    L:CKPLAYER_LOADADV, the ad that is played before the video starts, can be a picture/flash/video format, default is empty.    R:ckplayer_loadurl, the video before the beginning of the advertising link address, mainly for video ads, if it is Flash ads can not fill in, the default is empty.    T:ckplayer_loadtime, the number of seconds the ad plays before the video starts, only valid for Flash or picture, the default is 0. E:ckplayer_endstatus, after the video end of the action, 0 stop playing and send js,1 is not sent JS and re-loop playback, 2 stop playback, the default is 2.        A custom function is required when 0: function Playerstop () {alert ("Play done");  } A:ckplayer_pat, only valid when using Flash encrypted address, need F and s parameter mates, and your custom geturl.swf file mate, f:ckplayer_flv parameter can also be getflv.php?id=[$pat]    Such a format, equivalent to the Flash encrypted address delivery, where Pat is valid, can be passed here by passing parameters after the video playback address to the player. S:ckplayer_style,f parameter transfer mode, 0 is the normal video address, 1 is the video address list file, 2 is the XML address list file, 3 is the Flash encrypted address resolution, the default is 0 ordinary video addressFile playback.    X:ckplayer_xml, skin configuration file, if empty, will use JS file configuration, the default is the official skin ckplayer.xml, to be modified to other skin only need to download after the file name can be changed, such as NetEase skin ckplayer_163.xml.    C:ckplayer_default, read the text configuration, this parameter has a very powerful function, not 0 value when calling the local ckplayer.txt configuration file (such as the outbound reference video only need one parameter) a long story, please go to the website for more details.    B:ckplayer_bgcolor, this parameter adapts to the issue of automatically setting transparency in some forums when calling outside the station.    H:ckplayer_http, which defaults to 0, defines whether the HTTP video stream is dragged by keyframes or by key point-in-time, 0 is by key frame, and 1 is by key point in time.    M:ckplayer_load, the default is 0, 1 does not automatically load the video, choose whether to use the Click play button to load the video, the function of this parameter is to load multiple videos on the same page, some video can not load first, save bandwidth. G:ckplayer_start, the default is 0, the beginning of the skip time, these two parameters can be defined at a specified time to play the function and early end of the function, the use of the function is to record the time the user has played to play directly from the specified time when the video playback,    Second, you can skip the title and the end of the function.    J:ckplayer_ending, ibid., default is 0, early end time. O: Additional parameters, non-ckplayer official parameters, optional, the default is 0, the value is 1 o'clock, can load the external video flash address, such as Youku share Flash address, equivalent to the use of <embed> tags loaded off-site Flash video. **/

Put an example code below:

HTML code:

<id= "Video_c"></div>

CSS code:

#video_c {width:840px; height:353px;margin:0 auto;}

JS Code:

<script type= "Text/javascript" src= "ckplayer/ckplayer.js" ></script><script type= "Text/javascript" >var flashvars={    f:' ckplayer/video/1_0.flv ',    p:0    //I: ' Http://www.ckplayer.com/static/images/letitgo.jpg '//video player Initial image address, that is, the cover picture, default is empty.     }; var video=[' Ckplayer/video/1_0.mp4->video/mp4 ']; Ckobject.embed (' ckplayer/ckplayer.swf ', ' video_c ', ' ckplayer_a1 ', ' 100% ', ' 100% ',false, Flashvars,video); </script>

The results are as follows:

Need to demo hard dot the text, Baidu cloud disk download

Reference Address:

Ckplayer Official website: http://www.ckplayer.com/
Parameter Description Link: http://www.fufuok.com/demo/ckplayer/z.html

Ckplayer.js Video Playback Plugin

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.