This time is too busy. I have no time to write down my work experience. Today, I will take the time to explain some of the difficult problems I encountered during my work two days ago and the solutions:
Problem description:
After the embed tag receives the live stream, you can use the play () and pause () methods in IE to control the playback and suspension, but there is nothing to do with Firefox and Safari, normal playback in Firefox and Safari (Media plug-ins need to be installed in Safari), but play and pause cannot be controlled through play () and pause, the root cause of the problem is that Firefox and Safari do not support embed labels very well. It took a lot of time to solve this small problem!
Solution:
There may be a better solution. My solution is as follows: When you click the pause button, first judge the browser type, if it is not ie, the embed label will be removed from the Dom, And the embed label will be dynamically loaded into the DOM when the single-point playback button is used. In this way, the problem is solved.
The related code is as follows:
// Layer containing the embed label
<Div id = "radio_container"> <embed type = "application/x-mplayer2" pluginspage = "http://www.microsoft.com/windows/mediaPlayer/" id = "Player" src = "http://pub.qmoon.net: 8009/911 pop "name =" Player "width =" 0 "Height =" 0 "volume =" 100 "> </embed> </div>
// Tentative
VaR trnode = Document. getelementbyid ("Player ");
Trnode. parentnode. removechild (trnode );
// Play
VaR Container = Document. getelementbyid ("radio_container ");
VaR STR = "<embed type =/" application/x-mplayer2/"pluginspage =/" http://www.microsoft.com/windows/mediaPlayer// "id =/" player/"src =/" http: // live stream address/"name =/" player/"width =/" 0/"Height =/" 0/"volume =/" 100/"> ";
Container. innerhtml + = STR;
Haha, hope to help some friends ^-^