Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flash 内核在暂停的时候不会派发 progress 事件 #72

Open
JrIdeA opened this issue Dec 18, 2014 · 0 comments
Open

flash 内核在暂停的时候不会派发 progress 事件 #72

JrIdeA opened this issue Dec 18, 2014 · 0 comments
Labels

Comments

@JrIdeA
Copy link

JrIdeA commented Dec 18, 2014

flash 内核在暂停的时候不会派发 progress 事件,而这时还在缓冲。audio 内核正常。

以下演示代码,可以切换不同内核播放暂停看看进度条

<body>
    <button id="pause">暂停</button>
    <button id="play">播放</button>
    <div style="width:300px;height:10px;background:#ccc;">
        <div id="progress" style="width:0;height:10px;background:#6cf;"></div>
    </div>

<script>
var flashMP3Core = {
    constructor: 'FlashMP3Core',
    args: {
        swf: 'muplayer_mp3.swf?' + +new Date(),
        expressInstaller: 'expressInstall.swf'
    }
},
flashMP4Core = {
    constructor: 'FlashMP4Core',
    args: {
        swf: 'muplayer_mp4.swf?' + +new Date(),
        expressInstaller: 'expressInstall.swf'
    }
},
audioCore = {
    constructor: 'AudioCore'
};

var player = new _mu.Player({
    baseDir: '/',
    absoluteUrl: false,
    engines: [flashMP3Core/* audioCore */]
});

player.on('progress', function(per){
    console.log(per);
    $('#progress').css('width', per*100+'%');
})

$('#play').click(function(){
    player.play();
});

$('#pause').click(function(){
    player.pause();
});

player.add('//bs.baidu.com/lebo18/data2/music/7995224/7995224.mp3?xcode=0f1cb5226655fe9125e169321c1400f7ec59801e43c73961&sign=MBO:eJoqfLcbQdeO4Ienql6d8Matif5bip:/0eQ2S9K4ulWqY9dKJNNSRaWwz0%3D').play();
</script>
</body>
@hustKiwi hustKiwi added the bug label Dec 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants