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

<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>

上一篇:layui中select的change事件、动态追加option


下一篇:商品管理系统