最近應(yīng)為淘寶視頻的規(guī)則變動(dòng),導(dǎo)致經(jīng)常會(huì)在刷新頁面時(shí)候出現(xiàn)淘寶視頻服務(wù)器鏈接不上導(dǎo)致頁面克頓的情況。通過下面的方法可以讓淘寶視頻速度加快。
假設(shè)我們從淘寶視頻上獲取到的代碼是這樣的:(獲取淘寶視頻方法)
<script src='http://api.video.taobao.com//video/getPlayerJS' ></script > <script src='http://api.video.taobao.com//video/embedVideo?vid=224815343472&uid=740635139&tid=1&autoplay=false' ></script >
將上述代碼中第二句中的鏈接地址在瀏覽器打開(注意!每個(gè)視頻的鏈接是不一樣的)
http://api.video.taobao.com//video/embedVideo?vid=224815343472&uid=740635139&tid=1&autoplay=false
獲得如下類似代碼(可能需要多刷新記下,注意!每個(gè)視頻的代碼是不一樣的)
(function(d){ d.write('<div id="tb_player_2454498"></div>'); function handler(){ tb_player_object.embedPlayer({ "vid":"224815343472", "div":"tb_player_2454498", "uid":"740635139", "width":"100%", "tid":"1", "height":"100%" }, {"autoplay":false}, {"allowFullScreen":true,"allowScriptAccess":"always","wmode":"transparent" });} handler();})(document);
根據(jù)上一步得到的代碼替換如下代碼中對(duì)應(yīng)的部分
<script src='/tbvideo.js'></script> <script> /** 以下是上一步得到的代碼 **/ (function(d){ d.write('<div id="tb_player_2454498"></div>'); function handler(){ tb_player_object.embedPlayer({ "vid":"224815343472", "div":"tb_player_2454498", "uid":"740635139", "width":"100%", "tid":"1", "height":"100%" }, {"autoplay":false}, {"allowFullScreen":true,"allowScriptAccess":"always","wmode":"transparent" });} handler();})(document); /** 以上上一步得到的代碼 **/ </script>
以上得到的就是網(wǎng)頁上可以使用的淘寶視頻代碼
備注(本教程僅適用于態(tài)度云1.0系統(tǒng))