How to embed video in Web pages using the Ckplayer plugin (Common Note 2)

Source: Internet
Author: User

In the Web site sometimes we need to embed video in the Web, general video embedded in the following ways:

1. Youku Code Embedding

Advantages: simple, convenient and reliable.

Cons: There are ads, now the site is very focused on user experience, if you open an online video is a long ad will certainly crash.

2. Embed video with <object> tags

Advantages: Also more convenient, good for SWF.

Cons: If you play WMV format, it's funny to open with chrome, sometimes prompting you to install the Media Player plugin, sometimes without a reminder. This means that cross-browser capabilities are insufficient.

Different video formats are not the same code, too cumbersome.

3. Use of <video> tags

Pros: HTML5 new label, good for mobile phone side

The disadvantage of the:html5<video> tag is only three formats, as well as coding requirements. In addition, if you want to achieve video control, such as: Play size, color, play drag also have to write JS code.

4. Use third-party playback plugin Ckplayer

Pros: Support for most browsers, as well as video control, sharing, switching lights, inserting ads and more settings. If you are JS Daniel can also modify the functions of their own

Cons: The best format I've measured down to support Ckplayer is the MP4 format video encoded by H. Other formats are more or less a little bit problematic.

website address: http://www.ckplayer.com

Note: Be sure to download the Ckplayer related folder and place it in the root directory before embedding the code.

Embed code:

<div id="A1"></div> <script type="Text/javascript"Src="Ckplayer/ckplayer.js"charset="Utf-8"></script> <script type="Text/javascript">varFlashvars ={f:'/movie/123.mp4', C:0, Loaded:'Loadedhandler'        }; varVideo = ['Http://movie.ks.js.cn/flv/other/1_0.mp4->video/mp4']; Ckobject.embed ('ckplayer/ckplayer.swf','A1','CKPLAYER_A1',' -',' -',false, Flashvars, video); </script>

F: You need to fill in your video address here;

Note the correctness of the SRC address and the correctness of the first SWF address in embed.

To remove adjustments, share, switch light settings can:

To change the logo in the middle of the player (which appears when loading the player), and the logo in the upper right corner of the player, you can:

More features you can view the development manual on your own website. That's all I'm using. Want to be able to use what code in the site to embed video and worry about the yard of a direction.

How to embed video in Web pages using the Ckplayer plugin (Common note 2)

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.