home *** CD-ROM | disk | FTP | other *** search
- /*
- ⌐2000 Microsoft Corporation. All rights reserved.
- */
- //<script>
- //SKIN MUST INCLUDE res://wmploc/RT_TEXT/#169 as a scriptfile
-
- var g_fExpectingSizeChange = false;
- var g_fUserHasSized = false;
-
-
- function OnLoad()
- {
- OnOpenStateChange();
- OnPlayStateChange();
- }
-
-
- function OnURLChange()
- {
- if (player.URL == "")
- view.title = xWMP.toolTip;
- else
- view.title = player.URL;
- }
-
-
- function SizeChange()
- {
- if (!g_fExpectingSizeChange)
- {
- g_fUserHasSized = true;
- }
- }
-
- function StartPlaying()
- {
- stereo.backgroundImage = 'icon_stereo.bmp';
- UpdateMetadata();
- }
-
- var g_lastImageSourceHeight=-1;
- var g_lastImageSourceWidth=-1;
-
- function SnapToSize(forceResize)
- {
- if (player.openState!=osMediaOpen)
- {
- return;
- }
-
- var isHeight = player.currentMedia.imageSourceHeight;
- var isWidth = player.currentMedia.imageSourceWidth;
-
- if (isHeight == 0)
- {
- view.height = 359 - 183;
- }
- else
- {
- if ( (forceResize==false) && (isHeight == g_lastImageSourceHeight) && (isWidth == g_lastImageSourceWidth))
- {
- return;
- }
-
- wmlogo.visible = false;
-
- // resize to the video size
- // we'll do this if we're stretch to fit and the user hasn't sized us yet,
- // or if we're not stretch to fit (zoom level is set)
-
- if ((!g_fUserHasSized && mediacenter.videoStretchToFit) || !mediacenter.videoStretchToFit)
- {
- var zoom = mediacenter.videoStretchToFit ? 100 : mediacenter.videoZoom;
-
- var x = (isWidth * (zoom / 100.0));
- if (x < 285)
- {
- x = 285;
- }
- var y = (isHeight * (zoom / 100.0));
-
- g_fExpectingSizeChange = true;
- view.width = x;
- view.height = 359 - 183 + y;
- g_fExpectingSizeChange = false;
- }
- }
- g_lastImageSourceWidth = isWidth;
- g_lastImageSourceHeight= isHeight;
- }
-
- function StopPlaying()
- {
- stereo.backgroundImage = '';
- wmlogo.visible = true;
- }
-
-
- function OnPlayStateChange()
- {
- if(player.PlayState == psUndefined ||
- player.PlayState == psReady)
- {
- StopPlaying();
- }
- else if (player.PlayState == psPlaying)
- {
- StartPlaying();
- }
- }
-
- function OnOpenStateChange()
- {
- if(player.OpenState == osMediaOpen)
- {
- UpdateMetadata();
- SnapToSize(false);
- }
- }
-
- function UpdateMetadata()
- {
- clip.value = player.currentmedia.getiteminfo("title");
- if(clip.value == "")
- clip.value = player.currentmedia.name;
-
- show.value = player.currentplaylist.getiteminfo("title");
- if(show.value == "")
- show.value = player.currentmedia.getiteminfo("Album");
-
- author.value = player.currentmedia.getiteminfo("author");
-
- copyright.value = player.currentmedia.getiteminfo("copyright");
- }
-