ToolBoxy
2011年7月30日 星期六
Repeat Youtube v0.4
此工具搬家囉 ~ 0w0
http://youtuberepeat.blogspot.com/
<script src="http://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript"> google.load("swfobject", "2.1"); </script> <script type="text/javascript"> var ytid = ''; //產生播放器 function loadPlayer() { var params = {allowScriptAccess: "always"}; var atts = {id: "ytPlayer"}; swfobject.embedSWF("http://www.youtube.com/v/" + ytid + "?autoplay=1&enablejsapi=1&playerapiid=player1&loop=1", "videoDiv", "853", "510", "8", null, null, params, atts); } //播放前置設定 function go() { //準備影片編號 ytid = youtubecode(ytid); //介面項目顯示 document.getElementById("yturl").value = "http://www.youtube.com/watch?v=" + ytid; document.getElementById("longurl").href = "http://toolboxy.blogspot.com/2011/05/ry.html?http://www.youtube.com/watch?v=" + ytid; document.getElementById("longcode").innerHTML = "http://www.youtube.com/watch?v=" + ytid; document.getElementById("shorturl").href = "http://toolboxy.blogspot.com/2011/05/ry.html?" + ytid; document.getElementById("shortcode").innerHTML = ytid; //清除舊影片區 mom = document.getElementById("videoMom"); mom.innerHTML = ''; //建立新影片區 chi = document.createElement("div"); chi.id = "videoDiv"; mom.appendChild(chi); //啟動播放器 loadPlayer(); } //代碼過濾 function youtubecode(ycode) { if(ycode.indexOf("v=")!=-1) ycode = ycode.substring(ycode.indexOf("v=")+2,ycode.length); if(ycode.indexOf("&")!=-1) ycode = ycode.substring(0,ycode.indexOf("&")); return ycode; } //手動播放 function play() { ytid = document.getElementById("yturl").value; go(); } //按鍵播放 function enterkey() { if (event.keyCode == 13) play(); } function init() { //清空Blogspot介面 clearblogspot(); //取得網址 var url = window.location.toString(); //網址變數存在檢查 if(url.indexOf("?")!=-1) { ytid = youtubecode(url.substring(url.indexOf("?")+1,url.length)); go(); } document.getElementById('yturl').focus(); } window.onload = init; </script> <div align="center"> Youtube Link:<input id="yturl" onkeydown="enterkey()" onclick="document.getElementById('yturl').select();" size="80" type="text" value="http://www.youtube.com/watch?v=L6qjVSieVnQ" /><input onclick="play();" type="button" value="Play" /> <div id="videoMom" style="background-image:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZTbeIZEq0DT8xiqFZ2arao6rIqFZKMPOZTl0nIUQ3SqbqXpLnKCMZ_uUsK-88tUrpTGjPhUqbq8Gx7as3nwUwbe-NGduFm4vWyKccucqOj9y7zvfHwYCogTnXdQIepu8dCh_JS_Kc0yY/); height: 510px; width: 853px;" onclick="play();"> </div> Share formats: <a id="longurl" href="http://toolboxy.blogspot.com/2011/05/ry.html?http://www.youtube.com/watch?v=L6qjVSieVnQ"><span class="Apple-style-span" style="color: #38761d;">http://toolboxy.blogspot.com/2011/05/ry.html</span><span class="Apple-style-span" style="color: red;"><b>?</b></span><span id="longcode" class="Apple-style-span" style="color: blue;">http://www.youtube.com/watch?v=L6qjVSieVnQ</span></a> or <a id="shorturl" href="http://toolboxy.blogspot.com/2011/05/ry.html?L6qjVSieVnQ"><span class="Apple-style-span" style="color: #38761d;">http://toolboxy.blogspot.com/2011/05/ry.html</span><span class="Apple-style-span" style="color: red;"><b>?</b></span><span id="shortcode" class="Apple-style-span" style="color: blue;">L6qjVSieVnQ</span></a></div> Add quick repeat bookmark: <pre class="brush:js;highlight:[0];">javascript:location.href="http://toolboxy.blogspot.com/2011/05/ry.html?"+location.href.split("?v=")[1]; </pre> Notes: 1. 請將以上程式碼加入書籤,名稱隨意自訂。 2. 在需要重複播放的Youtube播放頁面上按下此書籤。 Update records: 2011.05.19 - 重覆播放機能完成。 2011.05.28 - 讀取URL播放機能完成。 2011.05.29 - Enter鍵播放、游標鎖定初始位置。 2011.05.30 - 輸入框改到上方以方面快速貼入網址。 2011.06.03 - 變數擷取機制改寫可減短化播放網址。 2011.07.30 - 快速重複播放書籤。
沒有留言:
張貼留言
沒有留言:
張貼留言