Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling zoom method (wavesurfer.js) #16

Closed
dimakhilchenko opened this issue Mar 1, 2016 · 1 comment
Closed

Calling zoom method (wavesurfer.js) #16

dimakhilchenko opened this issue Mar 1, 2016 · 1 comment
Labels

Comments

@dimakhilchenko
Copy link

Hi, @thijstriemstra

I am trying to add zoom feature of wavesurfer.js in your plugin.
How can I call wavesurfer.js zoom method from your script?

Thanks in advance for your help #

@thijstriemstra
Copy link
Member

hi @dimakhilchenko, here's an example:

<audio id="myAudio" class="video-js vjs-default-skin"></audio>
<button id="zoomBtn">Zoom</button>

<script>
var player = videojs("myAudio",
{
    controls: true,
    autoplay: true,
    loop: false,
    width: 600,
    height: 300,
    plugins: {
        wavesurfer: {
            src: "media/heres_johnny.wav",
            msDisplayMax: 10,
            waveColor: "grey",
            progressColor: "black",
            cursorColor: "black",
            hideScrollbar: true
        }
    }
});

player.on('ready', function()
{
    document.getElementById("zoomBtn").onclick = function()
    {
        player.waveform.surfer.zoom(2);
    };
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants