Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Play and Pause media for HTML5 using JS/Javascript

function playPauseMedia() {
  if(media.paused) {
    play.setAttribute('data-icon','u');
    media.play();
  } else {
    play.setAttribute('data-icon','P');
    media.pause();
  }
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #Play #Pause #media
ADD COMMENT
Topic
Name
7+6 =