Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Wavesurfer timeline插件下载不推荐?_Javascript_Jquery_Plugins_Wavesurfer.js - Fatal编程技术网

Javascript Wavesurfer timeline插件下载不推荐?

Javascript Wavesurfer timeline插件下载不推荐?,javascript,jquery,plugins,wavesurfer.js,Javascript,Jquery,Plugins,Wavesurfer.js,我想使用wavesurfer.js为数字音频文件添加时间线,不幸的是,我在这里的代码不起作用。我可以知道在哪里可以加载文件的timeline.js吗?wavesurfer timeline插件是否已弃用 <html> <head> <title>webapp</title> <!-- main wavesurfer.js lib --> <script src="https://cdnjs.cl

我想使用wavesurfer.js为数字音频文件添加时间线,不幸的是,我在这里的代码不起作用。我可以知道在哪里可以加载文件的timeline.js吗?wavesurfer timeline插件是否已弃用

<html>
    <head>
    <title>webapp</title>


    <!-- main wavesurfer.js lib -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/wavesurfer.js/1.2.3/wavesurfer.min.js"></script>

    <!-- wavesurfer.js timeline -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/wavesurfer.js/1.2.3/plugin/wavesurfer.timeline.min.js"></script>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/sidebar.css" type="text/css"/>

    </head>
    <body>
<div id="waveform-timeline"></div>    
            <div id="audio-spectrum"></div>
 </body>
    </html>

错误表示未定义wavesurfer。

时间线插件要求您将wavesurfer实例传递给其
创建
功能。您正在通过键
Spectrum
-这就是为什么找不到它的原因。将时间线初始化代码更改为:

// ...
timeline.init({
  wavesurfer: Spectrum,
  container: "#wave-timeline"
});
// ...

timeline插件要求您将wavesurfer实例传递给其
create
函数。您正在通过键
Spectrum
-这就是为什么找不到它的原因。将时间线初始化代码更改为:

// ...
timeline.init({
  wavesurfer: Spectrum,
  container: "#wave-timeline"
});
// ...

当然,我会试试这个。运气不好。我尝试创建wavesurfer对象而不是光谱。仍然无法加载.wavesurfer.on('ready',function(){var timeline=Object.create(wavesurfer.timeline);timeline.init({wavesurfer:wavesurfer,容器:'#波形timeline'});});这个代码确实有效!!当然,我会试试这个。运气不好。我尝试创建wavesurfer对象而不是光谱。仍然无法加载.wavesurfer.on('ready',function(){var timeline=Object.create(wavesurfer.timeline);timeline.init({wavesurfer:wavesurfer,容器:'#波形timeline'});});这个代码确实有效!!