Pourquoi ma video est elle géante?

zthibaut Messages postés 64 Date d'inscription mardi 26 avril 2005 Statut Membre Dernière intervention 23 juin 2008 - 10 janv. 2006 à 13:50
cs_redemption Messages postés 129 Date d'inscription vendredi 31 octobre 2003 Statut Membre Dernière intervention 13 septembre 2008 - 30 oct. 2006 à 09:07
bonjour le forum
voici mon soucie et j'ai bo cherché je ne trouve po
je refais mon site et on peu y regarder des videos et ecouter de la music
j'utilise pour le lecteur mp3 un loader et il n'y a pas de soucie le lecteur souvre la bonne taille et idem pour tous ce qui se charge via un loader
mais pour le video (j'utilise le superbe player qui se trouve ici http://www.jeroenwijering.com)ben au moment ou je clic sur mon bouton pour loader ma video elle se retrouve en geant sur ma page et je ne comprend pas bien pourquoi
si vous avez ue idée ou si il faut que je vous donne plus d'infos n'hesitez pas

merci a tous

voici deja le code sur la frame 1
--------------------------------------------------
// Stage variables


Stage.scaleMode = "Scale";
Stage.align = "TL";
Stage.showMenu = false;
stop();

et le code du player
-------------------------------------------------------
//--------------------------------------------------------------------------
// initial variables that might be useful to change
//--------------------------------------------------------------------------


// toggle for which file to play if none was set in html
// you can change the 'test.flv' in your filename!_root.file ? file "video.flv" : file _root.file;


// toggle for autostarting the video
// you can change the 'true' in 'false'!_root.autoStart ? autoStart true: autoStart _root.autoStart;


// toggle for the width and height of the video
// you can change them to the width and height you want
w = Stage.width;
h = Stage.height;


//--------------------------------------------------------------------------
// stream setup and functions
//--------------------------------------------------------------------------


// create and set netstream
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
ns.setBufferTime(5);


// create and set sound object
this.createEmptyMovieClip("snd", 0);
snd.attachAudio(ns);
audio = new Sound(snd);
unmuteBut._visible = false;


//attach videodisplay
videoDisplay.attachVideo(ns);


// Retrieve duration meta data from netstream
ns.onMetaData = function(obj) {
this.totalTime = obj.duration;
// these two lines were used for automatically sizing
// it is now done by sizing the video to stage dimensions
// w = videoDisplay.width;
// h = videoDisplay.height;
};


// retrieve status messages from netstream
ns.onStatus = function(object) {
if (object.code == "NetStream.Play.Start") {
// this is invoked when the stream starts playing
// w = videoDisplay.width;
// h = videoDisplay.height;
} else if(object.code == "NetStream.Buffer.Full") {
// this is invoked when the stream is buffered
// w = videoDisplay.width;
// h = videoDisplay.height;
} else if(object.code == "NetStream.Play.Stop") {
// rewind and pause on when movie is finished
ns.seek(0);
ns.pause();
playBut._visible = true;
pauseBut._visible = false;
videoDisplay._visible = false;
playText.txt.text = "click to play";
}
};



//--------------------------------------------------------------------------
// controlbar functionality
//--------------------------------------------------------------------------


// play the movie and hide playbutton
function playMovie() {
if(!isStarted) {
ns.play(file);
playText.txt.text = "loading ..";
isStarted = true;
} else {
ns.pause();
}
pauseBut._visible = true;
playBut._visible = false;
videoDisplay._visible = true;
}


// pause the movie and hide pausebutton
function pauseMovie() {
ns.pause();
playBut._visible = true;
pauseBut._visible = false;
};


// video click action
videoBg.onPress = function() {
if(pauseBut._visible == false) {
playMovie();
} else {
pauseMovie();
}
};


// pause button action
pauseBut.onPress = function() {
pauseMovie();
};


// play button action
playBut.onPress = function() {
playMovie();
};


// file load progress
percentBar.onEnterFrame = function() {
loaded = this._parent.ns.bytesLoaded;
total = this._parent.ns.bytesTotal;
if (loaded == total && loaded>1000) {
percentBar._width = bw;
delete this.onEnterFrame;
} else {
percentBar._width = int(bw*loaded/total);
}
};


// play progress function
progressBar.onEnterFrame = function() {
this._width = bw*ns.time/ns.totalTime;
};


// start playhead scrubbing
centerBg.onPress = function() {
this.onEnterFrame = function() {
scl = this._xmouse*this._xscale/bw/100;
ns.seek(scl*ns.totalTime);
};
};


// stop playhead scrubbingcenterBg.onRelease centerBg.onReleaseOutside function () {
delete this.onEnterFrame;
pauseBut._visible == false ? videoDisplay.pause() : null;
};


// mute button action
muteBut.onPress = function() {
audio.setVolume(0);
unmuteBut._visible = true;
this._visible = false;
};


// unmute button action
unmuteBut.onPress = function() {
audio.setVolume(100);
muteBut._visible = true;
this._visible = false;
};


//--------------------------------------------------------------------------
// resize and position all items
//--------------------------------------------------------------------------


// set videodisplay dimensionsvideoDisplay._width videoBg._width w;videoDisplay._height videoBg._height h-20;
playText._x = w/2;
playText._y = h/2-10;


// resize the items on the left ..
leftBg._x = 0;
leftBg._y = h-20;playBut._x pauseBut._x 12;playBut._y pauseBut._y h-10;


// resize the items in the middle .. centerBg._x percentBar._x progressBar._x = backBar._x = 21;
centerBg._y = h - 20;percentBar._y progressBar._y h - 12;bw centerBg._width percentBar._width = progressBar._width = w - 42;


// and resize the ones on the right ..
rightBg._x = w - 21;
rightBg._y = h - 20; muteBut._x unmuteBut._x w - 11;muteBut._y unmuteBut._y h - 10;



//--------------------------------------------------------------------------
// all done ? start the movie !
//--------------------------------------------------------------------------


// start playing the movie
// if no autoStart it searches for a placeholder jpg
// and hides the pauseBut
if (autoStart == true) {
playMovie();
} else {
pauseBut._visible = false;
imageStr = substring(file,0,file.length-3)+"jpg";
imageClip.loadMovie(imageStr);
}

2 réponses

daffy17 Messages postés 106 Date d'inscription mercredi 18 mai 2005 Statut Membre Dernière intervention 22 avril 2010
16 janv. 2006 à 11:59
si tu regarde dans cette fonction

//--------------------------------------------------------------------------
// resize and position all items
//--------------------------------------------------------------------------

// set videodisplay dimensionsvideoDisplay._width videoBg._width w;videoDisplay._height videoBg._height h-20;

le w et le h corresponde a la hauteur et la largeur, récupere plus haut, de la video chargé.
Donc si tu as des videos don la taille est 640*480, c'est forcer que celle ci s'ouvre en grand. essaye de definir cette taille en pourcentage
videoDisplay._width videoBg._width w*20/100; //si tu veux 20%

ou bien défini une taille fixe.
videoDisplay._width videoBg._width 100;

FireFox, FireFox
, FireFOOOOXXX !!!!
0
cs_redemption Messages postés 129 Date d'inscription vendredi 31 octobre 2003 Statut Membre Dernière intervention 13 septembre 2008
30 oct. 2006 à 09:07
Bonjour, je cherche un moyen de modifier la taille de de ma video.

// toggle for the width and height of the video
// you can change them to the width and height you want
w = Stage.height;
h = Stage.height;

ils disent que c'est possible de modifier mais je ne sais pas comment faire, j'ai essayé diverses combinaisons mais rien y fait
j'ai essayé cela :

w = 320.height;
w = Stage.320;
w = 320;
w = Stage.height(320);
w = "320";
w = Stage"320";
w = "320".height;

quelque chose m'echappe mais je sais pas koi
0
Rejoignez-nous