index.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <title>wavesurfer.js | Timeline plugin</title>
  6. <link href="data:image/gif;" rel="icon" type="image/x-icon" />
  7. <!-- Bootstrap -->
  8. <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
  9. <link rel="stylesheet" href="../css/style.css" />
  10. <link rel="stylesheet" href="../css/ribbon.css" />
  11. <link rel="screenshot" itemprop="screenshot" href="//katspaugh.github.io/wavesurfer.js/example/screenshot.png" />
  12. <!-- wavesurfer.js -->
  13. <script src="../../dist/wavesurfer.js"></script>
  14. <!-- timeline format renderer -->
  15. <script src="../../dist/plugin/wavesurfer.timeline.js"></script>
  16. <script src="../../dist/plugin/wavesurfer.minimap.js"></script>
  17. <script src="../../dist/plugin/wavesurfer.cursor.js"></script>
  18. <script src="../../dist/plugin/wavesurfer.elan.js"></script>
  19. <script src="../../dist/plugin/wavesurfer.microphone.js"></script>
  20. <script src="../../dist/plugin/wavesurfer.regions.js"></script>
  21. <script src="../../dist/plugin/wavesurfer.spectrogram.js"></script>
  22. <!-- App -->
  23. <script src="app.js"></script>
  24. <script src="../trivia.js"></script>
  25. <!-- Styling information for the elan plugin -->
  26. <style type="text/css">
  27. #annotations {
  28. max-height: 300px;
  29. overflow: auto;
  30. }
  31. .wavesurfer-annotations tr.wavesurfer-active td {
  32. background-color: yellow;
  33. }
  34. .wavesurfer-time {
  35. width: 100px;
  36. color: #555;
  37. }
  38. .wavesurfer-tier-Text {
  39. width: 500px;
  40. }
  41. td.wavesurfer-tier-Comments {
  42. color: #999;
  43. }
  44. .wavesurfer-handle {
  45. background-color: #c9e2b3;
  46. }
  47. </style>
  48. </head>
  49. <body itemscope itemtype="http://schema.org/WebApplication">
  50. <div class="container">
  51. <div class="header">
  52. <noindex>
  53. <ul class="nav nav-pills pull-right">
  54. <li><a href="?fill">Fill</a></li>
  55. <li><a href="?scroll">Scroll</a></li>
  56. </ul>
  57. </noindex>
  58. <h1 itemprop="name"><a href="http://wavesurfer-js.org">wavesurfer.js</a><noindex> Plugin system</noindex></h1>
  59. </div>
  60. <div id="demo">
  61. <div id="waveform">
  62. <div class="progress progress-striped active" id="progress-bar">
  63. <div class="progress-bar progress-bar-info"></div>
  64. </div>
  65. <!-- Here be waveform -->
  66. </div>
  67. <div id="wave-timeline"></div>
  68. <div id="wave-spectrogram"></div>
  69. <div id="annotations"></div>
  70. <div class="controls">
  71. </div>
  72. </div>
  73. <div class="row">
  74. <div class="col-lg-4">
  75. <div class="form-group marketing">
  76. <h4>Disable and enable plugins on the fly:</h4>
  77. <hr />
  78. <div class="checkbox">
  79. <label><input type="checkbox" value="" data-activate-plugin="minimap">Minimap</label>
  80. </div>
  81. <div class="checkbox">
  82. <label><input type="checkbox" value="" data-activate-plugin="timeline">Timeline</label>
  83. </div>
  84. <div class="checkbox">
  85. <label><input type="checkbox" value="" data-activate-plugin="cursor">Cursor</label>
  86. </div>
  87. <div class="checkbox">
  88. <label><input type="checkbox" value="" data-activate-plugin="spectrogram">Spectrogram</label>
  89. </div>
  90. <div class="checkbox">
  91. <label><input type="checkbox" value="" data-activate-plugin="regions">Regions</label>
  92. </div>
  93. <div class="checkbox">
  94. <label><input type="checkbox" value="" data-activate-plugin="elan">Elan</label>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="col-lg-8">
  99. <div class="marketing">
  100. <h4>Initialising wavesurfer with plugins</h4>
  101. <hr />
  102. <p>The <code>plugins</code> option is an array of plugin definitions. Calling a plugin with the parameter <code>deferInit: true</code> will stop it from automatically initialising – you can do that at a later time with <code>wavesurfer.initPlugin('mypluginname')</code>.</p>
  103. <noindex><p>
  104. <pre><code>var wavesurfer = WaveSurfer.create({
  105. container: '#waveform',
  106. waveColor: 'violet',
  107. // ... other wavesurfer options
  108. plugins: [
  109. WaveSurfer.timeline.create{
  110. container: '#wave-timeline',
  111. // ... other timeline options
  112. })
  113. ]
  114. });
  115. wavesurfer.load('example/media/demo.mp3');</code></pre>
  116. </p></noindex>
  117. </div>
  118. <div class="marketing">
  119. <h4>Dynamically adding and initialising a plugin</h4>
  120. <hr />
  121. <noindex><p>
  122. <pre><code>var wavesurfer = WaveSurfer.create({
  123. container: '#waveform',
  124. waveColor: 'violet',
  125. // ... other wavesurfer options
  126. });
  127. // adding and initialising a plugin after initialisation
  128. wavesurfer.addPlugin(WaveSurfer.timeline.create{
  129. container: '#wave-timeline',
  130. // ... other timeline options
  131. })).initPlugin('timeline')
  132. wavesurfer.load('example/media/demo.mp3');</code></pre>
  133. </p></noindex>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="footer row">
  138. <div class="col-sm-12">
  139. <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>
  140. </div>
  141. <div class="col-sm-12">
  142. <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>.
  143. </div>
  144. </div>
  145. </div>
  146. <div class="github-fork-ribbon-wrapper right">
  147. <div class="github-fork-ribbon">
  148. <a itemprop="isBasedOnUrl" href="https://github.com/katspaugh/wavesurfer.js">Fork me on GitHub</a>
  149. </div>
  150. </div>
  151. <script>
  152. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  153. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  154. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  155. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  156. ga('create', 'UA-50026819-1', 'wavesurfer.fm');
  157. ga('send', 'pageview');
  158. </script>
  159. </body>
  160. </html>