0 Replies Latest reply on Aug 2, 2007 12:10 PM by amy123

    SetMedia problem with MediaPlayback - external MP3s

    amy123
      I'm using the MediaPlayback component to play an external MP3 file, and it's working fine, EXCEPT that when it first loads it plays the first part of the clip for a split second, then stops and re-plays it -- regardless of the autoPlay settings that are used.

      I have autoPlay set to false, both in the component properties panel AND explicitly in the code before the setMedia call. In the code below, the trace executes even though I've set autoPlay to false.

      I can stop the "blip" from happening if I inject a pause() or stop() command after the setMedia() call -- HOWEVER, it happens again when I call the play() method to play the file.

      HELP!! Anyone else out there had this problem and solved it??? I'm at my wit's end. See code snippet below.

      -------------------------------------------------------------------------
      soundFile = "arabian_dreams.mp3";

      // Make sure media does not start playing 'til we tell it to
      myMedia.autoPlay = false;

      // Set the sound file for the MP3 player
      myMedia.setMedia(soundFile, "MP3");

      // Attempting to fix problem where the setMedia
      // function plays the clip for a fraction of a second
      // on loading, regardless of the autoPlay settings
      //myMedia.pause();
      //myMedia.stop();

      if (myMedia.playing == true) {
      trace("playing!");
      }

      // Now play the sound
      myMedia.play(0);