index.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <title>wavesurfer.js | Media Element Example</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="https://katspaugh.github.io/wavesurfer.js/example/screenshot.png" />
  12. <!-- wavesurfer.js -->
  13. <script src="../../dist/wavesurfer.js"></script>
  14. <script src="../../dist/plugin/wavesurfer.regions.js"></script>
  15. <!-- Demo -->
  16. <script src="main.js"></script>
  17. </head>
  18. <body itemscope itemtype="http://schema.org/WebApplication">
  19. <div class="container">
  20. <div class="header">
  21. <ul class="nav nav-pills pull-right">
  22. <li><a href="/"><i class="glyphicon glyphicon-home"></i></a></li>
  23. </ul>
  24. <h1 itemprop="name">Media Element Fallback Example</h1>
  25. </div>
  26. <div id="demo">
  27. <div id="waveform">
  28. <!-- Here be the waveform -->
  29. </div>
  30. <div class="controls">
  31. <button class="btn btn-primary" data-action="play">
  32. <i class="glyphicon glyphicon-play"></i>
  33. Play
  34. /
  35. <i class="glyphicon glyphicon-pause"></i>
  36. Pause
  37. </button>
  38. </div>
  39. </div>
  40. <div class="row marketing">
  41. <h3>How to Enable the Fallback</h3>
  42. <hr />
  43. <p>
  44. <strong>wavesurfer.js</strong> will automatically
  45. fallback to HTML5 Media if Web Audio is not
  46. supported. However, you can choose to use audio
  47. element manually. Simply set the <code>backend</code>
  48. option to <code>"MediaElement"</code>.
  49. </p>
  50. <p>
  51. <pre><code>var wavesurfer = WaveSurfer.create({
  52. container: document.querySelector('#wave'),
  53. backend: 'MediaElement'
  54. });
  55. </code></pre>
  56. </p>
  57. <h3>Pre-rendered Peaks</h3>
  58. <p>
  59. If you have pre-rendered peaks (on your server),
  60. you can pass them into the <code>load</code>
  61. function. This is optional–if you don't provide
  62. any peaks,
  63. <strong>waserver.js</strong> will first draw a
  64. thin line instead of a waveform, then attempt to
  65. download the audio file via Ajax and decode it
  66. with Web Audio if available.
  67. </p>
  68. <p>
  69. <pre><code>wavesurfer.load('example/media/demo.mp3');</code></pre>
  70. </p>
  71. <p>
  72. Press this button to see the same demo with pre-decoded peaks:
  73. <button class="btn btn-warning" data-action="peaks">
  74. Load with pre-rendered peaks
  75. </button>
  76. </p>
  77. </div>
  78. <div class="footer row">
  79. <div class="col-sm-12">
  80. <a rel="license" href="https://opensource.org/licenses/BSD-3-Clause"><img alt="BSD-3-Clause License" style="border-width:0" src="https://img.shields.io/badge/License-BSD%203--Clause-blue.svg" /></a>
  81. </div>
  82. <div class="col-sm-7">
  83. <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 href="https://github.com/katspaugh/wavesurfer.js">katspaugh</a> is licensed under a&nbsp;<a style="white-space: nowrap" rel="license" href="https://opensource.org/licenses/BSD-3-Clause">BSD-3-Clause License</a>.
  84. </div>
  85. <div class="col-sm-5">
  86. <div class="pull-right">
  87. <noindex>
  88. The audio file is from <a rel="nofollow" href="http://spokencorpora.ru/">spokencorpora.ru</a>, used with permission.
  89. </noindex>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="github-fork-ribbon-wrapper right">
  95. <div class="github-fork-ribbon">
  96. <a itemprop="isBasedOnUrl" href="https://github.com/katspaugh/wavesurfer.js">Fork me on GitHub</a>
  97. </div>
  98. </div>
  99. <script>
  100. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  101. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  102. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  103. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  104. ga('create', 'UA-50026819-1', 'wavesurfer.fm');
  105. ga('send', 'pageview');
  106. </script>
  107. </body>
  108. </html>