在本文中,我們將了解如何設(shè)置在以 HTML 格式下載視頻時(shí)顯示的圖像。
HTML
語(yǔ)法
以下是 HTML 屬性的語(yǔ)法。
<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í)行上述腳本時(shí),它將生成一個(gè)輸出,其中包含上傳的視頻以及使用
示例 2
考慮以下示例,其中我們使用兩個(gè)視頻,其中一個(gè)帶有 屬性。
<!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í)行時(shí),它會(huì)生成一個(gè)由上傳到網(wǎng)頁(yè)的兩個(gè)視頻組成的輸出,其中一個(gè)添加了 HTML 屬性,另一個(gè)是正常的。
以上就是在HTML中,我們?nèi)绾卧O(shè)置在視頻下載時(shí)顯示圖像?的詳細(xì)內(nèi)容,更多請(qǐng)關(guān)注www.92cms.cn其它相關(guān)文章!