我想知道如何将 Youtube 视频放到 html 页面。我已经搜索了几个小时,这是我尝试过的:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type='text/javascript' src='Scripts/swfobject.js'></script>
<script type='text/javascript'>
swfobject.registerObject("playerID", "9.0.0");
</script>
<script type='text/javascript' src='Scripts/mediaplayer/jwplayer.js'></script>
</head>
<body>
<script type='text/javascript' src='Scripts/mediaplayer/jwplayer.js'></script>
<div id='mediaplayer'></div>
<script type="text/javascript">
var flashvars = {
'file': 'http://www.youtube.com/watch?v=YE7VzlLtp-4',
'controlbar': 'bottom'
};
var params = {
'allowfullscreen': 'true',
'allowscriptaccess': 'always'
};
var attributes = {
'id': 'playerID',
'name': 'playerID'
};
swfobject.embedSWF('Scripts/mediaplayer/player.swf', 'mediaplayer', '480', '360', '9', 'false', flashvars, params, attributes);
</script>
</body>
</html>
和
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type='text/javascript' src='./Scripts/swfobject.js'></script>
</head>
<body>
<script type='text/javascript' src='./Scripts/mediaplayer/jwplayer.js'></script>
<div id='mediaspace'>This text will be replaced</div>
<script type='text/javascript'>
jwplayer('mediaspace').setup({
'flashplayer': './Scripts/mediaplayer/player.swf',
'file': 'http://www.youtube.com/v/K_sev04KfeU?version',
'controlbar': 'bottom',
'width': '470',
'height': '320'
});
</script>
</body>
</html>
和
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type='text/javascript' src='./Scripts/mediaplayer/jwplayer.js'></script>
</head>
<body>
<div id='mediaplayer'></div>
<script type="text/javascript">
jwplayer('mediaplayer').setup({
'flashplayer': './Scripts/mediaplayer/player.swf',
'id': 'playerID',
'width': '480',
'height': '270',
'file': 'XSGBVzeBUbk',
'provider': 'youtube',
'plugins': {
'hd-2': {}
}
});
</script>
</body>
</html>
和数十种变化(包括 registerObject)......我想知道是否有人可以给我一个示例 .zip 链接。