How to USE <embed> tag for music player cont

2019-09-05 16:09发布

问题:

I'm using HTML tag to control my mp3 file. I learnt 2 method from Start and stop for a embeded music in html using javascript works only in IE

function play() {
    document.embeds[0].play();
}
function stop() {
    document.embeds[0].stop();
}

and my js code is like below:

 <body>
    <embed height="50" width="100"  src="demo.mp3" AutoStart="false"  loop="true">
   <script type="text/javascript">
    function play() {
        document.embeds[0].play();
    }
    function stop() {
        document.embeds[0].stop();
    }
    function pause() {
        document.embeds[0].pause();        
    }

    function forward() {
       //how?
    }

    function rewind() {
       //how?
    }
    function volumeup() {
       //how to add volume?
    }
    function volumedown() {
       //how to turn down?
    }
</script> 
</body> 

and,the problem is obvious that i still coundnot find out the method or function of embed to control mp3 player after looong searching.

And I have tried audio tag,however in my ie9(and 10 also) it still cannot work well,it trun out to be a black box with red error symbol.

So,can anyone give me some advice?thx.