46 users online (1 members and 45 guests)  


  Results 1 to 3 of 3

Related

  1. resize of window    Forum: HTML Forum
    Replies: 3
  2. Need Help To Resize BASIC page-top Calendar...    Forum: Javascript Forum
    Replies: 2
  3. Replies: 7
  4. html and resize of browser    Forum: HTML Forum
    Replies: 1
  5. resize    Forum: HTML Forum
    Replies: 4
  1. #1
    mike015's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2004
    Posts
    2

    Embed with manual resize?

    I have a .wmv file I have embedded, is there a way to have it resize to fill the window? ie, if I make the window smaller it shrinks the video, I enlarge the window it expands the video?
    Thanks
    Mike

  2. #2
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732
    Hi there mike015,

    Welcome to these forums

    I have added a small 'javascript' and a bit of 'css' to your code. It may not work in all browsers
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Gimme the Mike</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    <script type="text/javascript">
    //<![CDATA[
    function enLarge(){
    
    if (document.getElementById("MediaPlayer").style.width=="100%"){
        document.getElementById("MediaPlayer").style.width="300px";
        document.getElementById("MediaPlayer").style.height="300px";
    }
    else{
        document.getElementById("MediaPlayer").style.width="100%";
        document.getElementById("MediaPlayer").style.height="100%";
    }
    }
     //]]>
    </script>
    
    <style type="text/css">
    /*<![CDATA[*/
    #one{
        position:absolute;
        top:0;
        left:0;
       }
    
    #MediaPlayer{
        position:absolute;
        top:30px;
        left:0;
    }
     /*//]]>*/
    }
    </style>
    
    </head>
    <body>
    
    <div id="one" ><button onclick="enLarge()"> large · small </button></div>
    
    <object id="MediaPlayer" width="300" height="300" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"standby="Loading Microsoft® Windows® Media Player components..."
    type="application/x-oleobject"codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">
    <param name="filename" value="gimmethemikeweb1.wmv">
    <param name="autoStart" value="true"> 
    <param name="showControls" value="true">
    <param name="ShowStatusBar" value="true"> 
    <param name="Autorewind" value="true">
    <param name="ShowDisplay" value="false"> 
    <embed src="gimmethemikeweb1.wmv" type="application/x-mplayer2" name=MediaPlayer autostart=1 showcontrols=0 showstatusbar=0 autorewind=1 showdisplay=0>
    </embed></object>
    
    </body>
    </html>
    cthead

  3. #3
    mike015's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2004
    Posts
    2

    Thumbs up Thanks, Coothead.

    That was a different approach, but equally effective.
    It will work well for me.
    Thanks
    Mike



Tags for this Thread