在寻找时,音频会一直回到开头

时间:2017-08-16 21:13:55

标签: html html5 audio twig

我有一个<audio>元素,似乎工作正常。但是,每当我尝试使用导引头时,它只会将音频带回到开头。这是HTML:

<audio id="audio-player" src="/music/You-Too-Much.mp3" type="audio/mp3" controls="controls"></audio>

我已经在线搜索过,但我似乎无法找到原因或解决方法。我需要这个固定的。感谢。

完整的HTML代码:

{% extends 'base.html.twig' %}
{% block title %}
Welcome
{% endblock %}
{% block nav_head %} Havilah Radio {% endblock %}
{% block content %}
<div class="music-player">
  <div class="row">
    <div class="col-md-3">
      <img class="cover" src="/img/album-art/HANILAH.jpg" alt="">
      <div class="footer-song-info">
        <h4>
          You Too Much
        </h4>
        <h6>Unknown Artist</h6>
      </div>
    </div>
    <div class="col-md-6">
      <audio id="audio-player" src="/music/untitled05.mp3" type="audio/mp3" controls="controls"></audio>
    </div>
  </div>
</div>
{% endblock %}

主要代码扩展了这个base.html.twig:

<!DOCTYPE html>
<!--suppress HtmlUnknownTarget -->
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="theme-color" content="#9e1935">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>{% block title %}{% endblock %} | Havilah Radio</title>

  <link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Fira+Sans' />
  <!-- Bootstrap CSS -->
  <link href="{{ asset('lib/bootstrap/css/bootstrap.css') }}" rel="stylesheet" type="text/css" media="all"/>

  <!-- Font Icons -->
  <link href="{{ asset('lib/iconsmind/iconsmind.css') }}" rel="stylesheet" type="text/css" media="all"/>

  <!-- Extra CSS -->
  {% block css %}{% endblock %}

  <!-- Custom CSS -->
  <link href="{{ asset('css/style.css') }}" rel="stylesheet" type="text/css" media="all"/>
</head>
<body style="background: {% block body_background %}#fff {% endblock %}">
  <div class="body">
    <nav class="navbar navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-nav">
            <i class="icon-Align-Right icon"></i>
          </button>
          <a class="navbar-brand" href="/"><img src={{ asset('img/havilahradio-logo.png') }} />
            &nbsp;&nbsp;&nbsp;
          </a>
        </div>
        <div class="collapse navbar-collapse" id="navbar-nav">
        </div>
      </div>
    </nav>
    {% block content %}{% endblock %}
  </div>
</body>

<!-- JQuery -->
<script src="{{ asset('lib/jquery/jquery-3.1.0.min.js') }}"></script>
<script src="{{ asset('lib/jquery/jquery.easing.1.3.js') }}"></script>

<!-- Bootstrap JS -->
<script src="{{ asset('lib/bootstrap/js/bootstrap.min.js') }}" ></script>
<script src="{{ asset('lib/bootstrap/js/bootstrap_select.min.js') }}" ></script>

<!-- Extra JS -->
{% block js %}{% endblock %}

<!-- Custom JS -->
<script src="{{ asset('js/app.js') }}"></script>

</html>

0 个答案:

没有答案