最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Pause mediaelement.js using jquery - Stack Overflow

programmeradmin3浏览0评论

I have initialised the element using:

$('video').mediaelementplayer();

Now I would like to target that video and pause it when a link is pressed:

$('.page_button').live('click', function() {
    $('video').pause();
});

Thanks.

I have initialised the element using:

$('video').mediaelementplayer();

Now I would like to target that video and pause it when a link is pressed:

$('.page_button').live('click', function() {
    $('video').pause();
});

Thanks.

Share Improve this question asked Oct 11, 2011 at 16:24 evolutionxboxevolutionxbox 4,1226 gold badges38 silver badges57 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 20

Each element with a media player element has a player property defined. This is where all the methods reside. You can access it with either of the following methods:

$('video')[0].player.pause(); // Be sure the video element exists.

$('video').each(function(){this.player.pause()}) // Safe.
发布评论

评论列表(0)

  1. 暂无评论