home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Minami 73
/
MINAMI73.iso
/
Extra
/
MPSetup.exe
/
1033
/
RCDATA
/
CABINET
/
wmploc.DLL
/
256
/
CORPORATE.JS
< prev
next >
Wrap
Text File
|
2002-12-14
|
8KB
|
283 lines
//<script>
//SKIN MUST INCLUDE res://wmploc/RT_TEXT/#169 as a scriptfile
var g_kCaptionWindowHeight=100;
var g_kDefaultViewHeight=274;
var g_kDefaultViewWidth=300;
var g_kDefaultScreenHeight=204;
var g_kDefaultViewHeightCaptions=(g_kDefaultViewHeight+g_kCaptionWindowHeight);
var g_kMinimumResizeHeight = 140;
var g_kMinimumResizeWidth = g_kDefaultViewWidth;
function InitCorporate()
{
var contrastView = 'corporate' + mediacenter.contrastMode;
if (contrastView != view.id) theme.currentViewID = contrastView;
DoSnapToSize();
svLogo.alphaBlendTo(0,1900);
InitSamiDisplay();
InitVisualizations(); // Init the Video and Visualization windows
InitCorporateControls();
}
var g_lastVideoHeight=-1;
var g_lastVideoWidth=-1;
var g_lastUserAudioHeight=-1;
var g_lastUserAudioWidth=-1;
var g_captionsWereShowingOnLastAudio=null;
function DoSnapToSize()
{
if (player.openState==osMediaOpen)
{
var h = player.currentMedia.imageSourceHeight;
var w = player.currentMedia.imageSourceWidth;
// do this only if it is different than the previous file's height/width
if ( (h!=g_lastVideoHeight) || (w!=g_lastVideoWidth) )
{
if ( (h!=0) && (w!=0) )
{
if (g_lastVideoHeight==0)
{
g_lastUserAudioHeight=view.height;
g_lastUserAudioWidth=view.width;
g_captionsWereShowingOnLastAudio = mediacenter.showCaptions;
}
SnapToVideoSize(h,w);
}
else
{
if ( (g_lastVideoHeight>0) && (g_lastUserAudioHeight>0))
{
if (g_captionsWereShowingOnLastAudio != mediacenter.showCaptions)
{
view.height = g_captionsWereShowingOnLastAudio ? g_lastUserAudioHeight - g_kCaptionWindowHeight : g_lastUserAudioHeight + g_kCaptionWindowHeight;
}
else
{
view.height = g_lastUserAudioHeight;
}
view.width=g_lastUserAudioWidth;
}
}
g_lastVideoHeight = h;
g_lastVideoWidth = w;
}
}
}
function SnapToVideoSize(isHeight, isWidth)
{
if (null!=isHeight)
{
isHeight = isHeight*(mediacenter.videoZoom/100);
var nonVideoHeight = view.height - svScreen.height;
var newWindowHeight = Math.max(isHeight+nonVideoHeight,g_kMinimumResizeHeight);
view.height = newWindowHeight;
}
if (null!=isWidth)
{
isWidth = isWidth*(mediacenter.videoZoom/100);
var nonVideoWidth = view.width - svScreen.width;
var newWindowWidth = Math.max(isWidth + nonVideoWidth,g_kMinimumResizeWidth);
view.width = newWindowWidth;
}
}
function InitVisualizations()
{
if (player.openState==osMediaOpen)
{
if (player.currentMedia.ImageSourceWidth > 0)
{
myeffect.visible=false;
video1.visible=true;
}
else
{
video1.visible=false;
myeffect.visible=mediacenter.showEffects;
}
}
}
function OnPlayStateChangeViz()
{
InitVisualizations();
}
function OnOpenStateChangeViz()
{
InitVisualizations();
}
function AutoSize()
{
if (player.openState==osMediaOpen)
{
DoSnapToSize();
}
else
{
if (mediacenter.showCaptions)
{
view.height=g_kDefaultViewHeightCaptions;
}
else
{
view.height=g_kDefaultViewHeight;
}
view.width=g_kDefaultViewWidth;
}
}
function CheckForAdBanner(media)
{
var oldHeight = svBanner.height;
if (media.getItemInfo('BannerURL') != '')
{
AdBanner.image="WMPImage_AdBanner";
svBanner.height=AdBanner.height;
AdBanner.tabStop=true;
}
else
{
svBanner.height=0;
AdBanner.tabStop=false;
}
if (svBanner.height!=oldHeight)
{
svVideo.height = view.height - svTransport.height - svBanner.height;
svVisual.height = view.height - svTransport.height - svBanner.height;
svBanner.top = svVideo.top + svVideo.height;
}
}
function OnBannerClick()
{
if (player.openState==osMediaOpen)
{
var strTargetURL = player.currentmedia.getItemInfo("BannerInfoURL");
if ( strTargetURL != "")
{
player.launchURL(strTargetURL);
}
}
}
function OnBannerMouseOver()
{
if (player.openState==osMediaOpen)
{
if ( player.currentmedia.getItemInfo("BannerInfoURL") != "")
{
AdBanner.cursor = "hand";
}
else
{
AdBanner.cursor = "system";
}
}
}
function CaptionsView_OnOpenStateChangeEvent(NewState)
{
switch (NewState)
{
case osMediaChanging:
ClearSamiDisplay();
break;
}
}
function InitSamiDisplay()
{
Browser1.loadSpecialPage("SAMI");
}
function ClearSamiDisplay()
{
handleScriptCommand("Text", "");
}
function handleScriptCommand(scType, Param)
{
var Document = 0;
var ElemCollection = 0;
var Element = 0;
scType = scType.toUpperCase();
if(scType == "TEXT" || scType == "<SYNC" || scType == "CAPTION")
{
Browser1.showSAMIText(Param);
}
}
function SetCaptions(visible)
{
var oldWidth = view.width;
if (svTransport.top)
{
svScreen.verticalAlignment="top";
if (visible)
{
var intendedHeight = svCaptions.top + g_kCaptionWindowHeight + svTransport.height;
view.height = intendedHeight;
if (view.height != intendedHeight)
{
theme.currentViewID=(view.id);
}
Browser1.height=g_kCaptionWindowHeight;
}
else
{
view.height = svCaptions.top + svTransport.height;
}
svScreen.verticalAlignment="stretch";
}
if (view.width!=oldWidth)
{
theme.currentViewID=(view.id);
}
}
function InitCorporateControls()
{
if (view.id=="corporateWB")
{
g_strPlayImage="res://wmploc/#1849";
g_strPlayHover="res://wmploc/#1849";
g_strPlayDown="res://wmploc/#1849";
g_strPauseUp="res://wmploc/#1851";
g_strPauseHover="res://wmploc/#1851";
g_strPauseDown="res://wmploc/#1851";
}
else if (view.id=="corporateBW")
{
g_strPlayImage="res://wmploc/#1864";
g_strPlayHover="res://wmploc/#1864";
g_strPlayDown="res://wmploc/#1864";
g_strPauseUp="res://wmploc/#1865";
g_strPauseHover="res://wmploc/#1865";
g_strPauseDown="res://wmploc/#1865";
}
else
{
g_strPlayImage="res://wmploc/#1815";
g_strPlayHover="res://wmploc/#1816";
g_strPlayDown="res://wmploc/#1817";
g_strPauseUp="res://wmploc/#1818";
g_strPauseHover="res://wmploc/#1819";
g_strPauseDown="res://wmploc/#1820";
}
OnOpenStateChangeTransport(player.openState);
OnPlayStateChangeTransport(player.playState);
OnStatusChangeTransport(player.status);
}