mediaelement.js - pause/play onclick for video?

What's the easiest way to add pause/play functionality by clicking anywhere in the video element similar to most video players?

I tried:

$('video').click(function() {

        if($(this).paused){

            $(this).play();

        } else {

            $(this).pause();

        }


    });

But it didn't like the $(this).pause() call. Any help is appreciated. Thanks.

DS

5
задан L84 4 March 2015 в 21:26
поделиться