在本文中,我們將了解如何設(shè)置在以 HTML 格式下載視頻時顯示的圖像。
HTML
語法
以下是 HTML 屬性的語法。
<video poster="URL">
登錄后復(fù)制
讓我們深入研究以下示例,您可以在其中了解有關(guān) HTML 屬性的更多信息。
示例 1
在以下示例中,我們使用
<!DOCTYPE html>
<html>
<body>
<center>
<video width="340" height="220" controls poster="https://www.tutorialspoint.com/static/images/logo-color.png">
<source src="https://samplelib.com/lib/preview/mp4/sample-5s.mp4" type="video/mp4">
</video>
</center>
</body>
</html>
登錄后復(fù)制
執(zhí)行上述腳本時,它將生成一個輸出,其中包含上傳的視頻以及使用
示例 2
考慮以下示例,其中我們使用兩個視頻,其中一個帶有 屬性。
<!DOCTYPE html>
<html>
<body>
<center>
<video width="340" height="220" controls poster="https://www.tutorialspoint.com/images/logo.png">
<source src="https://samplelib.com/lib/preview/mp4/sample-5s.mp4">
</video>
<video width="320" height="240" controls>
<source src="https://samplelib.com/lib/preview/mp4/sample-30s.mp4">
</video>
</center>
</body>
</html>
登錄后復(fù)制
當(dāng)腳本執(zhí)行時,它會生成一個由上傳到網(wǎng)頁的兩個視頻組成的輸出,其中一個添加了 HTML 屬性,另一個是正常的。
以上就是在HTML中,我們?nèi)绾卧O(shè)置在視頻下載時顯示圖像?的詳細(xì)內(nèi)容,更多請關(guān)注www.92cms.cn其它相關(guān)文章!






