0 Replies Latest reply on Oct 17, 2006 8:53 PM by JimHoskins

    Video length problem

    JimHoskins
      Im having a small problem, I am trying to build video controls in my application, creating a playhead using an HSlider.

      my video is defined
      =====
      <mx:VideoDisplay autoPlay="false" id="video" live="false" >
      <mx:source>...source....</mx:source>
      <mx:volume>.75</mx:volume>
      <mx:playheadUpdateInterval >25</mx:playheadUpdateInterval>
      </mx:VideoDisplay>
      ====


      and the slider is
      ====
      <mx:HSlider maximum="{video.totalTime}" enabled="true" change="setVideo(event)" id="playhead" allowTrackClick="true" value="{video.playheadTime}" >
      ====

      the function i used is
      =====

      private function setVideo(event:SliderEvent):void {
      var currentSlider:Slider=Slider(event.currentTarget);
      video.playheadTime=currentSlider.value;
      }
      =====
      The problem is the totalTime sometimes loads immediately, but most often waits for the video to play through. This causes the slider max to be NaN, removing all functionality.

      Is there a better method for creating the playhead? the files are flvs over http, so not live.
      Thanks for any help