UNPKG

wavesurfer.js

Version:

Interactive navigable audio visualization using Web Audio and Canvas

153 lines (122 loc) 7.05 kB
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>wavesurfer.js | Timeline plugin</title> <link href="data:image/gif;" rel="icon" type="image/x-icon" /> <!-- Bootstrap --> <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" href="../css/style.css" /> <link rel="stylesheet" href="../css/ribbon.css" /> <link rel="screenshot" itemprop="screenshot" href="//katspaugh.github.io/wavesurfer.js/example/screenshot.png" /> <!-- wavesurfer.js --> <script src="../../dist/wavesurfer.min.js"></script> <!-- timeline format renderer --> <script src="../../plugin/wavesurfer.timeline.js"></script> <!-- App --> <script src="app.js"></script> <script src="../trivia.js"></script> </head> <body itemscope itemtype="http://schema.org/WebApplication"> <div class="container"> <div class="header"> <noindex> <ul class="nav nav-pills pull-right"> <li><a href="?fill">Fill</a></li> <li><a href="?scroll">Scroll</a></li> </ul> </noindex> <h1 itemprop="name"><a href="http://wavesurfer-js.org">wavesurfer.js</a><noindex> + Timeline</noindex></h1> </div> <div id="demo"> <div id="waveform"> <div class="progress progress-striped active" id="progress-bar"> <div class="progress-bar progress-bar-info"></div> </div> <!-- Here be waveform --> </div> <div id="wave-timeline"></div> <div class="controls"> <button class="btn btn-primary" data-action="play"> <i class="glyphicon glyphicon-play"></i> Play / <i class="glyphicon glyphicon-pause"></i> Pause </button> </div> </div> <div class="row marketing"> <div class="col-lg-4"> <h4>wavesurfer.js Timeline Plugin</h4> <p itemprop="about">Adds a simple timeline to your <strong>wavesurfer.js</strong> instances.</p> <h4>Installation</h4> <p> <ol> <li>add the Timeline plugin script tag</li> <li>create a <code>WaveSurfer</code> instance</li> <li>add a container HTML element for the timeline</li> <li>create a Timeline instance in the <code>WaveSurfer</code>'s <code>"ready"</code> event callback</li> </ol> </p> <p> <a class="btn btn-large btn-success" href="../../plugin/wavesurfer.timeline.js" itemprop="downloadUrl">Download <strong>the plugin</strong> (5 KB)</a> </p> </div> <div class="col-lg-8"> <h4>Quick Start</h4> <noindex><p> <pre><code>var wavesurfer = Object.create(WaveSurfer); wavesurfer.init({ // your options here }); wavesurfer.on('ready', function () { var timeline = Object.create(WaveSurfer.Timeline); timeline.init({ wavesurfer: wavesurfer, container: "#wave-timeline" }); }); wavesurfer.load('example/media/demo.mp3');</code></pre> </p></noindex> <br /> <h4>Options</h4> <ul class="markdown-body"> <li><code>wavesurfer</code> - <em>required</em> - a WaveSurfer instance</li> <li><code>container</code> - <em>required</em> - the element in which to place the timeline, or a CSS selector to find it</li> <li><code>height</code> - the height (in pixels) of the timeline. The default is 20.</li> <li><code>notchPercentHeight</code> - the height (in percent) of the minor notch lines in the timeline. The default is 90.</li> <li><code>primaryColor</code> - the color of the modulo-ten notch lines (e.g. 10sec, 20sec). The default is '#000'.</li> <li><code>secondaryColor</code> - the color of the non-modulo-ten notch lines. The default is '#c0c0c0'.</li> <li><code>primaryFontColor</code> - the color of the non-modulo-ten time labels (e.g. 10sec, 20sec). The default is '#000'.</li> <li><code>primaryFontColor</code> - the color of the non-modulo-ten time labels (e.g. 5sec, 15sec). The default is '#c0c0c0'.</li> <li><code>timeInterval</code> - number of intervals that records consists of. Usually it is equal to the duration in minutes.</li> <li><code>primaryLabelInterval</code> - number of primary time labels.</li> <li><code>secondaryLabelInterval</code> - number of secondary time labels (Time labels between primary labels).</li> </ul> </div> </div> <div class="footer row"> <div class="col-sm-12"> <a rel="license" href="https://creativecommons.org/licenses/by/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/3.0/80x15.png" /></a> </div> <div class="col-sm-12"> <span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Text" property="dct:title" rel="dct:type">wavesurfer.js</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="https://github.com/katspaugh/wavesurfer.js" property="cc:attributionName" rel="cc:attributionURL">katspaugh</a> is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/3.0/deed.en_US">Creative Commons Attribution 3.0 Unported License</a>. </div> </div> </div> <div class="github-fork-ribbon-wrapper right"> <div class="github-fork-ribbon"> <a itemprop="isBasedOnUrl" href="https://github.com/katspaugh/wavesurfer.js">Fork me on GitHub</a> </div> </div> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-50026819-1', 'wavesurfer.fm'); ga('send', 'pageview'); </script> </body> </html>