title: How to play video by entering URL through input field using javascript
body: <p>I am trying to make a page so that I can enter a URL through the input field and on submitting it will play the video. But unfortunately it's not happening like that.<br>
  I am working with a local file on my PC.<br></p>
  
  <p><strong>JavaScript</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>window.onload=function(){
       alert('Your video player is Here');
  }
  function play(){
      var path  = document.getElementById("path").value;
      document.getElementById('show').innerHTML='&lt;video id="movie" src="'+url+'" height="600px" width="1300px" controls autoplay &gt; &lt;/video&gt;';
      var player =document.getElementById('movie');
      player.load();
      alert(''+player.duration);
  }
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;input type="text" id="path" placeholder="put movie path"/&gt;
      &lt;input type="submit" onclick="play();" value="Play on"/&gt;
      &lt;div id="show"&gt;&lt;/div&gt;
  </code></pre>