AS2: vídeo incrustado (clip) crear una barra de controles

  • Hybrid
  • Born
  • Born
  • No Avatar
  • Registrado: Mar 30, 2011
  • Mensajes: 1
  • Status: Offline

Nota Marzo 30th, 2011, 6:30 am

Hola,

Yo douvrir esta nueva discusión, porque a pesar de mis investigaciones en la red, los sitios de recursos o tutoriales, y este foro...No he encontrado una solución.

Hace unos meses jai hizo un interfaz de Flash (diseñado para Loff-line), es un exe o aplicación que se ejecuta desde un CD.
En esta interfaz, hay videos que he elegido para poner en práctica "video integrado" (por varias razones).

Javais ya ha creado botones de reproducción - pausa - Arriba - Saltar hasta el final para controlar el vídeo.

Hoy en día, este video, me gustaría añadir una barra de controles (o la barra de línea de tiempo). Cest decir, como cualquier reproductor de vídeo (o audio) para tener una barra horizontal (que representa la duración), y un botón que avanzan (que es visualmente vídeo representante durante toda la duración).

La idea es primero para ver dónde estamos en el video.
Y segundo, puede hacer clic en este botón para mover manualmente el vídeo.

El truco es para un clásico video ^ ^ ¿Qué

I & #39, no soy un profesional en la programación...
Aquí es todavía jarrive qué hacer.

Por ejemplo, mi tarjeta de video integrada es de 2.000 marcos, y mi 800px línea de tiempo.
Así que hay un informe x2. 5

Código: [ Select ]
on(press) {
    startDrag(bille, false, 0, 400, 800, 400);
}
on(release) {
    stopDrag();
    //On récupère la position x de la bille
    this.bille._x;
    //On implante la position x de la bille dans une variable
    positionbille = bille._x;
    //On multiplie cette valeur au prorata du nombre de clé de la vidéo
    positionclip = positionbille * 2.5
    //On arrondi cette valeur pour avoir un nombre entier
    positionclip = Math.round(positionclip/100) * 100
    //Ce nombre correspond à la clé du clip de la vidéo
    _parent.COMFORT.gotoAndPlay(positionclip);
}
  1. on(press) {
  2.     startDrag(bille, false, 0, 400, 800, 400);
  3. }
  4. on(release) {
  5.     stopDrag();
  6.     //On récupère la position x de la bille
  7.     this.bille._x;
  8.     //On implante la position x de la bille dans une variable
  9.     positionbille = bille._x;
  10.     //On multiplie cette valeur au prorata du nombre de clé de la vidéo
  11.     positionclip = positionbille * 2.5
  12.     //On arrondi cette valeur pour avoir un nombre entier
  13.     positionclip = Math.round(positionclip/100) * 100
  14.     //Ce nombre correspond à la clé du clip de la vidéo
  15.     _parent.COMFORT.gotoAndPlay(positionclip);
  16. }




A priori, parece que funciona...
En este punto, sólo logran una condición if / else, para poner un gotoAndPlay si la película se reproduce o gotoAndStop si el vídeo está en pausa.
Bueno, hay cétait más fácil ^ ^

Pero las tareas más difíciles por delante, que automáticamente avanzar con el balón en la línea de tiempo cuando se reproduce el video. Y en su cuelgo.
(Jappelli que la pelota está en el botón o deslizador)

En mi pensamiento (tal vez falso)...a la pelota por delante de la línea de tiempo, se debe recuperar linformation en lo que "clave" es el video (por ejemplo, 250), divida este valor por 2,5 (para 100), y así mover la bola x 100px.

Pero no puedo encontrar la manera en AS2, puede recuperar linformation a-saber-qué-a-ser-clave-es-lanimation.

Porque una vez que esta información de vuelta, sólo (y supongo que #39, m) aplicar dicho valor en una variable, y siempre con una buena regla de tres, convertir este valor para indicar la posición de la bola en la que x debe ser encontrado.

Si usted tiene alguna idea, conduce, sugerencias o incluso una solución, gracias ;)
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Marzo 30th, 2011, 6:30 am

  • IceCold
  • Guru
  • Guru
  • Avatar de Usuario
  • Registrado: Nov 05, 2004
  • Mensajes: 1254
  • Loc: Ro
  • Status: Offline

Nota Abril 4th, 2011, 3:53 am

Para ello es necesario conocer el tiempo total de la película.
Código: [ Select ]
var timeTotal = 15; // total time of the movie, in seconds
var dragXStart = 0; // left most x position of the ball
var dragXEnd = 800; // right most x position of the ball

// this will return the time you have to set for your player, after you dragged the ball
function GetPlayTime()
{
var nPercent:Number = 100*(bille._x - dragXStart)/dragXEnd;
var nTime:Number = nPercent*timeTotal/100;
return Math.floor(nTime);
}

// so use it something like this:
on(release) {
var playerTime = GetPlayTime();
// netStream is the net stream you attached to your video; i.e.: my_video.attachVideo(netStream);
netStream.seek(playerTime);
}
  1. var timeTotal = 15; // total time of the movie, in seconds
  2. var dragXStart = 0; // left most x position of the ball
  3. var dragXEnd = 800; // right most x position of the ball
  4. // this will return the time you have to set for your player, after you dragged the ball
  5. function GetPlayTime()
  6. {
  7. var nPercent:Number = 100*(bille._x - dragXStart)/dragXEnd;
  8. var nTime:Number = nPercent*timeTotal/100;
  9. return Math.floor(nTime);
  10. }
  11. // so use it something like this:
  12. on(release) {
  13. var playerTime = GetPlayTime();
  14. // netStream is the net stream you attached to your video; i.e.: my_video.attachVideo(netStream);
  15. netStream.seek(playerTime);
  16. }
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”

Publicar Información

  • Total de mensajes en este tema: 2 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 33 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC