开发者

Continuous play for Mediaelement.js

I have a music blog (http://www.lowerfrequencies.com/) in which I have and embed Mediaelement.js audio file in every post. It works great and I have no complaints.

However, I would like it if I could implement a continuous play feature in which when one song is finished playing, the next song starts playing. So if were to listen to the first song on the most recent post, then next song on the next post would st开发者_运维问答art playing automatically.

I would like it to work similar to how streampad works (see the bottom of this site: http://tuneage.tumblr.com/)

Thanks, Gabe


I think you'll want to do something along the lines of the following, where you listen for ended and then change the src and play it.

        mediaElement.addEventListener('ended', function(e) {
            mediaElement.setSrc('mynewfile.mp4');
            mediaElement.play();
        }, false);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜