Starter: Personal blogs, continuous updates and corrections
I always thought that it was complicated to embed video in a Web page, and it was very simple to study it.
The actual thing is to embed a control in the page. There are already many solutions in the community. Jwplayer is the most popular (one).
Controls include JS, CSS, and SWF files, the SWF file is the player, it is part of the control, and the introduction of the control package is the same as introducing other front-end control package methods, which can be copied to the project path.
The video is an FLV file, where the FLV files are all right. Personal advice to put a separate server like a picture.
Sample program here, the code has been uploaded to GitHub.
Jwplayer itself document here, hidden very deep, personal very dislike this official website, gaudy, the claws.
Official documents I still like the simple and simple kind.
The web code and its simplicity, that's all:
<! Doctype>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<title>use jw</title>
<script src= "Jwplayer/jwplayer.js" ></script>
<!--is not unique to each user ID, the unique website to the only, do not change--
<script>jwplayer.key= "baonhra71ke/mhvb0sirt4hewltakpiya1mvsa==";</script>
<body>
<div id= "MyElement" >loading the player...</div>
<script type= "Text/javascript" >
var playerinstance = Jwplayer ("myelement");
Playerinstance.setup ({
File: "http://img.zidafone.com/test.flv",
Image: "Http://img.zidafone.com/test.jpg",
width:640,
Height:360,
Title: ' Beautiful Woman ',
Description: ' The most beautiful woman in the world, does you agree? '
});
</script>
</body>
Long-term welcome project Cooperation Opportunity Introduction, project income 10% to reward introducer. Sina Weibo: @ Cold Mirror, qq:908789432.
Embed video in Web pages using Jwplayer