原文請點這裡--> 讓 Youtube 影片從特定時間開始播放
簡單來說一般我們轉PO Youtube的影片有兩種方式
1.貼上影片網址
2.貼上嵌入embed語法
如果轉貼網址只需要在網址尾端加上「#t=?m?s」or「#t=?s」,例如「#t=1m23s」or「#t=83s」就表示從影片的1分23秒的地方開始播放。
例如:http://www.youtube.com/watch?v=FqQi2EEx9QI&feature=player_embedded#t=83s
如果是embed語法則一定要改成以秒為單位,語法=「&start=?」同樣如果你要的播放的時間是2分22秒= 142秒語法就是「&start=142」把語法加入embed語法內
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/PWbhPh7n2xw&color1=0xb1b1b1&color2=0xcfcfcf&feature=player_embedded&fs=1&start=142"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/PWbhPh7n2xw&color1=0xb1b1b1&color2=0xcfcfcf&feature=player_embedded&fs=1&start=142" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></object>
示範影片如下:
if(window.$WebSecurity){window.$WebSecurity.FlashDetection.HandleEmbedCode('b9d00a7d-59d8-4eac-98a8-372fb1689125', '\x3cembed wmode\x3d\x22opaque\x22 src\x3d\x22http\x3a\x2f\x2fwww.youtube.com\x2fv\x2fPWbhPh7n2xw\x26amp\x3bcolor1\x3d0xb1b1b1\x26amp\x3bcolor2\x3d0xcfcfcf\x26amp\x3bfeature\x3dplayer_embedded\x26amp\x3bfs\x3d1\x26amp\x3bstart\x3d142\x22 type\x3d\x22application\x2fx-shockwave-flash\x22 height\x3d\x22344\x22 width\x3d\x22425\x22 pluginspage\x3d\x22http\x3a\x2f\x2fwww.macromedia.com\x2fgo\x2fgetflashplayer\x22 allowscriptaccess\x3d\x22never\x22 allownetworking\x3d\x22internal\x22 \x2f\x3e');}else{if(window.flObj == null){window.flObj = new Object();}window.flObj['b9d00a7d-59d8-4eac-98a8-372fb1689125']='\x3cembed wmode\x3d\x22opaque\x22 src\x3d\x22http\x3a\x2f\x2fwww.youtube.com\x2fv\x2fPWbhPh7n2xw\x26amp\x3bcolor1\x3d0xb1b1b1\x26amp\x3bcolor2\x3d0xcfcfcf\x26amp\x3bfeature\x3dplayer_embedded\x26amp\x3bfs\x3d1\x26amp\x3bstart\x3d142\x22 type\x3d\x22application\x2fx-shockwave-flash\x22 height\x3d\x22344\x22 width\x3d\x22425\x22 pluginspage\x3d\x22http\x3a\x2f\x2fwww.macromedia.com\x2fgo\x2fgetflashplayer\x22 allowscriptaccess\x3d\x22never\x22 allownetworking\x3d\x22internal\x22 \x2f\x3e';}
沒有留言:
張貼留言