{"id":363,"date":"2024-05-21T12:38:10","date_gmt":"2024-05-21T10:38:10","guid":{"rendered":"https:\/\/blog.sutilweb.eu\/?page_id=363"},"modified":"2024-05-21T12:38:10","modified_gmt":"2024-05-21T10:38:10","slug":"20-audio-y-video","status":"publish","type":"page","link":"https:\/\/sutilweb.eu\/index.php\/lenguajes\/html5\/html5-practico\/20-audio-y-video\/","title":{"rendered":"20. Audio y Video"},"content":{"rendered":"\n<p>Para audio y video existen sus respectiva etiquetas <strong><em>&lt;audio&gt;&lt;\/audio&gt;<\/em><\/strong> para audio, y <strong><em>&lt;video&gt;&lt;\/video&gt;<\/em><\/strong> para video.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">&lt;audio&gt;<\/h2>\n\n\n\n<p>Veamos la sintaxis que hay que utilizar para mostrar un audio en nuestro documento.<\/p>\n\n\n\n<p><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;audio src=\"miaudio.mp3\" controls\"&gt;&lt;\/audio&gt;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">&lt;video&gt;<\/h2>\n\n\n\n<p>La sintaxis es muy parecida a <strong><em>&lt;audio&gt;<\/em><\/strong>, su sintaxis es la siguiente.<\/p>\n\n\n\n<p><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;video src=\"mivideo.mp4\" controls&gt;&lt;\/video&gt;<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>Nota:<\/strong> Ambas etiquetas son etiquetas <strong>en linea<\/strong>, y su dise\u00f1o va a depender del navegador en el que nos encontremos.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Atributos<\/h2>\n\n\n\n<p>Existen algunos atributos que podemos utilizar en ambas etiquetas:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><em>autoplay<\/em><\/strong>: lo que hace es que el audio comienza inmediatamente.<\/li>\n\n\n\n<li><strong><em>loop<\/em><\/strong>: lo que hace es que cuando acaba el audio, vuelve a reproducirlo, lo hace de manera indefinida.<\/li>\n\n\n\n<li><strong><em>mute<\/em><\/strong>: empieza el audio muteado, por lo que hay que ir al control de volumen para subirlo.<\/li>\n\n\n\n<li><strong><em>preload:<\/em><\/strong> lo que hace es precargar en el cach\u00e9 del navegador el track de audio, para que cargue lo antes posible. Recomendable incluirlo siempre en la etiqueta.<\/li>\n\n\n\n<li><strong><em>poster<\/em><\/strong> (solo para <strong><em>&lt;video><\/em><\/strong>): carga una imagen que queramos mostrar mientras el video no se reproduce.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Para audio y video existen sus respectiva etiquetas &lt;audio&gt;&lt;\/audio&gt; para audio, y &lt;video&gt;&lt;\/video&gt; para video. &lt;audio&gt; Veamos la sintaxis que [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":89,"menu_order":19,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-363","page","type-page","status-publish","hentry"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Sutil Web","author_link":"https:\/\/sutilweb.eu\/index.php\/author\/sutilweb\/"},"uagb_comment_info":0,"uagb_excerpt":"Para audio y video existen sus respectiva etiquetas &lt;audio&gt;&lt;\/audio&gt; para audio, y &lt;video&gt;&lt;\/video&gt; para video. &lt;audio&gt; Veamos la sintaxis que [&hellip;]","_links":{"self":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/comments?post=363"}],"version-history":[{"count":2,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/363\/revisions"}],"predecessor-version":[{"id":365,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/363\/revisions\/365"}],"up":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/89"}],"wp:attachment":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/media?parent=363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}