home *** CD-ROM | disk | FTP | other *** search
/ XMANGA 27 / XMANGA27.ISO / Extra / mp10setup.exe / wmploc.DLL / 256 / 4013 < prev    next >
Encoding:
Text File  |  2004-08-11  |  5.9 KB  |  119 lines

  1. // Windows Media Player  - Copyright 2000 Microsoft Corporation.
  2. //<script>
  3. var g_tracktimeTextWidth=0;
  4. var g_kNonCaptionsHeight = 53;
  5. var g_kCaptionsHeight    = g_kNonCaptionsHeight + mediacenter.captionsHeight;
  6. var g_SetPlayPauseFocus=false;
  7. function Init()
  8. {
  9.     LayoutMarquee(); 
  10.     OnOpenStateChange(player.openState); 
  11.     OnOpenStateChangeTransport(player.openState); 
  12.     OnPlayStateChangeTransport(player.playState);
  13.     ShowStatus(player.status);
  14.     SyncFFWDButtonToRate(player.settings.rate);
  15. }
  16. function OnOpenStateChange(NewState)
  17. {
  18.     if(NewState==osMediaOpen)
  19.     {
  20.         g_fCaptionsDetected=false;
  21.         UpdateCaptions();
  22.     }
  23. }
  24. function LayoutMarquee()
  25. {
  26.     g_tracktimeTextWidth = tracktime.textwidth;
  27.     var margin=parseInt(theme.loadString("res://wmploc/RT_STRING/#1272"));
  28.     tracktime.horizontalAlignment='left'; 
  29.     tracktime.left = svMarquee.width - tracktime.textwidth - 33;
  30.     tracktime.horizontalAlignment='right';
  31.     try
  32.     {
  33.         metadata.width = tracktime.left - margin - metadata.left;
  34.     }
  35.     catch(err){}
  36. }
  37. function dummybutton()
  38. {
  39.     this.down = false;
  40. }
  41. //main app and fullscreen have new super ffwd buttons (ffwd_multi), but they need
  42. //a dummy button to keep transport.js from freaking out
  43. var ffwd = new dummybutton();
  44. //=====================================================
  45. //  SAMI
  46. //=====================================================
  47. var g_fCaptionsDetected = mediacenter.showCaptions;
  48. try
  49. {
  50.     g_fCaptionsDetected = mediacenter.showCaptions && helper.captionsAvailable;
  51. }
  52. catch(err){}
  53. function handleScriptCommand(scType, Param)
  54. {
  55.     scType = scType.toUpperCase();
  56.     if(scType == "TEXT" ||  scType == "<SYNC" || scType == "CAPTION")
  57.     {
  58.         g_fCaptionsDetected = mediacenter.showCaptions;
  59.     }
  60. }
  61. function PlayingDVD()
  62. {
  63.     return ( (player.currentPlaylist.count>0) && (player.currentPlaylist.item(0).sourceURL.indexOf("wmpdvd:")==0));
  64. }
  65. function UpdateCaptions()
  66. {
  67.     try
  68.     {
  69.         g_fCaptionsDetected = (mediacenter.showCaptions && helper.captionsAvailable && !PlayingDVD());
  70.         SetCaptions(g_fCaptionsDetected);
  71.     }
  72.     catch(err){}
  73. }
  74. function SetCaptions(visible)
  75. {
  76.     if (!visible) piCaptions.visible = false; 
  77.     view.height = visible ? g_kCaptionsHeight : g_kNonCaptionsHeight;
  78.     if (visible) piCaptions.visible  = true;
  79. }
  80. function GetViewHeight()
  81. {
  82.     if (mediacenter.showCaptions && (g_fCaptionsDetected||helper.captionsAvailable) )
  83.     {
  84.         g_fCaptionsDetected=true;
  85.         return g_kCaptionsHeight;
  86.     }
  87.     return g_kNonCaptionsHeight;
  88. }
  89. function NineSeriesExcellence()
  90. {
  91.     if ( player.openState == osMediaOpen )
  92.     {
  93.         var ServerVersionString = player.currentMedia.getItemInfo("WMServerVersion");
  94.         if (ServerVersionString != "" && (parseInt(ServerVersionString)>=9))
  95.         {
  96.             return true;
  97.         }
  98.     }
  99.     return false;
  100. }