実行結果
設置サンプル
参照:OEmbed plugin for jQuery
例:Flickrの写真を埋め込む
php_javascript_room, on Flick
例:各種コンテンツを埋め込み
YouTube
Vimeo(自動再生の有無、テキストの色など指定可)
Flickr
twitpic
Slideshare
Wikipedia
設置サンプルのソース
<!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.oembed.js"></script>
<script type="text/javascript">
$(function(){
/* sample1 */
$("#photo").oembed(
"http://www.flickr.com/photos/22559849@N06/5335062455/",
{maxWidth:200, maxHeight:200}
);
$(".oembed").oembed(
null,
{vimeo:{color:"ff6699", portrait:false, autoplay:false},maxWidth:300,maxHeight:300}
);
});
</script>
<!-- CSS -->
<style type="text/css">
h3 { margin:20px 0 0 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://code.google.com/p/jquery-oembed/' target='_blank'>OEmbed plugin for jQuery</a></p>
<!-- CODE -->
<h2>例:Flickrの写真を埋め込む</h2>
<div id="photo">php_javascript_room, on Flick</div>
<h2>例:各種コンテンツを埋め込み</h2>
<h3>YouTube</h3>
<div><a href="http://www.youtube.com/watch?v=9YEEl52u8XE" class="oembed">YouTube Video</a></div>
<h3>Vimeo(自動再生の有無、テキストの色など指定可)</h3>
<div><a href="http://vimeo.com/17621410" class="oembed">Vimeo Video</a></div>
<h3>Flickr</h3>
<div><a href="http://www.flickr.com/photos/22559849@N06/5335062455/" class="oembed">Flickr Image</a></div>
<h3>twitpic</h3>
<div><a href="http://twitpic.com/2zhvap" class="oembed">Twitpic Image</a></div>
<h3>Slideshare</h3>
<div><a href="http://www.slideshare.net/williswee/top-50-facebook-pages-2009-2624154" class="oembed">Slideshare - Top 50 Facebook Pages 2009</a></div>
<h3>Wikipedia</h3>
<div style="border:1px solid #ccc;background:#eee;padding:10px;"><a href="http://ja.wikipedia.org/wiki/Vimeo" class="oembed">Vimeo - Wikipedia</a></div>
<!-- / CODE -->
</body>
</html>