• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Difference between revisions of "Widget:AudioPlayer"

From Kancolle Wiki
Jump to navigation Jump to search
m
 
(4 intermediate revisions by the same user not shown)
Line 8: Line 8:
 
<div>
 
<div>
 
     <button onclick="document.getElementById('player').play()">Play</button>
 
     <button onclick="document.getElementById('player').play()">Play</button>
    <button onclick="document.getElementById('player').pause()">Pause</button>
+
     <button onclick="document.getElementById('player').muted=!document.getElementById('player').muted">Mute</button>
     <button onclick="document.getElementById('player').muted=!document.getElementById('player').muted">Mute/ Unmute</button>
 
 
</div>
 
</div>
 
<audio id="myTune">
 
<source src="https://yksk.kancollewiki.net/w/images/a/a4/Ayanami_Mid_Autumn2015.ogg">
 
</audio>
 
<div class="btn-group btn-group-xs">
 
 
<a href="javascript:void(0)" class="btn btn-default" data-toggle="tooltip" title="Preview" onclick="aud_play_pause()"><i id="stateicon" class="fa fa-play"></i></a>
 
  
 
<script>
 
<script>
  function aud_play_pause() {
+
     var audioplayer = document.getElementById("player");
     var myAudio = document.getElementById("myTune");
+
     player.volume = 0.25;
     if (myAudio.paused) {
+
</script>
      $('#stateicon').removeClass('fa fa-play');
 
      $('#stateicon').addClass('fa fa-pause');
 
      myAudio.play();
 
    } else {
 
      $('#stateicon').removeClass('fa fa-pause');
 
      $('#stateicon').addClass('fa fa-play');
 
      myAudio.pause();
 
  }
 
}
 
  
 
</includeonly>
 
</includeonly>

Latest revision as of 06:15, 1 November 2020

Test