home *** CD-ROM | disk | FTP | other *** search
/ PC & Mediji 2000 June / PCM_0006.iso / programi / WMP.EXE / wmploc.DLL / 256 / 138 < prev    next >
Encoding:
Text (UTF-16)  |  2000-03-15  |  6.2 KB  |  170 lines

  1. // All WMP Play and Open states are defined in skins\common\WMPStates.js
  2.  
  3. function InitVisualizations()
  4. {        
  5.     InitMe();
  6. }
  7.  
  8. function CloseVisualizations()
  9. {
  10. }
  11.  
  12. function OnDownloadingMedia()
  13. {
  14.     AddBanner.image="WMPImage_AdBanner";
  15. }
  16.  
  17. function OnBannerClick()
  18. {
  19.     var strTargetURL = player.currentmedia.getItemInfo("#BannerInfoURL");
  20.     if ( strTargetURL != "")
  21.     {
  22.         player.launchURL(strTargetURL);   
  23.     }
  24. }
  25.  
  26. function OnBannerMouseOver()
  27. {
  28.     if ( player.currentmedia.getItemInfo("#BannerInfoURL") != "")
  29.     {
  30.         AddBanner.cursor = "hand";
  31.     }
  32.     else
  33.     {
  34.         AddBanner.cursor = "system";
  35.     }
  36. }
  37.  
  38. function VizPrev()
  39. {
  40.     myeffect.previous()
  41.     var nPreset = myeffect.currentPreset;
  42.     mediacenter.effectType = myeffect.currentEffectType;
  43.     mediacenter.effectPreset = nPreset;
  44. }
  45.  
  46. function VizNext()
  47. {
  48.     myeffect.next()
  49.     var nPreset = myeffect.currentPreset;
  50.     mediacenter.effectType = myeffect.currentEffectType;
  51.     mediacenter.effectPreset = nPreset;
  52. }
  53.  
  54. function InitMe()
  55. {
  56.     SetMetaData();
  57.     
  58.     if (player.OpenState == osMediaOpen)
  59.     {
  60.         if (player.currentmedia.getItemInfo("#BannerURL") != "")
  61.         {
  62.             ShowBanner(true);
  63.         }
  64.         else
  65.         {
  66.             ShowBanner(false);
  67.         }
  68.     
  69.         if(player.currentMedia.ImageSourceWidth > 0)
  70.         {
  71.             ShowVisualizations(false);
  72.             video1.visible=true;
  73.         } 
  74.         else 
  75.         { 
  76.             ShowVisualizations(true);
  77.             video1.visible=false;
  78.         }
  79.     }
  80.     else 
  81.     { 
  82.         ShowVisualizations(false);
  83.         video1.visible=false;
  84.     }
  85. }
  86.  
  87. function ShowVisualizations(state)
  88. {
  89.     myeffect.visible=state;
  90.     svEffectsControls.visible=state; 
  91.     Titles.visible=state;
  92. }
  93.  
  94. function myOnVideoStart()
  95. {
  96.     video1.visible=true;
  97.     ShowVisualizations(false);
  98. }
  99.  
  100. function myOnVideoEnd()
  101. {
  102.     video1.visible=false;
  103.     ShowVisualizations(true);
  104. }
  105.  
  106. function OnTimerTick()
  107. {
  108.     SetMetaData();
  109. }
  110.  
  111. function SetMetaData()
  112. {
  113.     if (player.OpenState == osMediaOpen)
  114.     {
  115.         playlistname.value = player.currentmedia.getiteminfo("Author");
  116.         trackname.value = player.currentmedia.name;
  117.     }
  118. }
  119.  
  120. function OnPlayStateChange()
  121. {
  122.     InitMe();
  123. }
  124.  
  125. function OnOpenStateChange()
  126. {
  127.     switch (player.OpenState)
  128.     {
  129.     case osUndefined:
  130.         break;
  131.     case osMediaOpen:
  132.         InitMe();
  133.         break;
  134.     case osMediaOpening:
  135.         break;
  136.     case osPlaylistLoading:
  137.         InitMe();
  138.         break;
  139.     }
  140. }
  141.  
  142. function ShowBanner(state)
  143. {
  144.     if (state != svBanner.visible)
  145.     {
  146.         svBanner.visible = state;
  147.         
  148.         if (state == true)
  149.         {
  150.             svBanner.visible = true;
  151.             svScreen.height -= svBanner.height;
  152.         }
  153.         else
  154.         {
  155.             svBanner.visible = false;
  156.             svScreen.height += svBanner.height;
  157.         }
  158.     }
  159. }
  160.  
  161. function ChangeFrameRate()
  162. {
  163.     var s = myeffect.updatesPerSec + 6;
  164.     if (s > 30)
  165.     {
  166.         s = 6;
  167.     }
  168.     fps.value = s + " fps";
  169.     myeffect.updatesPerSec = s;