方法一:
1:先上傳視頻到視頻網站
建議視頻上傳到b站(嗶哩嗶哩www.bilibili.com),如果上傳到優酷,打開自己的網站看視頻的時候可能會有廣告。
2:打開視頻網站,找到視頻,點分享,點嵌入代碼,復制。
嵌入代碼如下:
<iframe src="//player.bilibili.com/player.html?aid=481778628&bvid=BV1mT411Q72R&cid=1007794050&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>
3:網站后臺-點源碼,粘貼
4:網站后臺-回到編輯框 點iframe,選擇編輯器里面的居中
5:網站后臺-回到編輯框 點iframe,點鼠標右鍵,選擇iframe屬性,調整視頻寬度和高度
此方法的優點是不占用自己網站服務器空間和流量
方法二:
1:先上傳視頻到自己網站根目錄/images/video.mp4
網站后臺-源碼
<video controls="controls" height="448" style="margin-left:200px" width="800"><source src="/images/video.mp4" type="video/mp4"/><object data="/images/video.mp4" height="448" width="800"><embed height="448" src="/images/video.mp4" width="800"/></object></video>
此方法會占用自己網站服務器空間和流量