久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      利用HTML5 從視頻中捕獲靜止圖像實(shí)例代碼

      一個(gè)簡(jiǎn)單的例子展示了如何從視頻中捕獲靜止圖像。下面來看一下

      假設(shè)你有下面的HTML代碼:

      <video id="video" controls="controls">      <source src=".mp4" />  </video>     <button id="capture">Capture</button>     <p id="output"></p>

      然后,當(dāng)用戶單擊“捕獲”按鈕,我們將當(dāng)前的視頻內(nèi)容寫入到一個(gè)畫布,并使用在畫布上顯示圖像。

      (function() {      "using strict";         var $video, $output;      var scale = 0.25;         var initialize = function() {          $output = $("#output");          $video = $("#video").get(0);          $("#capture").click(captureImage);                     };         var captureImage = function() {          var canvas = document.createElement("canvas");          canvas.width = $video.videoWidth * scale;          canvas.height = $video.videoHeight * scale;          canvas.getContext('2d')                .drawImage($video, 0, 0, canvas.width, canvas.height);             var img = document.createElement("img");          img.src = canvas.toDataURL();          $output.prepend(img);      };      $(initialize);             }());

      【相關(guān)推薦】

      1. 免費(fèi)h5在線視頻教程

      2. HTML5 完整版手冊(cè)

      3. php.cn原創(chuàng)html5視頻教程

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)