5 Replies Latest reply on Jun 5, 2008 2:44 PM by slaingod

    Problems with video player

    razor7_996 Level 1
      Hello...i´m preparing some kind of video player in this URL http://www.playtime.com.ar/proyector/ but when i upload it, it seems that the videos don´t load well, but in my desktop, just worked OK with Flex Builder.

      Why are those videos not loading?, shall I use some statement to indicate flex that the video must be 100% cached before play?, How?

      Thanks in advise...
        • 1. Re: Problems with video player
          slaingod Level 1
          One thing I ran across recently is that the VideoEvent.READY is bugged and you need to use the MetadataEvent.METADATA_RECEIVED before you allow play back to commence or you may see things like audio but no video playback, incorrect totalTime, etc. Using autoPlay seems to avoid some of these issues as well.
          • 2. Re: Problems with video player
            razor7_996 Level 1
            Hello. I´m using this code for the playback


            private function progressHandler(event:ProgressEvent):void {
            progreso.text=\"Cargados: \" + Math.round(vPreviaMini.bytesLoaded/1024)/1000 + \" de \" + Math.round(vPreviaMini.bytesTotal/1024)/1000 + \"...\";
            if (vPreviaMini.bytesLoaded == vPreviaMini.bytesTotal)

            private function populateFromTree(event:Event):void {
            var node:XML=event.target.selectedItem;

            if(node.@id != undefined) {
            fadeEffectFunction(true, vPreviaMini);
            vPreviaMini.source = \"discos/\"+node.@carpeta+\"/\"+node.@unNombre;
            panelDetalles.title=\"Vista previa de \"+node.@unNombre+\" - Categoría: \"+node.@carpeta;
            } else {
            vPreviaMini.source = \"\";
            panelDetalles.title=\"Seleccione un item para ver su vista previa\";

            And also attached the progressHandler function to the VideDisplay component

            <mx:VideoDisplay progress=\"progressHandler(event)\" bufferTime=\"100\" live=\"false\" source=\"discos/Caleidoscopio/Caleidoscopio1\" x=\"109.5\" y=\"0\" width=\"306\" height=\"230\" autoPlay=\"false\" id=\"vPreviaMini\" complete=\"advPlaylist(event as VideoEvent)\"/>

            Thanks in advice

            • 3. Problems with video player
              slaingod Level 1
              I think bufferTime is in seconds, so you are telling it to load 100 seconds before playing.

              if (vPreviaMini.bytesLoaded == vPreviaMini.bytesTotal)
              might be causing a problem. You should wait on the MetadataEvent as I indicated above before starting a play explicitly (instead of just using autoPlay). There is a race condition that occurs I believe, and a bug about this in the bug tracker:

              vPreviaMini.addEventListener(MetadataEvent.METADATA_RECEIVED, onMyPlayVideoMethod);

              • 4. Re: Problems with video player
                razor7_996 Level 1
                Hello...here is the code posted in the bugtracker, but i have added 2 more videos, one in my server mgscreativa.com.ar an other in my clients server playtime.com.ar, both are the same exact video...but the metadata received event never happens with those...

                I´m going crazy...!!!...jajaja, what I´m doing wrong?

                Thanks in advise
                • 5. Re: Problems with video player
                  slaingod Level 1
                  In general you will need to run a Metadata creation tool like flvtool2 on the output flv after creating the flv with ffmpeg or mencoder for instance.