<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # HTML 5 Video + DOM ## HTML5 &lt;video&gt; - 使用 DOM 進行控制 HTML5 &lt;video&gt; 元素同樣擁有方法、屬性和事件。 其中的方法用于播放、暫停以及加載等。其中的屬性(比如時長、音量等)可以被讀取或設置。其中的 DOM 事件能夠通知您,比方說,&lt;video&gt; 元素開始播放、已暫停,已停止,等等。 下例中簡單的方法,向我們演示了如何使用 &lt;video&gt; 元素,讀取并設置屬性,以及如何調用方法。 ### 實例 為視頻創建簡單的播放/暫停以及調整尺寸控件: ``` <!DOCTYPE html> <html> <body> <div style="text-align:center;"> <button onclick="playPause()">播放/暫停</button> <button onclick="makeBig()">大</button> <button onclick="makeNormal()">中</button> <button onclick="makeSmall()">小</button> <br /> <video id="video1" width="420" style="margin-top:15px;"> <source src="/example/html5/mov_bbb.mp4" type="video/mp4" /> <source src="/example/html5/mov_bbb.ogg" type="video/ogg" /> Your browser does not support HTML5 video. </video> </div> <script type="text/javascript"> var myVideo=document.getElementById("video1"); function playPause() { if (myVideo.paused) myVideo.play(); else myVideo.pause(); } function makeBig() { myVideo.width=560; } function makeSmall() { myVideo.width=320; } function makeNormal() { myVideo.width=420; } </script> </body> </html> ``` 上面的例子調用了兩個方法:play() 和 pause()。它同時使用了兩個屬性:paused 和 width。 ## HTML5 &lt;video&gt; - 方法、屬性以及事件 下面列出了大多數瀏覽器支持的視頻方法、屬性和事件: | 方法 | 屬性 | 事件 | | --- | --- | --- | | play() | currentSrc | play | | pause() | currentTime | pause | | load() | videoWidth | progress | | canPlayType | videoHeight | error | | duration | timeupdate | | ended | ended | | error | abort | | paused | empty | | muted | emptied | | seeking | waiting | | volume | loadedmetadata | | height | | width | 注釋:在所有屬性中,只有 videoWidth 和 videoHeight 屬性是立即可用的。在視頻的元數據已加載后,其他屬性才可用。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看