Script está causando el reproductor de Flash se ejecute lentamente error msg

  • ScottG
  • Proficient
  • Proficient
  • No Avatar
  • Registrado: Jul 06, 2010
  • Mensajes: 266
  • Status: Offline

Nota Febrero 23rd, 2011, 2:03 pm

Hola a empezar yo soy un buen programador y han ayudado a la gente en este foro antes de que yo estoy buscando para ver si alguien tiene alguna idea sobre mi problema que estoy teniendo.

La cuestión es que he hecho un reproductor de video simple, sin controles y con el propósito de repetir de vídeo y vídeos en pantalla completa de forma indefinida. (Esto se usa en un televisor con fines publicitarios y de formación. ) Se tendrá una duración de unos días y luego se detiene y en algunos casos se apareció el "El guión está causando el reproductor de Flash para funcionar lentamente, esto puede hacer que el equipo deje de responder, ¿desea anular el script?" mensaje. nadie antes ha dicho nada acerca de ese mensaje no puedo encontrar ningún bucles infinitos en el código. El código es muy simplista. ¿Alguna idea?

El destello de la película es un fondo negro con un componente FLVPlayback en el escenario.

XML de muestra:
XML Código: [ Select ]
<?xml version="1.0" encoding="utf-8"?>
<videos>
   <video url="video1.flv"></video>
   <video url="video2.flv"></video>
</videos>
 
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <videos>
  3.    <video url="video1.flv"></video>
  4.    <video url="video2.flv"></video>
  5. </videos>
  6.  


Action Script y #058;
ACTIONSCRIPT Código: [ Select ]
/***************| Initialization |***************/
 
// This indecates which video we are on it represents the first index in the video array
var on_video:Number = 0;
 
// This varible will trigger the screen to be in full screen mode
var fullscreen:Boolean = false;
 
// Make an array to hold onto the videos
var videos = Array();
 
// Make a new XML object
var video_xml:XML = new XML();
 
// Igonre white space in the xml file
video_xml.ignoreWhite = true;
 
// What to do when the XML loads
video_xml.onLoad = function(success:Boolean){
   
   // Check to see if the xml loaded correctly
   if (success) {
     
      // Grab all of the tracks and attributes
      var nodes:Array = this.firstChild.childNodes;
     
      // Loop through the node and add all of there attributes into the array
      for(var i=0;i<nodes.length;i++)  {
         trace(i + ' = ' + nodes[i].attributes.url)
         // Add all of the other information needed
         videos.push(nodes[i].attributes.url);
         
      }
     
      // Start to play the videos
      play_video();
   
   }
   
}
 
// Lets get the XML file
video_xml.load('http://mysite/getxml.php?ids=' + _root.playlist);
 
 
/***************| Playing Functionallity |***************/
 
// Play the video File
function play_video(){  
   
   // Set the video window to play the the video file as an flv
   myplayer.contentPath = videos[on_video];
   
   // Set the video size
   myplayer.setSize(Stage.width,Stage.height);
   
   // Reset the plery position
   myplayer.playheadTime = 0;
   
   // Play the video
   myplayer.play();
   
}
 
// This will increment the on video varible or reset it once it hits the end
function next_video() {
   
   // Add one to the on video varible or set back to zero if we are on the last video
   on_video = (on_video == videos.length-1) ? 0 : on_video + 1;
   trace(on_video)
   // play the video
   play_video();
   
}
 
 
/***************| General Functionallity |***************/
 
// Start an on enter frame event to do therest of the functionality
this.onEnterFrame = function(){
   
   // Calculate the percentage
   perc_complete = Math.round((myplayer.playheadTime / myplayer.totalTime) * 100);
   
   // Check to see if we are past zero and at 100 percent
   if(myplayer.totalTime > 0 && perc_complete >= 95) {
     
      // Play the next video
      next_video();
     
   }
   
   //trace(perc_complete)
   
}
 
// This will toggle the fullscreen flag
myplayer.onRelease = function() {
   
   // Check and set the flag
   fullscreen = (fullscreen) ? false : true;
   
   // Check to see if we are not in full screen and the fullscreen flag is true
   if(Stage.displayState == "normal") {
     
      // Launch fullscreen mode
      Stage.displayState = "fullScreen";
     
   } else {
     
      // return to the normal mode
      Stage.displayState = "normal";
     
   }
   
}
 
  1. /***************| Initialization |***************/
  2.  
  3. // This indecates which video we are on it represents the first index in the video array
  4. var on_video:Number = 0;
  5.  
  6. // This varible will trigger the screen to be in full screen mode
  7. var fullscreen:Boolean = false;
  8.  
  9. // Make an array to hold onto the videos
  10. var videos = Array();
  11.  
  12. // Make a new XML object
  13. var video_xml:XML = new XML();
  14.  
  15. // Igonre white space in the xml file
  16. video_xml.ignoreWhite = true;
  17.  
  18. // What to do when the XML loads
  19. video_xml.onLoad = function(success:Boolean){
  20.    
  21.    // Check to see if the xml loaded correctly
  22.    if (success) {
  23.      
  24.       // Grab all of the tracks and attributes
  25.       var nodes:Array = this.firstChild.childNodes;
  26.      
  27.       // Loop through the node and add all of there attributes into the array
  28.       for(var i=0;i<nodes.length;i++)  {
  29.          trace(i + ' = ' + nodes[i].attributes.url)
  30.          // Add all of the other information needed
  31.          videos.push(nodes[i].attributes.url);
  32.          
  33.       }
  34.      
  35.       // Start to play the videos
  36.       play_video();
  37.    
  38.    }
  39.    
  40. }
  41.  
  42. // Lets get the XML file
  43. video_xml.load('http://mysite/getxml.php?ids=' + _root.playlist);
  44.  
  45.  
  46. /***************| Playing Functionallity |***************/
  47.  
  48. // Play the video File
  49. function play_video(){  
  50.    
  51.    // Set the video window to play the the video file as an flv
  52.    myplayer.contentPath = videos[on_video];
  53.    
  54.    // Set the video size
  55.    myplayer.setSize(Stage.width,Stage.height);
  56.    
  57.    // Reset the plery position
  58.    myplayer.playheadTime = 0;
  59.    
  60.    // Play the video
  61.    myplayer.play();
  62.    
  63. }
  64.  
  65. // This will increment the on video varible or reset it once it hits the end
  66. function next_video() {
  67.    
  68.    // Add one to the on video varible or set back to zero if we are on the last video
  69.    on_video = (on_video == videos.length-1) ? 0 : on_video + 1;
  70.    trace(on_video)
  71.    // play the video
  72.    play_video();
  73.    
  74. }
  75.  
  76.  
  77. /***************| General Functionallity |***************/
  78.  
  79. // Start an on enter frame event to do therest of the functionality
  80. this.onEnterFrame = function(){
  81.    
  82.    // Calculate the percentage
  83.    perc_complete = Math.round((myplayer.playheadTime / myplayer.totalTime) * 100);
  84.    
  85.    // Check to see if we are past zero and at 100 percent
  86.    if(myplayer.totalTime > 0 && perc_complete >= 95) {
  87.      
  88.       // Play the next video
  89.       next_video();
  90.      
  91.    }
  92.    
  93.    //trace(perc_complete)
  94.    
  95. }
  96.  
  97. // This will toggle the fullscreen flag
  98. myplayer.onRelease = function() {
  99.    
  100.    // Check and set the flag
  101.    fullscreen = (fullscreen) ? false : true;
  102.    
  103.    // Check to see if we are not in full screen and the fullscreen flag is true
  104.    if(Stage.displayState == "normal") {
  105.      
  106.       // Launch fullscreen mode
  107.       Stage.displayState = "fullScreen";
  108.      
  109.    } else {
  110.      
  111.       // return to the normal mode
  112.       Stage.displayState = "normal";
  113.      
  114.    }
  115.    
  116. }
  117.  
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Febrero 23rd, 2011, 2:03 pm

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • Avatar de Usuario
  • Registrado: May 28, 2003
  • Mensajes: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Nota Febrero 23rd, 2011, 2:48 pm

Estoy inclinado a dudar de que su aún su código de eso es la culpa (ni veo un problema con un bucle sin fin allí). Curioso lo que la versión de Flash Player que está utilizando. Hay un montón de quejas sobre Flash Player 10 que utiliza el 100% de la CPU (y un montón de archivo de intercambio de memoria /). Flash Player está constantemente estrellarse Firefox para mí cuando estoy viendo un montón de videos FLV, como de Youtube, por ejemplo. Y me sale el mismo error.

Aquí está una lista de los requisitos mínimos del sistema que le puede resultar útil.
http://www.adobe.com/products/flashplayer/systemreqs/

Observe también una de las notas en esa página:
Quote:
Recomendaciones para las características de aceleración de hardware GPU dependientes. Flash Player utiliza el modo de software para sistemas que no cumplen con los requisitos del sistema.


Si se va a modo de software, que va a utilizar una CPU mucho más de lo que sería con el hardware de gráficos compatibles.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • ScottG
  • Proficient
  • Proficient
  • No Avatar
  • Registrado: Jul 06, 2010
  • Mensajes: 266
  • Status: Offline

Nota Febrero 23rd, 2011, 3:00 pm

Gracias por su respuesta rápida. Voy a mirar en los requisitos del sistema.

Quote:
Hay un montón de quejas sobre Flash Player 10 que utiliza el 100% de la CPU (y un montón de archivo de intercambio de memoria /).


Esto es útil estoy corriendo Flash Player 10.

Nota al margen:
Hasta que arreglar este problema todavía estoy abierto a ideas sobre el tema.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • Avatar de Usuario
  • Registrado: May 28, 2003
  • Mensajes: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Nota Febrero 23rd, 2011, 3:07 pm

Hablando de bloqueos, adivina lo que acaba de estrellarse? Dar ese hombre un puro! Sólo viendo un video en el firefox y una vez más el plugin flash se estrelló.

http://support.mozilla.com/en-US/kb/Plu ... ports?as=u
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.

Publicar Información

  • Total de mensajes en este tema: 4 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 45 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