视频格式在页面展示
第一種:.mp4格式
<!DOCTYPE html> <html lang="en"> <head><meta charset="UTF-8"><title>video格式demo</title> </head> <body><!--視頻路徑:--><h1>video</h1><video src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" controls="controls"></video><h1>embed</h1><embed src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" width="800" height="510"/><h1>object</h1><object width="800" height="510"><param id="video_value" name="movie" value=""></param><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent"></param><embed src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" width="800" height="510" allowFullScreen="true" wmode="transparent" allowScriptAccess="always"></embed></object><h1>iframe</h1><iframe frameborder="0" src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" allowfullscreen></iframe></body> </html>第二種:各大門戶網(wǎng)站的分享通用代碼(注意插入網(wǎng)頁請(qǐng)求時(shí),https與http兼容情況)
<!DOCTYPE html><html lang="en">
<head>
<meta charset="UTF-8">
<title>各大視頻網(wǎng)站通用代碼</title>
</head>
<body>
<h1>騰訊</h1>
<iframe frameborder="0" src="https://v.qq.com/txp/iframe/player.html?vid=d0031p73m0p" allowFullScreen="true" width="800" height="510"></iframe>
<h1>愛奇藝</h1>
<iframe src="http://open.iqiyi.com/developer/player_js/coopPlayerIndex.html?vid=9657dcdbaeab8a2147cdf0757ca247bd&tvId=3325765400&accessToken=2.f22860a2479ad60d8da7697274de9346&appKey=3955c3425820435e86d0f4cdfe56f5e7&appId=1368&height=100%&width=100%" frameborder="0" allowfullscreen="true" width="800" height="510"></iframe>
<h1>優(yōu)酷</h1>
<iframe src='http://player.youku.com/embed/XNDIyMjQ5Njc4MA==' frameborder=0 'allowfullscreen' width="800" height="510"></iframe>
<h1>網(wǎng)易公開課</h1>
<object width="640" height="360"><param name="movie" value="//open.163.com/openplayer/-MBM8NF28C-MBM8NT807-http://open-image.nosdn.127.net/9c6ee8d9cd17487f8ce775de75b5d91b.jpg-openPlayer.swf?isUserAutoPlay=1"></param><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent"></param><embed src="//open.163.com/openplayer/-MBM8NF28C-MBM8NT807-http://open-image.nosdn.127.net/9c6ee8d9cd17487f8ce775de75b5d91b.jpg-openPlayer.swf?isUserAutoPlay=1" type="application/x-shockwave-flash" width="800" height="510" allowFullScreen="true" wmode="transparent" allowScriptAccess="always"></embed></object>
</body>
</html>
問題報(bào)錯(cuò):參考:https://blog.csdn.net/w377120838/article/details/80590053
當(dāng)https 連接中包含加載http資源時(shí),瀏覽器會(huì)停止加載,瀏覽器console 會(huì)打印如下信息:
Mixed Content: The page at 'https://Xie.cn/' was loaded over HTTPS, but requested an insecure resource 'http://xm/m/vYby6nm?mobile=1'. This request has been blocked; the content must be served over HTTPS.
解決方案一:
在html文件的head標(biāo)簽中添加<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"
當(dāng)瀏覽器支持“upgrade-insecure-requests”屬性時(shí),會(huì)自動(dòng)將http鏈接替換為https
解決方案二:
將連接中的算有http連接更換為https
而對(duì)于移動(dòng)端,<embed >標(biāo)簽是不支持的
轉(zhuǎn)載于:https://www.cnblogs.com/ljangle/p/11194657.html
總結(jié)
- 上一篇: Python基础 | 快速实现label
- 下一篇: DNSPod十问杨晓东:从.cn看中国互