title: Having an issue with HTML audio/video
body: <p>basically what I am trying to achieve is this audio player in HTML play the audio and the video when the play button is clicked and vise versa for pause. This is my code.</p>
  
  <pre><code>&lt;div style="text-align:center"&gt; 
  &lt;img src="img/playpause.jpg" onclick="playPause()"&gt;
    &lt;br&gt; 
    &lt;video id="video1" width="1200" &gt;
      &lt;source src="pjds.mp4" type="video/mp4"&gt;
      &lt;source src="pjds.ogg" type="video/ogg"&gt;
      Oops, your browser doesn't support me :(
    &lt;/video&gt;
  &lt;/div&gt; 
  &lt;script&gt;  
  var myVideo = document.getElementById("video1"); 
  function playPause() { 
      if (myVideo.paused) 
          myVideo.play(); 
      else 
          myVideo.pause(); 
  } 
  &lt;/script&gt; 
  &lt;audio controls&gt;
      &lt;source src="ay.ogg" type="audio/ogg" onclick="playPause()"&gt;
      &lt;source src="ay.mp3" type="audio/mpeg"&gt;
      Your browser does not support the audio element.
  &lt;/audio&gt;
  </code></pre>
  
  <p>Any help is greatly appreciated, thanks. </p>