home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 September (Special) / Chip-Special_2002-09_Digitalni-Video.bin / servis / wm9 / mpsetupXP.exe / RCDATA / CABINET / wmploc.DLL / 256 / 4003 < prev    next >
Text File  |  2002-08-19  |  3KB  |  125 lines

  1. //<script>
  2. // Windows Media Player - Copyright 2000 Microsoft Corporation.
  3.  
  4. function InitOCXSkin()
  5. {
  6.     InitVisualizations();
  7.  
  8.     // IE Bug:  We do this so that we don't have to change the size synchronously
  9.     //          from the OnLoad event...
  10.  
  11.     svLayoutSize.moveTo( svLayoutSize.left, svLayoutSize.top, 10 );
  12. }
  13.  
  14. function InitVisualizations()
  15. {
  16.     if (osMediaOpen == player.OpenState)
  17.     {
  18.         if (player.currentMedia.ImageSourceWidth > 0)
  19.         {
  20.             svVisual.visible=false;
  21.             svVideo.visible=true;
  22.         } 
  23.         else 
  24.         { 
  25.             svVideo.visible=false;
  26.             svVisual.visible=mediacenter.showEffects;
  27.         }
  28.     }
  29.     else 
  30.     { 
  31.         svVideo.visible=false;
  32.         svVisual.visible=false;
  33.     }
  34. }
  35.  
  36. function OnPlayStateChangeViz()
  37. {
  38.     InitVisualizations();
  39.     AutoSize();
  40. }
  41.  
  42. function OnOpenStateChangeViz()
  43. {
  44.     OnPlayStateChangeViz();
  45. }
  46.  
  47. function AutoSize()
  48. {
  49.     if (osMediaOpen == player.OpenState)
  50.     {
  51.         if (player.currentMedia.ImageSourceWidth > 0)
  52.         {
  53.             // Resize layout to match the video size
  54.             view.height = player.currentMedia.ImageSourceHeight + svTransport.height + svBanner.height;
  55.             
  56.             // clip to the transport controls width
  57.             if ((0 == svTransport.width) || (player.currentMedia.ImageSourceWidth > svLayoutSize.width))
  58.             {
  59.                 view.width = player.currentMedia.ImageSourceWidth;
  60.             }
  61.             else
  62.             {
  63.                 view.width = svLayoutSize.width;
  64.             }
  65.         }
  66.         else
  67.         {
  68.             // Resize layout to original size
  69.             view.width = svLayoutSize.width;        
  70.             view.height = svLayoutSize.height;
  71.         }
  72.     }
  73. }
  74.  
  75. function CheckForAdBanner(media)
  76. {   
  77.     var oldHeight = svBanner.height;
  78.     if (media.getItemInfo('BannerURL') != '')
  79.     {
  80.         AdBanner.image="WMPImage_AdBanner";
  81.         svBanner.height=AdBanner.height;
  82.         AdBanner.tabStop=true;
  83.     }
  84.      
  85.     else
  86.     {
  87.         svBanner.height=0;
  88.         AdBanner.tabStop=false;
  89.     }
  90.     if (svBanner.height!=oldHeight)
  91.     {    
  92.         svVideo.height  = view.height - svTransport.height - svBanner.height; 
  93.         svVisual.height = view.height - svTransport.height - svBanner.height;
  94.         svBanner.top    = svVideo.top + svVideo.height;
  95.     }
  96. }
  97.  
  98. function OnBannerClick()
  99. {
  100.     if (player.openState==osMediaOpen)
  101.     {
  102.         var strTargetURL = player.currentmedia.getItemInfo("BannerInfoURL");
  103.         if ( strTargetURL != "")
  104.         {
  105.             player.launchURL(strTargetURL);   
  106.         }
  107.     }
  108. }
  109.  
  110. function OnBannerMouseOver()
  111. {
  112.     if (player.openState==osMediaOpen)
  113.     {
  114.         if ( player.currentmedia.getItemInfo("BannerInfoURL") != "")
  115.         {
  116.             AdBanner.cursor = "hand";
  117.         }
  118.         else
  119.         {
  120.             AdBanner.cursor = "system";
  121.         }
  122.     }
  123. }
  124.  
  125.