首页 > Web开发 > 详细

html5 可以讓使用者輸入url網址 ,去play影片

时间:2014-11-19 17:57:53      阅读:284      评论:0      收藏:0      [点我收藏+]

<html>
  <head>
    <title>Simple Video Example</title>      
     <script>

         function playVideo(e) {
           var video = document.getElementById(‘video1‘);      //video element
           var input = document.getElementById(‘videoFile‘);   //text box                   
           if (input.value != video.src) {
              video.src = input.value;
           }
           video.load();
           video.play();         
         }
     </script>
</head>
<body>
<video id="video1" width="640" height="360" controls >HTML5 video is not supported</video><br />
<input type="text" id="videoFile" size="60" placeholder="Enter video file URL here"/>
  <button onclick="playVideo(this);">Play</button>
</body>
</html>  

html5 可以讓使用者輸入url網址 ,去play影片

原文:http://www.cnblogs.com/mysterywho/p/4108406.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!