Ver Mensaje Individual
  #4 (permalink)  
Antiguo 13/04/2010, 11:00
vegas
 
Fecha de Ingreso: mayo-2003
Mensajes: 194
Antigüedad: 21 años, 6 meses
Puntos: 4
Respuesta: Problema con swichmax "se mezcla sonido de los videos"

os pongo el codigo scrpt del los botones del reproductor de video para ver si me podeis ayudar a saber que funcion o variable controla el que el reproductor comience en stop o pause, no en play.

function HasNavigationPoints() {
return theVideoPlayer.cuePoints.length > 0;
}
function LoadedPercentage() {
return theVideoPlayer.loadedPercentage;
}
function Playing() {
return theVideoPlayer.playing;
}
function TotalTime() {
return theVideoPlayer.totalTime;
}
function PlayheadTime() {
return theVideoPlayer.playheadTime;
}
function PlayheadPercentage() {
return theVideoPlayer.playheadPercentage;
}
function Volume() {
return theVideoPlayer.volume;
}
function Muted() {
return theVideoPlayer.muted;
}
function PlayVideo() {
theVideoPlayer.stop();
}
function StopVideo() {
theVideoPlayer.play();
}
function PauseVideo() {
theVideoPlayer.pause();
}
function ForwardVideo() {
theVideoPlayer.seekToNextNavCuePoint();
}
function BackwardVideo() {
theVideoPlayer.seekToPrevNavCuePoint();
}
function SetPlayheadTime(t) {
theVideoPlayer.playheadTime = t;
}
function SetPlayheadPercentage(p) {
theVideoPlayer.playheadPercentage = p;
}
function MuteVideo() {
theVideoPlayer.muted = true;
}
function UnmuteVideo() {
theVideoPlayer.muted = false;
}
function SetVolume(v) {
theVideoPlayer.volume = v;
}
//
// these functions are for temporarily pausing
// the video while we do other actions and then
// restoring the play status after we finish.
//
function RestorePlayPause() {
if (wasPlaying) {
theVideoPlayer.play();
wasPlaying = false;
}
isTemporaryPause = false;
}
function TemporaryPause() {
if (! isTemporaryPause) {
wasPlaying = Playing();
}
theVideoPlayer.pause();
isTemporaryPause = true;
}
//
onSelfEvent (load) {
//
// set up playControl
//
playControl.onEnterFrame = function () {
var playing = Playing() || wasPlaying;
this.PlayBtn._visible = ! playing;
this.PauseBtn._visible = playing;
};
playControl.PlayBtn._button.onRelease = function () {
PlayVideo();
};
playControl.PauseBtn._button.onRelease = function () {
PauseVideo();
};
playControl.StopBtn._button.onRelease = function () {
StopVideo();
};
//
// set up playheadControl
//
playheadControl.FormatTimeDisplay = function (t) {
h = t / 3600;
m = (h - Math.floor(h)) * 60;
s = (m - Math.floor(m)) * 60;
d = (s - Math.floor(s)) * 10;
h = Math.floor(h);
m = Math.floor(m);
s = Math.floor(s);
d = Math.floor(d);
h = (h < 10) ? "0" add h : h;
m = (m < 10) ? "0" add m : m;
s = (s < 10) ? "0" add s : s;
return h add ":" add m add ":" add s add "." add d;
};
playheadControl.UpdateLoadIndicator = function () {
this.LoadIndicator._xscale = LoadedPercentage();
};
playheadControl.Tracker = function () {
this.UpdateLoadIndicator();
this.Thumb._x = PlayheadPercentage() / 100 * this.Track._width + this.Track._x;
this.TimeDisplay = this.FormatTimeDisplay(PlayheadTime());
};
playheadControl.Dragger = function () {
this.UpdateLoadIndicator();
var p = ((this.Thumb._x-this.Track._x)/this.Track._width * 100);
this.TimeDisplay = this.FormatTimeDisplay(p*TotalTime()/100);
SetPlayheadPercentage(p);
};
playheadControl.StartDragging = function () {
this.onEnterFrame = this.Dragger;
this.Thumb.startDragUnlocked(this.Track._x,this.Tr ack._x+this.Track._width,this.Track._y,this.Track. _y);
TemporaryPause();
};
playheadControl.StopDragging = function () {
this.onEnterFrame = this.Tracker;
this.Thumb.stopDrag();
RestorePlayPause();
};
playheadControl.Thumb._button.onPress = function () {
this._parent._parent.StartDragging();
};
playheadControl.Thumb._button.onRelease = playheadControl.Thumb._button.onReleaseOutside = function () {
this._parent._parent.StopDragging();
};
playheadControl.onEnterFrame = playheadControl.Tracker;
//
// set up navigationControl
//
navigationControl.initDelay = 0.32; // delay for nav repeat
navigationControl.speedUp = 0.7;
navigationControl.interval = undefined;
navigationControl.rate = 16;
navigationControl.MovementStart = function (fw) {
TemporaryPause();
this.interval = setInterval(this,"Movement",10,fw);
this.delay = this.initDelay;
this.doneit = false;
this.time = PlayheadTime();
this.pressedTimer = getTimer()/1000;
this.show = true;
};
navigationControl.Movement = function (fw) {
var now = getTimer()/1000;
if (HasNavigationPoints()) {
if (now-this.pressedTimer > this.delay) {
this.delay *= this.speedUp;
this.pressedTimer = now;
if (fw) {
ForwardVideo();
} else {
BackwardVideo();
}
this.doneit = true;
}
} else {
if (this.show) {
var dir = fw ? +1 : -1;
SetPlayheadTime(this.time+(now-this.pressedTimer)*2*this.rate*dir);
TemporaryPause();
}
this.show = ! this.show;
}
updateAfterEvent();
};
navigationControl.MovementEnd = function (fw) {
if (HasNavigationPoints()) {
if (! this.doneit) {
if (fw) {
ForwardVideo();
} else {
BackwardVideo();
}
}
}
RestorePlayPause();
clearInterval(this.interval);
this.interval = undefined;
};
navigationControl.Forward._button.onPress = function () {
this._parent._parent.MovementStart(true);
};
navigationControl.Forward._button.onRelease = navigationControl.Forward._button.onReleaseOutside = function () {
this._parent._parent.MovementEnd(true);
};
navigationControl.Backward._button.onPress = function () {
this._parent._parent.MovementStart(false);
};
navigationControl.Backward._button.onRelease = navigationControl.Backward._button.onReleaseOutsid e = function () {
this._parent._parent.MovementEnd(false);
};
//
// set up volumeControl
//
volumeControl.UpdateControls = function () {
var m = Muted();
this.Mute._visible = ! m;
this.Unmute._visible = m;
};
volumeControl.Unmute._button.onRelease = function () {
UnmuteVideo();
};
volumeControl.Mute._button.onRelease = function () {
MuteVideo();
};
volumeControl.Tracker = function () {
this.Thumb._x = Volume() / 100 * this.Track._width + this.Track._x;
this.VolumeDisplay = Math.round(Volume());
this.UpdateControls();
};
volumeControl.Dragger = function () {
var v = ((this.Thumb._x-this.Track._x)/this.Track._width * 100);
this.VolumeDisplay = Math.round(v);
SetVolume(v);
this.UpdateControls();
};
volumeControl.StartDragging = function () {
this.onEnterFrame = this.Dragger;
this.Thumb.startDragUnlocked(this.Track._x,this.Tr ack._x+this.Track._width,this.Track._y,this.Track. _y);
};
volumeControl.StopDragging = function () {
this.onEnterFrame = this.Tracker;
this.Thumb.stopDrag();
};
volumeControl.Thumb._button.onPress = function () {
this._parent._parent.StartDragging();
};
volumeControl.Thumb._button.onRelease = volumeControl.Thumb._button.onReleaseOutside = function () {
this._parent._parent.StopDragging();
};
volumeControl.onEnterFrame = volumeControl.Tracker;
//
// the external video player object we are controlling
//
theVideoPlayer = _parent[properties.VideoPlayer];
//
// init the vars for temporary pause
//
isTemporaryPause = false;
wasPlaying = false;


he cambiado cosas y nada de nada.

un saludo y muchas gracias.