実行結果
設置サンプル
参照:jQuery YouTube Plugin
設置サンプルのソース
<!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" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="ja" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
<title>設置サンプル</title>
<link rel="stylesheet" type="text/css" href="/content/lib/global.css" />
<!-- JS -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" ></script>
<script type="text/javascript" src="/content/lib/jquery/jquery.youTube.js"></script>
<script type="text/javascript">
$(function(){
$('.youtube-videos').youTube({
videoHeader : 'YouTube動画検索「オムライス」'
,results : 5 /* number of results to return / display */
,query : 'オムライス'
,orderBy : null /* what to order the results by */
,author : null /* author of the video */
,showRatings : false /* Display the rating stars assigns a class of 00,05,10,15,20,25,30,35,40,45,50 */
,showNumRatings : true /* Displays the actual number of ratings */
,showViews : true /* show number of views for the video */
,showDescription : true /* show a clipped version of the video description */
,descriptionLength : 150 /* length of the description to bring back, will append ... to the end */
,thumbnail : 'small' /* small: 120x90 | large: 480 x 360 */
});
});
</script>
<!-- CSS -->
<style type="text/css">
p { margin:0; padding:0; }
.video-item {
margin:10px; padding:0;
width:120px;
float:left;
}
.video-thumb {
margin:0; padding:0;
}
.video-info {
margin:0; padding:0;
}
.video-desc {
margin:0; padding:0;
}
.video-info div {
margin:0; padding:0;
}
</style>
<link rel="stylesheet" type="text/css" href="/common/css/example.css"></head>
<body id='example3' class='example'><div class="ads" style="margin:32px auto;text-align:center;"></div><h1 class='h'><a href='/'>PHP & JavaScript Room</a> :: 設置サンプル</h1>
<h3 class='h'>実行結果</h3>
<h1>設置サンプル</h1>
<p>参照:<a href='http://www.webdevkungfu.com/jquery-youtube-plugin/' target='_blank'>jQuery YouTube Plugin</a></p>
<!-- CODE -->
<div class="youtube-videos"></div>
<br clear="all" />
<!-- / CODE -->
</body>
</html>