• asp.net 在线 mp3,wma, avi


    1.前台js
    <script type="text/javascript">
    function playMusic(width,height,isStart,videolink)
        {
         var oeTags = '<object id="mediaPlayer" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"'
             + 'width="' + width + '" height="' + height + '"'
             + 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"'
             + 'standby="Loading Microsoft Windows Media Player components..."'
             + 'type="application/x-oleobject">'
             + '   <param name="autoStart" value="'+isStart+'"/>'
             + '   <param name="url"       value="' + videolink + '" />'
             + '   <param name="wmode"     value="transparent" />'
             + '   <param name="uiMode"    value="full" />'
             + '   <param name="loop"      value="false" />'
             + '   <embed id       ="EmbedmediaPlayer"'
             + '       type        ="application/x-mplayer2"'
             + '       src         ="' + videolink + '"'
             + '       width       ="' + width + '"'
             + '       height      ="' + height + '">'
             +'        autoStart   ="'+isStart+'" '
             + '   </embed>'
             + '</object>';
        document.write(oeTags);
        }
    </script>
    2.后台cs
     protected void BtnStop_Click(object sender, EventArgs e)
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>playMusic(0,0,false,'天路.wma')</script>");
            }

    可以更换数据库中的路径,及大小,是否显示。

    作者:水木    
     
  • 相关阅读:
    JS PopupAlert
    JS Navigator
    JS History
    JS Location
    JS Screen
    JS Window
    PTZView
    使用JmDNS发现设备
    Android开发调用webservice方式之一
    解决webservice发布报错Service Unavailable HTTP Error 503. The service is unavailable.
  • 原文地址:https://www.cnblogs.com/hsapphire/p/1560296.html
Copyright © 2020-2023  润新知