MediaElement.js会停止所有玩家 [英] MediaElement.js stop all players

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

问题描述

我已经玩了一段时间的MediaElement.js并且有一个新的应用程序,在一个页面上使用20个玩家。我希望能够在播放另一首歌时让歌曲停止 - 而不是在播放时重叠曲目。我似乎无法找到一个简单的方法来破解这个 - 也许有人知道某种方式?

I've been playing around with MediaElement.js for a while now and have a new application that uses 20 players on a single page. I'd like to be able to have the songs stop when another one is played - and not to overlap the tracks when they are playing. I can't seem to find an easy way to hack this - perhaps someone knows of a way?

谢谢。

推荐答案

在jQuery中,你可以做到

In jQuery, you could do

$('video,audio').each(function() {
      $(this)[0].pause();
});

如果有效,请告诉我。

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

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