Chrome 问题 - 嵌入 Windows 媒体播放器

发布于 2024-07-29 13:35:40 字数 1596 浏览 10 评论 0原文

我遇到问题了。 我在页面中嵌入了 WMP,并且需要对播放器隐藏按钮。 我可以在 IE 和 FF 中隐藏它们,但在 Google Chrome 中却做不到。 代码

        <object id="MediaPlayer1" width="690" height="500" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
            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="FileName" value='<%= GetSource() %>' />
            <param name="AutoStart" value="True" />
            <param name="DefaultFrame" value="mainFrame" />
            <param name="ShowStatusBar" value="0" />
            <param name="ShowPositionControls" value="0" />
            <param name="showcontrols" value="0" />
            <param name="ShowAudioControls" value="0" />
            <param name="ShowTracker" value="0" />
            <param name="EnablePositionControls" value="0" />


            <!-- BEGIN PLUG-IN HTML FOR FIREFOX-->
            <embed  type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
                src='<%= GetSource() %>' align="middle" width="600" height="500" defaultframe="rightFrame"
                 id="MediaPlayer2" />



        </object>

这是我在 FF 中隐藏按钮的方法中的

                        var player = document.getElementById("MediaPlayer2");
            player.uiMode="none";

和 JS 中的代码,但似乎不适用于 Chrome。

I am having a problem. I embed WMP in my page, and I need to hide buttons from player. I make it to hide them in IE and FF, but I can't make it happen in Google Chrome.
Here is the code

        <object id="MediaPlayer1" width="690" height="500" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
            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="FileName" value='<%= GetSource() %>' />
            <param name="AutoStart" value="True" />
            <param name="DefaultFrame" value="mainFrame" />
            <param name="ShowStatusBar" value="0" />
            <param name="ShowPositionControls" value="0" />
            <param name="showcontrols" value="0" />
            <param name="ShowAudioControls" value="0" />
            <param name="ShowTracker" value="0" />
            <param name="EnablePositionControls" value="0" />


            <!-- BEGIN PLUG-IN HTML FOR FIREFOX-->
            <embed  type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
                src='<%= GetSource() %>' align="middle" width="600" height="500" defaultframe="rightFrame"
                 id="MediaPlayer2" />



        </object>

and in the JS in a method i do

                        var player = document.getElementById("MediaPlayer2");
            player.uiMode="none";

to hide buttons in FF, but seems that not work for Chrome.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情话难免假 2024-08-05 13:35:41

Windows Media Player 插件本身无法在 Chrome 中运行。 Chrome是基于Safari的,所以如果你能找到Safari的插件,你应该可以在Chrome中使用它。 否则,您将无法在 chrome 中播放 wmp 视频。

The Windows Media Player plugin does not natively work in chrome. Chrome is based on Safari, so if you can find a plugin for safari, you should be able to use this in chrome. Otherwise, you will not be able to play wmp videos in chrome.

指尖上的星空 2024-08-05 13:35:40

完全跨浏览器:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="Content-Script-Type" content="text/javascript">   
    <title></title>

</head>

<body>

    <table border="0" width="600" height="500" cellpadding="0" cellspacing="0">
        <tr>
            <td width="500" height="500">
                <!--[if !IE]> <-->
                    <object id="mediaplayer" type="application/x-ms-wmp" data="video.wmv" width="500" height="500">
                        <param name="src" value="video.wmv" valuetype="ref" type="video.wmv">
                        <param name="animationatStart" value="1">
                        <param name="transparentatStart" value="1">
                        <param name="autoStart" value="1">
                        <param name="ShowControls" value="0">
                        <param name="ShowDisplay" value="0">
                        <param name="ShowStatusBar" value="0">
                        <param name="playcount" value="10">
                        <param name="autoRewind" value="1">
                        <param name="displaysize" value="0">
                        <param name="stretchtofit" value="1">
                        <param name="enableContextMenu" value="0">
                        <param name="uiMode" value="none">
                        <strong>Error:</strong>You need <a href="http://port25.technet.com/pages/windows-media-player-firefox-plugin-download.aspx">Windows Media Player Plugin</a>.
                    </object>
                <!--> <![endif]-->
                <!--[if IE]>
                    <object id="mediaplayer" type="video/x-ms-wmv" classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" width="500" height="500">
                        <param name="url" value="video.wmv" valuetype="ref" type="video/x-ms-wmv">
                        <param name="animationatStart" value="1">
                        <param name="transparentatStart" value="1">
                        <param name="autoStart" value="1">
                        <param name="ShowControls" value="0">
                        <param name="ShowDisplay" value="0">
                        <param name="ShowStatusBar" value="0">
                        <param name="playcount" value="99999">
                        <param name="clickToPlay" value="1">
                         <param name="autoRewind" value="1">
                        <param name="displaysize" value="0">
                        <param name="stretchtofit" value="1">
                        <param name="enableContextMenu" value="0">
                        <param name="uiMode" value="none">
                        <strong>Error:</strong>You need <a href="http://www.microsoft.com/windows/windowsmedia/download/plugin.aspx">Windows Media Player Plugin</a>.
                    </object>
                <![endif]-->
            </td>
            <td>
                <input type="button" value="uiMode Full" onclick="document.getElementById('mediaplayer').uiMode='full'">
                <input type="button" value="uiMode None" onclick="document.getElementById('mediaplayer').uiMode='none'">
            </td>
        </tr>
    </table>

</body>
</html>

Totally crossbrowser:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="Content-Script-Type" content="text/javascript">   
    <title></title>

</head>

<body>

    <table border="0" width="600" height="500" cellpadding="0" cellspacing="0">
        <tr>
            <td width="500" height="500">
                <!--[if !IE]> <-->
                    <object id="mediaplayer" type="application/x-ms-wmp" data="video.wmv" width="500" height="500">
                        <param name="src" value="video.wmv" valuetype="ref" type="video.wmv">
                        <param name="animationatStart" value="1">
                        <param name="transparentatStart" value="1">
                        <param name="autoStart" value="1">
                        <param name="ShowControls" value="0">
                        <param name="ShowDisplay" value="0">
                        <param name="ShowStatusBar" value="0">
                        <param name="playcount" value="10">
                        <param name="autoRewind" value="1">
                        <param name="displaysize" value="0">
                        <param name="stretchtofit" value="1">
                        <param name="enableContextMenu" value="0">
                        <param name="uiMode" value="none">
                        <strong>Error:</strong>You need <a href="http://port25.technet.com/pages/windows-media-player-firefox-plugin-download.aspx">Windows Media Player Plugin</a>.
                    </object>
                <!--> <![endif]-->
                <!--[if IE]>
                    <object id="mediaplayer" type="video/x-ms-wmv" classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" width="500" height="500">
                        <param name="url" value="video.wmv" valuetype="ref" type="video/x-ms-wmv">
                        <param name="animationatStart" value="1">
                        <param name="transparentatStart" value="1">
                        <param name="autoStart" value="1">
                        <param name="ShowControls" value="0">
                        <param name="ShowDisplay" value="0">
                        <param name="ShowStatusBar" value="0">
                        <param name="playcount" value="99999">
                        <param name="clickToPlay" value="1">
                         <param name="autoRewind" value="1">
                        <param name="displaysize" value="0">
                        <param name="stretchtofit" value="1">
                        <param name="enableContextMenu" value="0">
                        <param name="uiMode" value="none">
                        <strong>Error:</strong>You need <a href="http://www.microsoft.com/windows/windowsmedia/download/plugin.aspx">Windows Media Player Plugin</a>.
                    </object>
                <![endif]-->
            </td>
            <td>
                <input type="button" value="uiMode Full" onclick="document.getElementById('mediaplayer').uiMode='full'">
                <input type="button" value="uiMode None" onclick="document.getElementById('mediaplayer').uiMode='none'">
            </td>
        </tr>
    </table>

</body>
</html>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文