--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- php
淘寶店鋪:html
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------瀏覽器
想要在網頁中嵌入優酷、土豆、愛奇藝的視頻很簡單,可是如今將騰訊視頻嵌入網頁後卻不能正常顯示,而騰訊視頻如今的資源也愈來愈多,想直接將騰訊視頻嵌入到網頁中怎麼操做呢?其實只須要一段代碼就能夠了。微信
首先,提供一個騰訊視頻嵌入網頁代碼。咱們只需替換這段代碼的一部分就能夠了。微信公衆平臺
<p style="text-align: center"><iframe class="video_iframe" style="z-index:1;" src="http://v.qq.com/iframe/player.html?vid=t01662frswa&width=500&height=375&auto=0" allowfullscreen="" frameborder="0" height="375" width="500"></iframe></p>ide
找到一段騰訊視頻,好比地址:學習
http://v.qq.com/boke/page/d/0/i/d0163kxz8di.html網站
這是一段《工業機器人工做場景》的視頻,將這個網址的藍色部分,替換到上面給出的代碼中的紅色部分,就能夠了。ui
最終效果爲:url
<p style="text-align: center"><iframe class="video_iframe" style="z-index:1;" src="http://v.qq.com/iframe/player.html?vid=d0163kxz8di&width=500&height=375&auto=0" allowfullscreen="" frameborder="0" height="375" width="500"></iframe></p>
把vid參數從騰訊視頻網頁查找
想將優酷視頻、土豆視頻、新浪視頻等網站的視頻調用到我的網站上面的方法很是簡單,這些網站,均提供了直接調用的代碼。以下圖所示:
一、優酷網
二、土豆網
三、新浪視頻
可是騰訊視頻則是這樣的(並無提供嵌入網頁的代碼):
應該怎麼辦呢?
能夠從微信公衆平臺中學習一下,由於騰訊視頻,能夠直接嵌入微信公衆平臺啊?點擊查看:微信公衆平臺轉載別人發的視頻的方法
方法一:將視頻在微信公衆平臺中的調用代碼提取出來,以下所示:
<iframe class="video_iframe" style=" z-index:1; " src="http://v.qq.com/iframe/player.html?vid=m0137rrajuc&width=300&height=200&auto=0" allowfullscreen="" frameborder="0" height="200" width="300"></iframe>
打開須要添加的騰訊視頻網址,例如:http://v.qq.com/cover/z/zrxyhghf3n8xhxl/k0015trfczz.html
將上述代碼中的vid=後面的內容替換成上述網址中標紅的部分,而後將上述網址從新複製出來:
<iframe class="video_iframe" style=" z-index:1; " src="http://v.qq.com/iframe/player.html?vid=k0015trfczz&width=300&height=200&auto=0" allowfullscreen="" frameborder="0" height="200" width="300"></iframe>
效果參見下方:
其中的視頻的寬度(width)和高度(height)能夠分別經過修改代碼中對應的數值(本視頻中width=300,height=200)來進行修改。
不自動播放
<iframe class="video_iframe" style=" z-index:1; " src="http://v.qq.com/iframe/player.html?vid=k0344pfymze&tiny=0&auto=0&isAutoPlay=false;width=300&height=200&auto=0" allowfullscreen="" frameborder="0" height="200" width="300"></iframe>