SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    May 2006
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Windows Media Player

    Hi

    I tried to make a work around for the "click to activate and use this control" problem with a windows media player object in internet explorer. I have written some javascript but it isnt working in internet explorer yet ( only firefox ).

    I made the following page:
    http://www.gsmgamer.nl/test5.htm

    iefix.js
    Code:
    function CreatePlayer(url){
    document.write('<object id="mediaPlayer"');
    document.write('width="400"');
    document.write('height="364"');
    document.write('classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"');
    document.write('codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"');
    document.write('standby="Loading Microsoft Windows Media Player components..."');
    document.write('type="application/x-oleobject">');
    document.write('<param name="URL" value="' + url + '"/>');
    document.write('<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">');
    document.write('<PARAM NAME="AutoStart" VALUE="True">');
    document.write('<PARAM NAME="uiMode" value="mini">');
    document.write('<PARAM NAME="ShowStatusBar" value="1">');
    document.write('<PARAM NAME="PlayCount" value="1">');
    document.write('<PARAM NAME="ShowTracker" value="False">');
    document.write('<PARAM NAME="stretchToFit" value="1">');
    document.write('<PARAM NAME="enableContextMenu" value="False">');
    document.write('<embed type="application/x-mplayer2" ');
    document.write('src="' + url + '" ');
    document.write('id="mediaPlayer" ');
    document.write('ShowStatusBar="1" ');
    document.write('width="400" ');
    document.write('height="364" ');
    document.write('showtracker="False" ');
    document.write('autostart="True" ');
    document.write('sendplaystatechangeevents="True" ');
    document.write('uimode="mini" ');
    document.write('playcount="1" ');
    document.write('stretchToFit="1" ');
    document.write('enablecontextmenu="False"></embed> ');
    document.write('</OBJECT> ');
    }
    Does anybody know why the movie isnt playing in internet explorer?

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2005
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The problem is that you're using URL instead of FILENAME.

    You have:

    Code:
    document.write('<param name="URL" value="' + url + '"/>');
    and it should be:

    Code:
    document.write('<param name="Filename" value="' + url + '"/>');
    BTW, using your code I still get the "Click to activate", as far as I know, that can't be removed, but I could be wrong.

  3. #3
    SitePoint Member
    Join Date
    May 2006
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you its works great and without the "Click to activate".

  4. #4
    SitePoint Zealot
    Join Date
    Aug 2005
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I run WinXP Pro SP2 (and all the updates) and I always get that. So you know in case someone else tells you the same.

    Just in case, read this article.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •