使用jquery暂停mediaelement.js [英] Pause mediaelement.js using jquery

查看:111
本文介绍了使用jquery暂停mediaelement.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用以下内容初始化元素:

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();
});

谢谢。

推荐答案

每个带有媒体播放器元素的元素都定义了一个播放器属性。这是所有方法所在的位置。您可以使用以下任一方法访问它:

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.

这篇关于使用jquery暂停mediaelement.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆