home *** CD-ROM | disk | FTP | other *** search
- //
- // ⌐2000 Microsoft Corporation. All rights reserved.
- //
-
- function OnLoad()
- {
- OnPlayStateChange();
- }
-
-
- function FormatString( value )
- {
- value = Math.round(value);
-
- var s = '';
- if ((value / 60) < 10)
- {
- s = '0';
- }
- s = s + Math.floor(value / 60);
-
- s = s + ':';
-
- if ((value % 60) < 10)
- {
- s = s + '0';
- }
- s = s + (value % 60);
- return s;
- }
-
-
- function OnTimerTick()
- {
- if (player.PlayState != psUndefined)
- {
- tracktime.value = FormatString(seek.value);
- }
- }
-
-
- function OnURLChange()
- {
- view.title = player.URL;
- }
-
-
- function StartPlaying()
- {
- if (player.currentMedia.ImageSourceHeight == 0)
- {
- icon.backgroundImage="icon_playing.bmp";
-
- view.height = 359 - 183;
- }
- else
- {
- wmlogo.visible = false;
- icon.backgroundImage="icon_video.bmp";
-
- // resize to the video size
-
- var x = player.currentMedia.ImageSourceWidth;
- if (x < 285)
- {
- x = 285;
- }
- var y = player.currentMedia.ImageSourceHeight;
-
- view.width = x;
- view.height = 359 - 183 + y;
- }
- duration.value = ' / ' + FormatString(seek.max);
- stereo.backgroundImage = 'icon_stereo.bmp';
- }
-
-
- function StopPlaying()
- {
- duration.value = '';
- tracktime.value = '';
- icon.backgroundImage = '';
- stereo.backgroundImage = '';
- wmlogo.visible = true;
- }
-
-
- function OnPlayStateChange()
- {
- switch (player.PlayState)
- {
- case psUndefined:
- info.value="Closed";
- StopPlaying();
- break;
- case psStopped:
- info.value="Stopped";
- break;
- case psPaused:
- info.value="Paused";
- break;
- case psPlayinging:
- info.value="Playing";
- StartPlaying();
- break;
- case psScanForward:
- info.value="Scanning Forward";
- break;
- case psScanReverse:
- info.value="Scanning Backward";
- break;
- case psBuffering:
- info.value="Buffering...";
- break;
- }
- info.tooltip = info.value;
- }
-
- function OnOpenStateChange()
- {
- switch (player.OpenState)
- {
- case osUndefined:
- break;
- case osMediaOpen:
- clip.value = player.currentmedia.getiteminfo("clip");
- if(clip.value == "")
- clip.value = player.currentmedia.getiteminfo("title");
-
- show.value = player.currentmedia.getiteminfo("show");
- if(show.value == "")
- show.value = player.currentmedia.getiteminfo("WM/AlbumTitle");
-
- author.value = player.currentmedia.getiteminfo("author");
-
- copyright.value = player.currentmedia.getiteminfo("copyright");
-
-
- break;
- }
- }
-