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

Replay issue in IE8 #82

Open
AhnSeongHyun opened this issue Dec 6, 2016 · 1 comment
Open

Replay issue in IE8 #82

AhnSeongHyun opened this issue Dec 6, 2016 · 1 comment

Comments

@AhnSeongHyun
Copy link

AhnSeongHyun commented Dec 6, 2016

In above IE9, and Chrome, follow the code below to play the sound source repeatedly
console.log is below:

requestNewOrder
play
(play sound during seconds)
pause 
ended

But, The sound source is played once, then stopped in IE8.
console.log is below:

requestNewOrder
play
(no play sound)
pause 
ended
    var audio_js =null;
    $(document).ready(function (e) {
        initAudio();
        requestNewOrder();
    });

    function playAlarm(){
        if(audio_js) {
            audio_js.play();
        }
    }

    function requestNewOrder(){
    	console.log(requestNewOrder);
        var url = "/new_order";
        var success_func = function(result){
            if(result.data.new_order_count> 0) {
                playAlarm();
            }
            else{
                setTimeout(requestNewOrder, 2000);
            }
        };

        var error_func = function(){
            setTimeout(requestNewOrder, 2000);
        };
        commons.request(url, params, success_func, error_func, null); //Custom Ajax Library
    }

    function initAudio () {
        audio_js = new Audio5js({
            ready: audioReady,
            play:function(){
                this.play();
            }
        });
    }

    var audioReady = function () {
        this.load('/static/audio/order.mp3');
       
        this.on('play', function () {
            console.log('play');
        }, this);
        this.on('pause', function () {
            console.log('pause');
        }, this);
        this.on('ended', function () {
            console.log('ended');
            requestNewOrder();
        }, this);
    };
@AhnSeongHyun AhnSeongHyun changed the title IE8 Replay issue in IE8 Dec 6, 2016
@zohararad
Copy link
Owner

Try seeking the audio to position 0.
I suspect this is due to some discrepancy in the Flash player (IE8) vs. the HTML5 player (IE9+).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants