search

Home  >  Q&A  >  body text

javascript - js implements custom media player

  <p class="controls">
        <input type="button" value="Play" id="video-btn">
        <span id="curtime">0</span>/<span id="duration">0</span>
    </p>
</p>
<script>
    window.onload = function(){

        //get references to the elements
        var player = document.getElementById("player");
        var btn = document.getElementById("video-btn");
        var curtime = document.getElementById("curtime");
        var duration = document.getElementById("duration");
        ***duration.innerHTML = player.duration;***

Ask the master, why do you need to set duration.innerHTML = player.duration here? Wouldn’t it still work if you don’t set it?

阿神阿神2753 days ago554

reply all(1)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-19 10:30:03

    Found the solution

    reply
    0
  • Cancelreply