• Resolved milangru

    (@milangru)


    Hi ,
    is it possible to create your plugin to be auto play on hover and stop when not hovered.
    I have found some code for video, but can someone help me to change it and to put it somewhere in the plugin to make it work.

    var figure = $(".video").hover( hoverVideo, hideVideo );
    
    function hoverVideo(e) { $('video', this).get(0).play(); }
    function hideVideo(e) { $('video', this).get(0).pause(); }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author X-Raym

    (@x-raym)

    Hi,
    It should be possible by moding the wavesurfer-wp.js file, yes, but as your feature is very specific, I don’t plan to develop this feature or add it in the core.

    This .js file is written with jQuery, so the code for this feature would be a bit similar. If you are familiar with it, it should be good .

    There is some comments in the file that will help you understand its logic.

    You may also develop this feature as an external JS without modifying wavesurfer core, as wavesurfer variable is global, but this would require adding PHP functions to queue the scripts.
    It may be a bit more difficult but it worth it, as it prevent modifying the core.

    If you need custom development, contact me on my website.

    • This reply was modified 9 years, 3 months ago by X-Raym.
    Thread Starter milangru

    (@milangru)

    Thank you X-Raym, I will try to do it my self.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Auto start and stop on hover’ is closed to new replies.