home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2003 February
/
Chip_2003-02_cd1.bin
/
zkuste
/
wmakeup
/
download
/
xXx_XP.wmz
/
xxx.js
< prev
next >
Wrap
Text (UTF-16)
|
2002-06-10
|
31KB
|
726 lines
/*
http://www.theskinsfactory.com
info@theskinsfactory.com
*/
function checkMediaOnLoad(){
if(player){}
view.width = 0;
view.height = 0;
view.backgroundImage = "";
if( ((player.Playstate==3)||(player.Playstate==2)) && (player.currentMedia.ImageSourceWidth>0)){
theme.currentViewID = 'videoView';
theme.savePreference("videoViewOn","true");
loadGlobalPrefs();
}else{
theme.currentViewID = 'mainView';
theme.savePreference("videoViewOn","false");
loadGlobalPrefs();
if (!player.controls.isAvailable("Stop")) {
if(player.currentMedia.ImageSourceWidth>0){
theme.currentViewID = 'videoView';
theme.savePreference("videoViewOn","true");
}
}
}
}
// main startup
function mainStartUp(){
volume.value = player.settings.volume;
visEffects.currentEffectType = mediacenter.effectType;
visEffects.currentPreset = mediacenter.effectPreset;
shutterButton.down = true;
disableButtons();
updateVolToolTip();
if (!player.controls.isAvailable("Stop")) {
moveButtonTrigger();
}else{
enableButtons();
}
checkPlayerState();
}
// buttons
function moveButtonTrigger(){
buttonTrigger.moveTo(50,50,7000);
}
function disableButtons(){
mainOpenButton.visible = false;
mainPlayButton.visible = false;
// mainPauseButton.visible = false;
shutterButton.visible = false;
mainEQButton.visible = false;
mainPrevButton.visible = false;
mainVisButtons.visible = false;
mainNextButton.visible = false;
mainPLButton.visible = false;
// mainMinCloseButtons.visible = false;
mainStopButton.visible = false;
mainInfoButton.visible = false;
}
function enableButtons(){
mainOpenButton.visible = true;
mainPlayButton.visible = true;
// mainPauseButton.visible = true;
shutterButton.visible = true;
mainEQButton.visible = true;
mainPrevButton.visible = true;
mainVisButtons.visible = true;
mainNextButton.visible = true;
mainPLButton.visible = true;
// mainMinCloseButtons.visible = true;
mainStopButton.visible = true;
mainInfoButton.visible = true;
}
// play states -- main player
function checkPlayerState(){
if (player){
switch (player.playState){
case 0: //undefined
break;
case 1: //stopped
break;
case 2: //paused
visMark = visMark;
mainIntro.visible = false;
break;
case 3: //playing
mainIntro.visible = false;
if(player.currentMedia.ImageSourceWidth>0){
theme.currentViewID = 'videoView';
theme.savePreference("videoViewOn","true");
}
visMark = visMark;
toggleVis();
break;
case 6: //buffering
break;
case 7: //waiting
break;
case 8: //media ended
break;
case 9: //Transitioning
break;
case 10: //Ready
break;
}
}
if (!player.controls.isAvailable("Stop")) {
killVis();
visMark = visMark;
mainVisButton.enabled = false;
}
updateMetadata();
}
//
function checkPlayerMediaGlobal(){
if((player.OpenState == osMediaOpen) && (player.currentMedia.ImageSourceWidth>0)){
if(("true"==theme.loadPreference("videoViewOn")) || (player.playState==8&&("true"==theme.loadPreference("videoViewOn")))){
theme.savePreference("videoViewOn","true");
}else{
theme.currentViewID="videoView";
theme.savePreference("videoViewOn","true");
}
}else if((player.currentMedia.duration > 0) && !(player.currentMedia.ImageSourceWidth>0)){
if("false"==theme.loadPreference("videoViewOn")){
theme.savePreference("videoViewOn","false");
}else{
theme.currentViewID="mainView";
theme.savePreference("videoViewOn","false");
}
}else{
videoViewOn = videoViewOn;
}
}
//meta data
function updateMetadata(){
if(player.openState!=13) return;
metadata.value = player.status;
authorppl = player.currentmedia.getiteminfo("#author");
if (authorppl == "") {
authorppl = player.currentmedia.getiteminfo("author");
}
if (authorppl != "") {
authorppl += " - ";
}
if (metadata.value != "") {
metadata.value += " - ";
}
metadata.value += authorppl;
metadata.value += player.currentmedia.name;
metadata.scrolling = (metadata.textWidth>metadata.width);
metadata.value = metadata.value.toUpperCase();
}
// vis code
function killVis(){
visPrev.enabled = false;
visNext.enabled = false;
playbackAnim.visible = false;
visMask.visible = false;
playbackAnim.backgroundImage = "";
}
visMark = 1;
function toggleVis(){
killVis();
switch(visMark){
case 1:
playbackAnim.visible = true;
playbackAnim.backgroundImage = "main_playback.gif";
break;
case 2:
visMask.visible = true;
visPrev.enabled = true;
visNext.enabled = true;
break;
case 3:
killVis();
visMark = 0;
break;
}
mainVisButton.enabled = true;
}
// main prefs
function loadMainPrefs(){
theme.savePreference("videoViewOn","false");
}
function saveMainPrefs() {
}
function mainShutDown(){
mediacenter.effectType = visEffects.currentEffectType;
mediacenter.effectPreset = visEffects.currentPreset;
saveMainPrefs();
}
// extra functions
function updateVolToolTip(){
volume.toolTip = "Volume - [";
volume.toolTip += player.settings.volume;
volume.toolTip += "%]";
}
function updateSeekToolTip(){
progressMain.toolTip = "Seek - [";
progressMain.toolTip += player.controls.currentPositionString;
progressMain.toolTip += "]";
}
function volUpDown(event){
switch(event.keycode){
case 39:
case 38:
if(player.settings.volume < 95){
player.settings.volume+=5;
}else{
player.settings.volume = 100;
}
break;
case 37:
case 40:
if(player.settings.volume > 5){
player.settings.volume-=5;
}else{
player.settings.volume = 0;
}
break;
}
}
function seekUpDown(event){
switch(event.keycode){
case 39:
case 38:
if(player.controls.currentPosition > 10){
player.controls.currentPosition-=10;
}else{
player.controls.currentPosition = 0;
}
break;
case 37:
case 40:
if(player.controls.currentPosition < 900){
player.controls.currentPosition+=10;
}else{
player.controls.currentPosition = 1000;
}
break;
}
}
function viewResizer(event){
switch(event.keycode){
case 37:
view.width-=20;
break;
case 38:
view.height-=20
break;
case 39:
view.width+=20;
break;
case 40:
view.height+=20;
break;
}
}
function viewHotKeys(){
switch(event.keycode){
case 122:
case 90:
player.controls.previous();
break;
case 120:
case 88:
player.controls.play();
break;
case 99:
case 67:
player.controls.pause();
break;
case 118:
case 86:
player.controls.stop();
break;
case 98:
case 66:
player.controls.next();
break;
case 108:
case 76:
player.URL=theme.openDialog('FILE_OPEN','FILES_ALLMEDIA');
break;
case 80:
case 112:
togglePL();
break;
case 102:
case 70:
// if()&&player.PlayState==3){
// videoZoom();
// }
break;
}
}
// eq stuff
function toggleEQ(){
if("true"==theme.loadPreference("eqViewer")){
theme.savePreference("eqViewer", "false");
theme.closeView( "eqView" );
}else{
theme.openView( "eqView" );
}
}
// content stuff
function toggleContent(){
if("true"==theme.loadPreference("contentViewer")){
theme.savePreference("contentViewer", "false");
theme.closeView( "contentView" );
}else{
theme.openView( "contentView" );
}
}
//
function hideOthers(){
contentBg.visible = false;
contentMission.visible = false;
contentDossier.visible = false;
navArrows.visible = false;
imgBack.visible = false;
navArrowBack.visible = false;
}
contentMenu = 1;
function contentSwitch(){
//hideOthers()
switch (contentMenu){
case 0:
contentMission.moveTo(20,-400,600);
contentDossier.moveTo(20,-400,600);
contentBg.alphaBlendTo(0,600);
imgBack.alphaBlendTo(0,600);
navArrowBack.visible = false;
navArrows.visible = false;
imgBackButton.visible = false;
navButtons.visible = true;
break;
case 1:
contentBg.alphaBlendTo(255,600);
contentMission.moveTo(20,20,600);
navArrowBack.visible = true;
navButtons.visible = false;
break;
case 2:
contentBg.alphaBlendTo(255,600);
contentDossier.moveTo(20,20,600);
navArrowBack.visible = true;
navButtons.visible = false;
break;
case 3:
imgBack.alphaBlendTo(255,600);
imgBackButton.visible = true;
navArrows.visible = true;
navButtons.visible = false;
imgCycle = imgCycle;
if(imgCycle==0){
imgCycle=1;
}
if(imgCycle==8){
imgCycle=7;
}
}
}
imgCycle = 1;
function cycleIMG(){
switch(imgCycle){
case 0:
contentSwitch(contentMenu=0);
break
case 1:
imgBack.backgroundImage = "img_1.jpg";
break;
case 2:
imgBack.backgroundImage = "img_2.jpg";
break;
case 3:
imgBack.backgroundImage = "img_3.jpg";
break;
case 4:
imgBack.backgroundImage = "img_4.jpg";
break;
case 5:
imgBack.backgroundImage = "img_5.jpg";
break;
case 6:
imgBack.backgroundImage = "img_6.jpg";
break;
case 7:
imgBack.backgroundImage = "img_7.jpg";
break;
case 8:
contentSwitch(contentMenu=0);
break
}
}
// pl stuff
function loadPlPrefs(){
theme.savePreference( 'plViewer', "true" );
var dwScale = theme.loadPreference( "PlaylistWidth" );
if( "--" != dwScale )
{
plView.width = dwScale;
}
dwScale = theme.loadpreference( "PlaylistHeight" );
if( "--" != dwScale )
{
plView.height = dwScale;
}
plFrame.setColumnResizeMode( 0, "stretches" );
plFrame.setColumnResizeMode( 1, "autosizedata" );
plFrame.setColumnResizeMode( 2, "autosizedata" );
plFrame.setColumnResizeMode( 3, "autosizedata" );
}
function savePlPrefs(){
theme.savepreference( "PlaylistWidth", plView.width );
theme.savepreference( "PlaylistHeight", plView.height );
}
function togglePL(){
if("true"==theme.loadPreference("plViewer")){
theme.savePreference("plViewer", "false");
theme.closeView( "plView" );
}else{
theme.openView( "plView" );
}
}
// video settings
function loadVidPrefs(){
theme.savePreference("videoViewOn","true");
var _vidDrawer = theme.loadPreference('vidDrawer');
var _vidSlider = theme.loadPreference('vidSlider');
if (_vidDrawer != '--') {
vidDrawer = (_vidDrawer.toLowerCase() == 'true') ? false : true;
} else {
vidDrawer = true;
}
if (_vidSlider != '--') {
vidSlider = (_vidSlider.toLowerCase() == 'true') ? false : true;
} else {
vidSlider = true;
}
toggleVidDrawer();
moveSliderCover();
updateVolToolTip();
updateZoomToolTip();
checkVideoPlayerState();
}
function checkVideoPlayerState(){
if (player){
switch (player.playState){
case 0: //undefined
break;
case 1: //stopped
centerBox.visible = false;
break;
case 2: //paused
centerBox.visible = true;
SnapToVideo();
break;
case 3: //playing
centerBox.visible = true;
SnapToVideo();
break;
case 6: //buffering
centerBox.visible = false;
break;
case 7: //waiting
break;
case 8: //media ended
break;
case 9: //Transitioning
break;
case 10: //Ready
break;
}
vidZoom.enabled = true;
switchBackButton.enabled = false;
vidResizer.enabled = true;
switchBackButton.upToolTip = "Can't Switch Back While Video is Playing";
}
if (!player.controls.isAvailable("Stop")) {
centerBox.visible = false;
vidZoom.enabled = false;
switchBackButton.enabled = true;
vidResizer.enabled = false;
videoView.width = "479";
videoView.height = "347";
switchBackButton.upToolTip = "Switch Back To Player Mode";
}
updateVideoMetadata();
updateVolToolTip();
updateZoomToolTip();
}
function videoZoom(){
if(mediacenter.videoZoom < 76){
mediacenter.videoZoom = 100;
}else if(mediacenter.videoZoom <101){
mediacenter.videoZoom = 150;
}else if(mediacenter.videoZoom < 156){
mediacenter.videoZoom = 200;
}else{
mediacenter.videoZoom = 75;
}
SnapToVideo();
updateZoomToolTip();
updateVideoMetadata();
}
function updateZoomToolTip(){
vidZoom.upToolTip = "Zoom - [current: ";
vidZoom.upToolTip += mediacenter.videoZoom;
vidZoom.upToolTip += "%] - [next: ";
if(mediacenter.videoZoom < 76){
nextZoom = 100;
}else if(mediacenter.videoZoom <101){
nextZoom = 150;
}else if(mediacenter.videoZoom < 156){
nextZoom = 200;
}else{
nextZoom = 75;
}
vidZoom.upToolTip += nextZoom;
vidZoom.upToolTip += "%]";
}
function updateVideoMetadata(){
if(player.openState!=13) return;
vidMetadata.value = player.status;
vidauthorppl = player.currentmedia.getiteminfo("#author");
if (vidauthorppl == "") {
vidauthorppl = player.currentmedia.getiteminfo("author");
}
if (vidauthorppl != "") {
vidauthorppl += " - ";
}
if (vidMetadata.value != "") {
vidMetadata.value += " - ";
}
vidMetadata.value += vidauthorppl;
vidMetadata.value += player.currentmedia.name;
vidMetadata.value += " - [ ";
vidMetadata.value += mediacenter.videoZoom;
vidMetadata.value += "% ]";
vidMetadata.scrolling = (vidMetadata.textWidth>vidMetadata.width);
vidMetadata.value = vidMetadata.value.toUpperCase();
}
function SnapToVideo(){
var zoom = mediacenter.videoZoom;
var viewWidth = (player.currentMedia.imageSourceWidth * (zoom/100.00));
var viewHeight = (player.currentMedia.imageSourceHeight * (zoom/100.00));
view.width = viewWidth + 190;
view.height = viewHeight + 123;
}
vidDrawer = false;
vidSlider = false;
function toggleVidDrawer(){
if(!vidDrawer){
videoSettings.moveTo(0,0,500);
vidButtonBack.visible = !vidDrawer;
vidSliderCover.visible = !vidDrawer;
vidPLEQ.visible = !vidDrawer;
vidSliderButton.visible = !vidDrawer;
vidDrawer = !vidDrawer;
if(vidSlider){
vidSliderSet.visible = true;
}
vidControlButton.down = true;
}else{
videoSettings.moveTo(100,0,600);
vidDrawer = !vidDrawer;
vidControlButton.down = false;
}
}
function hideDrawerButtons(){
vidDrawer = vidDrawer;
vidButtonBack.visible = vidDrawer;
vidSliderCover.visible = vidDrawer;
vidPLEQ.visible = vidDrawer;
vidSliderButton.visible = vidDrawer;
if(!vidDrawer){
vidSliderSet.visible = false;
}
}
function moveSliderCover(){
if(!vidSlider){
vidSliderCover.moveTo(22,236,250);
vidSliderCoverUnder.moveTo(22,236,250);
vidSliderCoverTop.moveTo(22,236,250);
vidSliderSet.visible = !vidSlider;
vidSlider = !vidSlider;
}else{
vidSliderCover.moveTo(22,143,250);
vidSliderCoverUnder.moveTo(22,187,250);
vidSliderCoverTop.moveTo(22,103,250);
vidSlider = !vidSlider;
}
}
function hideVidSliders(){
vidSlider = vidSlider;
vidSliderSet.visible = vidSlider;
}
function saveVidPrefs(){
theme.savePreference('vidDrawer',vidDrawer);
theme.savePreference('vidSlider',vidSlider);
}
// global prefs
function loadGlobalPrefs(){
if ("true"==theme.loadPreference("eqViewer")){
theme.openView( 'eqView' );
}
if ("true"==theme.loadPreference("plViewer")){
theme.openView( 'plView' );
}
if ("true"==theme.loadPreference("contentViewer")){
theme.openView( 'contentView' );
}
}